Hi!
I am trying to make a automation that sends notification when a window or door is open during arming of house alarm.
The trigger and the action is ok, as i use the same code in other automations, but the conditions does not work, so i obviously doing something wrong…
All windows and doors has binary door/window sensors, and my goal is alert when one of them is in state “on”.
I am sure that i could use a better/shorter method, but this is what i have tried and it does not work:
condition:
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.openclose_23
state: 'on'
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.openclose_31
state: 'on'
- condition: or
conditions:
- condition: state
entity_id: sensor.terrasse_door_stue
state: 'on'
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.openclose_20
state: 'on'
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.openclose_33
state: 'on'
Yes that was my mistake, now it works!
Now i think i have to extend the functionality and figure out how i can include what sensor(s) that is on (what door/window is open) in the notification message.
Maybe i have to use a script and set a variable, i have to search here or google
I’d strongly advice to start from reading official docs. The reason is HA evolves constantly and rapidly so every solution becomes obsolete or even doesn’t work anymore within months. On the other hand, docs are more or less up to date and contain some working examples.
There is also a cookbook.