Hi guys, i didnt find how to add this condition.
I want to verify if the switch of my humidifier has been turn off in the last 10 min dont execute the automatisation.
I think i need to use a state_chage but didnt understand the doc about it.
alias: Humidifier On
description: ""
trigger:
- platform: numeric_state
entity_id: sensor.thermometre_salon_humidity
below: sensor.desired_humidity_min
condition: []
action:
- action: switch.turn_on
target:
entity_id: switch.prise_double_humidificateur
data: {}
mode: single
You can just use a State condition with a defined duration by using the for
variable. If the switch was not turned off at least 10 minutes ago, the actions won’t be executed.
alias: Humidifier On
description: ""
trigger:
- platform: numeric_state
entity_id: sensor.thermometre_salon_humidity
below: sensor.desired_humidity_min
condition:
- condition: state
entity_id: switch.prise_double_humidificateur
state: 'off'
for:
minutes: 10
action:
- action: switch.turn_on
target:
entity_id: switch.prise_double_humidificateur
data: {}
mode: single
The State condition using for
handles all that for you.
Thx for the reply, can you give me an example of a for loop, I struggle to do it on the YAML code
Not a for loop… the configuration variable for
which adds a duration requirement (see the State Condition my previous post).