Hey, i tried the one below, the lights turn on/off when binary sensor state change… so far so good
But this one doesnt get respected, seems the minutes are just ignored? what am i missing?
for:
minutes: 15
- alias: Xiaomi Sensor Badkamer
initial_state: 'on'
mode: single
trigger:
- entity_id: binary_sensor.xiaomi_sensor_3
platform: state
from: 'off'
to: 'on'
id: 'on'
## you cant have a condition here - this is triggers ##
- entity_id: binary_sensor.xiaomi_sensor_3
platform: state
from: 'on'
to: 'off'
for:
minutes: 15
id: 'off'
condition: []
## the condition can go here if its a global condition for the whole automation ##
action:
- choose:
- conditions:
- condition: trigger
id: 'on'
- condition: numeric_state
entity_id: sensor.xiaomi_sensor_3
below: 20
sequence:
- service: light.turn_on
entity_id: light.badkamer
default: []
- choose:
- conditions:
- condition: trigger
id: 'off'
sequence:
- service: light.turn_off
entity_id: light.badkamer
- service: light.turn_off
entity_id: light.badmeubel
- service: light.turn_off
entity_id: light.douche
default: []
I believe I need some AND instruction in the first section of the actions… So ID = on AND numeric state should be below 20