Hello everyone,
used the Synology DSM Integration for my Synology NAS and created a nice little Device Dashboard with all the information about my Synology NAS and three buttons for WakeOnLAN, Reboot and Shutdown. So far so good, everything runs smooth. Now I wanted to add some notification automations, for example when I press the Reboot Button, I get a notfication that the system now reboots. Same for shutdown. I used the Device trigger on. When NAS reboot is pressed. Unfortunately all my notifications for the NAS are triggered simultaneously when I start my NAS and the boot process is finished. It seems like all functions change there state and this also fires the notification. Maybe their is something wrong with my notification, but I think this could be fixed with some additional filtering at the trigger. But I was not able to figure out how.
Maybe some of you are able to help me.
Thanks
Sure. This is the yaml for the Notification which should be send at the reboot.
alias: NAS - Notification (Reboot)
description: ""
trigger:
- platform: device
device_id: 61874d5f37e52a98ab8d339ef8cebbf3
domain: button
entity_id: 7f9d47d7014fed5bfdfa961685e41182
type: pressed
condition: []
action:
- service: notify.notify
metadata: {}
data:
title: NAS wird neugestartet
message: Synology NAS (10.0.0.13) wird jetzt neugestartet.
mode: single
I also checked the traces and I have two different versions. The first version is the one which was triggered by my button click. so this one is fine.
this:
entity_id: automation.nas_notification_reboot
state: 'on'
attributes:
id: '1705861107992'
last_triggered: '2024-01-22T19:10:11.657313+00:00'
mode: single
current: 0
icon: mdi:message-badge-outline
friendly_name: NAS - Notification (Reboot)
last_changed: '2024-01-22T19:09:30.011046+00:00'
last_updated: '2024-01-22T19:10:11.666356+00:00'
context:
id: 01HMS99269XS8Z015HB2P6WKZV
parent_id: 01HMS99265Y5PZDM7WMEHKN1ND
user_id: null
trigger:
id: '0'
idx: '0'
alias: null
platform: state
entity_id: button.nas_reboot
from_state:
entity_id: button.nas_reboot
state: unavailable
attributes:
restored: true
device_class: restart
friendly_name: NAS Reboot
supported_features: 0
last_changed: '2024-01-22T19:10:11.653877+00:00'
last_updated: '2024-01-22T19:10:11.653877+00:00'
context:
id: 01HMS99265Y5PZDM7WMEHKN1ND
parent_id: null
user_id: null
to_state:
entity_id: button.nas_reboot
state: '2024-01-22T19:09:46.129916+00:00'
attributes:
device_class: restart
friendly_name: NAS Reboot
last_changed: '2024-01-22T19:13:22.987278+00:00'
last_updated: '2024-01-22T19:13:22.987278+00:00'
context:
id: 01HMS9EX1B83VYY49A3Z9FWF7E
parent_id: null
user_id: null
for: null
attribute: null
description: state of button.nas_reboot
the second one is the one which was triggered automaticaly after the boot process was completed.
this:
entity_id: automation.nas_notification_reboot
state: 'on'
attributes:
id: '1705861107992'
last_triggered: '2024-01-22T19:28:39.858921+00:00'
mode: single
current: 0
icon: mdi:message-badge-outline
friendly_name: NAS - Notification (Reboot)
last_changed: '2024-01-22T19:29:13.048115+00:00'
last_updated: '2024-01-22T19:29:13.048115+00:00'
context:
id: 01HMSABWTRHNYREJ5S77PVKR59
parent_id: null
user_id: null
trigger:
id: '0'
idx: '0'
alias: null
platform: device
entity_id: button.nas_reboot
from_state:
entity_id: button.nas_reboot
state: '2024-01-22T19:22:25.670199+00:00'
attributes:
device_class: restart
friendly_name: NAS Reboot
last_changed: '2024-01-22T19:28:39.855324+00:00'
last_updated: '2024-01-22T19:28:39.855324+00:00'
context:
id: 01HMSAAWDFST11081WFZQCKMVC
parent_id: null
user_id: null
to_state:
entity_id: button.nas_reboot
state: unavailable
attributes:
restored: true
device_class: restart
friendly_name: NAS Reboot
supported_features: 0
last_changed: '2024-01-22T19:43:40.067002+00:00'
last_updated: '2024-01-22T19:43:40.067002+00:00'
context:
id: 01HMSB6BH3M4NJ3P0TV8V7QSZD
parent_id: null
user_id: null
for: null
attribute: null
description: state of button.nas_reboot
i already discovered that the attributes in the correct one and the mistriggered one are different and I thought i could create a condition to only trigger the correct one. but I’m not experienced enough to understand if this would work and if this is a dirty workaround and their is a better solution.