Thereâs no state âoffenâ in HA. These are translations.
Check the states of the sensor.window_arbeiten in Dev tools/states.
Donât know if the rest will work, too lazy at the moment.
When the trigger is the event the trigger variable does not have an entity_id field. You would have to use trigger.event.data.entity_id in that case. See available trigger data for event triggers.
Above makes sense. I implemented it, no change. Whats get me thinking is that if the above was the only problem, it should at least warn twice before the change. That was not the case.
When I manually start the timer from the debug interface in the UI the automation gets not triggered either. Something is wrong with the trigger event above.
more often than you might think, the situation arises where you still want to leave the windows open. Then you will be flooded with (in this case unwanted) notifications. Therefore, think about the use of âalertsâ. These can be acknowledged and are thus muted until the windows are closed (and automatically activated again).
Alerts do not allow complex conditions, so you use an automation to set an input_boolean (as a side effect, this makes development and testing easier). And this variable will be used as trigger for the alert.
A simplyfied example:
Setup group
group:
fenster_tueren:
name: Fenster und TĂŒren
entities:
- binary_sensor.tuer_eingang_reed
- binary_sensor.tuer_terrasse_reed
- binary_sensor.tuer_balkon_reed
- binary_sensor.fenster_wc_reed
- binary_sensor.fenster_bad_reed
# an so on
Setup input_boolean
input_boolean:
fenster_tueren_offen:
name: Fenster oder TĂŒren sind offen
Automation to trigger the input_boolean:
- alias: Fenster/TĂŒren sind offen - Statusvariable auf true setzen
description: ''
trigger:
- platform: state
entity_id: group.fenster_tueren
to: 'on'
condition:
- condition: numeric_state
entity_id: sensor.klima_garten_temperatur
below: '20'
#some more conditions...
action:
- service: input_boolean.turn_on
data:
entity_id: input_boolean.fenster_tueren_offen
mode: single
- alias: Fenster/TĂŒren sind offen - Statusvariable auf false setzen
description: ''
trigger:
- platform: state
entity_id: group.fenster_tueren
to: 'off'
condition: []
action:
- service: input_boolean.turn_off
data:
entity_id: input_boolean.fenster_tueren_offen
mode: single
One question: this automation is triggered when a windows is open. But If there are 2 windows open and I close just one the alert repeat is reset or not?
The group is set to âonâ as soon as one or more windows or doors are opened. Only when all windows/doors are closed again does the group go back to âoffâ. So the alert is not reset, if you close only one of the two opened windows.
Yes. If you open the first window and 10 minutes later the second window, youâll get a notification after 15 minutes with both windows mentioned, although the second window is opened for just 5 minutes.