I’m trying to create notification that if I have left any of these sensors open it will tell me which one as the alarm cannot set if they are on (open)
alias: Notify if Securitas Sensor Open Nicholas
description: ''
trigger:
- platform: state
entity_id: person.nicholas
from: home
to: not_home
condition:
- condition: state
entity_id: binary_sensor.kitchen_window_l
state: 'on'
- condition: state
entity_id: binary_sensor.kitchen_window_r
state: 'on'
- condition: state
entity_id: binary_sensor.kitchen_door_l
state: 'on'
action:
- service: persistent_notification.create
data:
message: >-
{% if is_state('binary_sensor.front_door', 'on') %} the front door is
open {% endif %} {% if is_state('binary_sensor.kitchen_window_l',
'on') %} , the left kitchen window is open {% endif %} {% if
is_state('binary_sensor.kitchen_window_r', 'on') %} , the right
kitchen window is open {% endif %} {% if
is_state('binary_sensor.kitchen_door_l', 'on') %} , the left kitchen
door is open {% endif %}
- service: notify.mobile_app_note20
data:
title: Nicholas Alarm cannot arm because
message: >-
{% if is_state('binary_sensor.front_door', 'on')
%} - the front door is open
{% endif %}
{% if is_state('binary_sensor.kitchen_window_l',
'on') %} - the left kitchen window is open
{% endif %} {% if
is_state ('binary_sensor.kitchen_window_r', '.
on') %} - the right
kitchen window is open
{% endif %} {% if
is_state('binary_sensor.kitchen_door_l', 'on') %}
- the left kitchen door is open
{% endif %}
mode: single
Do I need to put OR? It only works if I have just the one trigger. Probably something very simple I am missing…
alias: Notify if Securitas Sensor Open Nicholas
description: ''
trigger:
- platform: state
entity_id: person.nicholas
from: home
to: not_home
condition:
- condition: state
entity_id: person.angelina
state: not_home
- condition: state
entity_id: binary_sensor.kitchen_window_l
state: 'on'
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.kitchen_window_r
state: 'on'
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.kitchen_door_l
state: 'on'
action:
- service: persistent_notification.create
data:
message: >-
{% if is_state('binary_sensor.front_door', 'on') %} the front door is
open {% endif %} {% if is_state('binary_sensor.kitchen_window_l',
'on') %} , the left kitchen window is open {% endif %} {% if
is_state('binary_sensor.kitchen_window_r', 'on') %} , the right
kitchen window is open {% endif %} {% if
is_state('binary_sensor.kitchen_door_l', 'on') %} , the left kitchen
door is open {% endif %}
- service: notify.mobile_app_note20
data:
title: Nicholas Alarm cannot arm because
message: >-
{% if is_state('binary_sensor.front_door', 'on') %} - the front door
is open {% endif %} {% if is_state('binary_sensor.kitchen_window_l',
'on') %} - the left kitchen window is open {% endif %} {% if
is_state('binary_sensor.kitchen_window_r', 'on') %} - the right
kitchen window is open {% endif %} {% if
is_state('binary_sensor.kitchen_door_l', 'on') %} - the left kitchen
door is open {% endif %}
mode: single
alias: Notify if Securitas Sensor Open Nicholas
description: ''
trigger:
- platform: state
entity_id: person.nicholas
from: home
to: not_home
condition:
- condition: and
conditions:
- condition: state
entity_id: person.angelina
state: not_home
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.kitchen_window_r
state: 'on'
- condition: state
entity_id: binary_sensor.kitchen_window_l
state: 'on'
- condition: state
entity_id: binary_sensor.kitchen_door_l
state: 'on'
- condition: state
entity_id: binary_sensor.front_door
state: 'on'
action:
- service: persistent_notification.create
data:
message: >-
{% if is_state('binary_sensor.front_door', 'on') %} the front door is
open {% endif %} {% if is_state('binary_sensor.kitchen_window_l',
'on') %} , the left kitchen window is open {% endif %} {% if
is_state('binary_sensor.kitchen_window_r', 'on') %} , the right
kitchen window is open {% endif %} {% if
is_state('binary_sensor.kitchen_door_l', 'on') %} , the left kitchen
door is open {% endif %}
- service: notify.mobile_app_note20
data:
title: Nicholas Alarm cannot arm because
message: >-
{% if is_state('binary_sensor.front_door', 'on') %} - the front door
is open {% endif %} {% if is_state('binary_sensor.kitchen_window_l',
'on') %} - the left kitchen window is open {% endif %} {% if
is_state('binary_sensor.kitchen_window_r', 'on') %} - the right
kitchen window is open {% endif %} {% if
is_state('binary_sensor.kitchen_door_l', 'on') %} - the left kitchen
door is open {% endif %}
mode: single