Hello everyone!
I am currently still using the FHEM system, but would like to switch to HA and am still a beginner here. In FHEM, I have written auxiliary functions in Perl to generate a notification for open windows.
Specifically, I first check whether the outside temperature (queried by an internet service) is above 16 degrees. If this is the case, nothing else happens.
If the temperature is 16 degrees or less, a trigger is set so that an announcement is made after 5 minutes: ‘Please close window XYZ.’
XYZ is a placeholder and is replaced by the name of the sensor that triggered the event. E.g. ‘Living room’. After 5 minutes, the text is then spoken on my Alexa.
If the window for which the trigger was created is closed in the meantime, the trigger created is closed.
I have already successfully implemented something like this via an automation in HA:
alias: Notification - Window opened
description: ""
mode: single
triggers:
- type: opened
device_id: ...........
entity_id: ...........
domain: binary_sensor
for:
hours: 0
minutes: 0
seconds: 20
trigger: device
conditions: []
actions:
- repeat:
sequence:
- device_id: ...........
domain: mobile_app
type: notify
title: "Window"
message: Was opened
- delay:
hours: 0
minutes: 0
seconds: 10
milliseconds: 0
- data:
data:
type: tts
message: This is a test
action: notify.alexa_media_firetv_wohnzimmer
while:
- type: is_open
condition: device
device_id: ...........
entity_id: ...........
domain: binary_sensor
Now I would like to generalise this automation. In other words, I would like to have an automation that works for all window sensors. And the name should be embedded in the announcement. How would this work in HA?