#Can't use "for x minutes" in condition? (within choose action)

1 messages · Page 1 of 1 (latest)

hushed narwhal
#

I would like to turn on an input boolean when a power plug detects that my dishwasher is above 5 watts for 1 minute and turn off when it's below 1 watt for 5 minutes. (or maybe with different values in the future)

The UI doesn't allow this but seems like I also can't save the automations like this. is there are correct way of doing this?

Message malformed: extra keys not allowed @ data['actions'][0]['choose'][0]['conditions'][0]['for']

alias: Vaatwasser in gebruik dectectie
description: ""
triggers:
  - trigger: state
    entity_id:
      - sensor.meter_vaatwasser_vermogen
conditions: []
actions:
  - choose:
      - conditions:
          - condition: numeric_state
            entity_id: sensor.meter_vaatwasser_vermogen
            above: 5
            for:
              minutes: 1
        sequence:
          - action: input_boolean.turn_on
            data: {}
            target:
              entity_id: input_boolean.vaatwasser_in_gebruik
      - conditions:
          - condition: numeric_state
            entity_id: sensor.meter_vaatwasser_vermogen
            below: 1
            for:
              minutes: 5
        sequence:
          - action: input_boolean.turn_off
            data: {}
            target:
              entity_id: input_boolean.vaatwasser_in_gebruik
mode: restart
frozen olive
#

Why not just make them turn on/off triggers?

hushed narwhal
#

Wouldn't I need 2 automations then?

#

Ah nevermind, I looked around and wasn't aware of trigger ID's

frozen olive
#

Yeah you can have multiple triggers and use an id, but you could also just check the state again

hushed narwhal
#

True, thanks!