@Mariusthvdb wrote:
using this automation:
- alias: 'GitHub repo update installed' trigger: platform: event event_type: state_changed condition: - condition: template value_template: > {{trigger.event.data.new_state.entity_id.startswith('input_boolean.github')}} - condition: template value_template: > {{trigger.event.data.new_state.state == 'off' and trigger.event.data.old_state.state == 'on'}} action: service: persistent_notification.dismiss data_template: notification_id: > {{trigger.event.data.new_state.object_id}}
dismisses the persistent_notification when the input_boolean is turned off.
Id like to add an automation to do the exact same in reverse: turn_off the input_boolean, when the persistent_notification is dismissed.
but I am puzzled which service to use as trigger (for starters…) Can I use an event trigger on the call-service?if so, what would be the way to get the correct trigger service-data so I can pass the notification-id over to the input_boolean to dismiss it…
- alias: 'Persistent notification dismissal turns off boolean' trigger: platform: event event_type: call_service event_data: domain: persistent_notification service: dismiss condition: #check for 'github' so this only fires for selected notification dismissals condition: template value_template: > {{'github' in trigger.event.data.new_state.object_id}} action: service: input_boolean.turn_off data_template: entity_id: > input_boolean.{{trigger.event.data.new_state.object_id}}
would this be close?
thanks for having a look.extra reason I seek your assistance is this cant very easily be tested, because only very nice in a while a new GitHub repo update occurs… I need some keen eyes to check if I made no syntax or logic errors.
also, in the events list on developer-tools/event, the dismiss isn’t listed. only see this:
Posts: 1
Participants: 1