Hey, I have an automation running that detects open windows and sends me a notification when I forget to close them.
Everything works fine until I try to group the notifications. Then, the notification that was sent first, configured with that group, won’t be cleared by my automation. But when I clear the notification manually using the developer tools it again works just fine.
The trigger looks like this: (the duration is 2 seconds for debugging purposes)
# TRIGGER STEP
trigger: state
entity_id:
- binary_sensor.fenstersensor_galerie
- binary_sensor.fenstersensor_wohnzimmer
- binary_sensor.fenstersensor_schlafzimmer
to: "on"
for:
hours: 0
minutes: 0
seconds: 2
I then create the following variables:
# VARIABLES STEP
variables:
room: "{{ area_name(trigger.entity_id) }}"
room_id: "{{ area_id(trigger.entity_id) }}"
tag_prefix: fensterueberwachung
group: Fenster
and send the corresponding notification:
# NOTIFICATION STEP
action: notify.residents
data:
message: Das Fenster ist offen.
title: Fenster zu machen!
data:
tag: "{{ tag_prefix ~ '-' ~ room_id }}"
persistent: true
clickAction: noAction
notify.residents
is a group in my configuration.yaml
.
I then wait until I close the window and clear the notification;
# CLEAR STEP
action: notify.residents
data:
message: clear_notification
data:
tag: "{{ tag_prefix ~ '-' ~ room_id }}"
But when I try to group the notifications by adding:
group: "{{ group }}"
into the notification data the clearing stops working.
When I take a look into the notification history in my companion app the clear_notification
message sent by my automation looks exactly the same as the manual one.
Am I missing something, is the combination of persistent
and group
even possible?
Let me know if you need more information or some screenshots of my notification history.
Thank you in advance!