I appreciate it. Here’s a quick rewrite of it with some random ORed conditions
alias: Window Opened
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.all_windows
to: "on"
for:
hours: 0
minutes: 0
seconds: 30
condition:
- condition: or
conditions:
- condition: numeric_state
entity_id: sensor.weather_home_outside_temperature
below: 50
- condition: device
device_id: ce5a8de3e151e1e68ad77e941d8af9a3
domain: alarm_control_panel
entity_id: alarm_control_panel.home
type: is_armed_night
- condition: device
type: is_on
device_id: 77d1cb552d033cb713d6ad36cbd00f4c
entity_id: light.dining_room_light
domain: light
action:
- repeat:
while:
- condition: state
entity_id: binary_sensor.all_windows
state: "on"
sequence:
- service: notify.mobile_app_scotts_phone
data:
title: A window is open
message: >-
These windows need closed because the xyz: {{
expand('binary_sensor.all_windows')
| selectattr('state', 'eq', 'on')
| map(attribute='name')
| list
| join (', ')
}}
- delay:
hours: 0
minutes: 5
seconds: 0
milliseconds: 0
mode: single
I know we are on the same page but just to put it in here -
I want the notification message to say one of these:
- These windows need closed because the Outdoor Temperature is Below 50: Living Room Window
- These windows need closed because the Home is Armed Night: Living Room Window
- These windows need closed because the Dining Room Light is On: Living Room Window