#Act immediately on state change, if previous state met minimum duration?

1 messages · Page 1 of 1 (latest)

radiant zenith
#

I want to fire an event immediately when a sensor is closed, but only when the sensor was open for a minimum length of time. Is there a way to template this without outside entities?

gaunt nova
#

Use a trigger for open with a for: block, then a wait_for_trigger or wait_template in the action for it closing

radiant zenith
#

okay so making sure I'm reading this right (both your message and the docs), Door Closed itself is not the trigger, it's just part of the actions for Door Open

gaunt nova
#

That's how I would do it

radiant zenith
#

Makes sense, thanks!

#
  - trigger: state
    entity_id: binary_sensor.gv5123220b_opening
    id: lid_opened
    from: "off"
    to: "on"
    for:
      hours: 0
      minutes: 0
      seconds: 15
      - conditions:
          - condition: trigger
            id:
              - lid_opened
        sequence:
          - wait_for_trigger:
              - trigger: state
                entity_id:
                  - binary_sensor.gv5123220b_opening
                from: "on"
                to: "off"
          - action: ...
gaunt nova
#

Not sure what that input_boolean is for

#

And I don't think the continue_on_timeout bit will do anything if you don't provide a timeout

radiant zenith