good evening, i’m currently trying my hand at automation, it’s working quite well so far!
now i would like to handle the whole thing a little easier! i have a helper group with all windows and doors, now i would like to use this as a trigger and get the message as a push message which window/door is still open!
is something like this possible?
alias: Wohnzimmerfenster offen test
description: ""
trigger:
- type: opened
platform: device
device_id: xxxxx
entity_id:xxxxx
domain: binary_sensor
for:
hours: 0
minutes: 1
seconds: 0
condition:
- condition: numeric_state
entity_id: sensor.aussentemperatur
below: 10
action:
- service: notify.mobile_app_xxxx
metadata: {}
data:
message: Fenster im Wohnzimmer ist offen!
- repeat:
sequence:
- delay:
hours: 0
minutes: 1
seconds: 0
milliseconds: 0
- service: notify.mobile_app_xxx
metadata: {}
data:
message: Wohnzimmerfenster ist noch offen!
until:
- type: is_not_open
condition: device
device_id: xxxx
entity_id: xxx
domain: binary_sensor
mode: single
like this one for lights:
{% set active_lights = states.light | selectattr('state', 'eq', 'on') | list %}
{% if active_lights | count > 0 %}
{% set light_names = active_lights | map(attribute='name') | join(', ') %}
{{ light_names }}
{% else %}
Keine Lampen eingeschaltet
{% endif %}