Is there a way to get a push notification of the notification from sidebar?
I have searched and found of an old Blueprint but that didn’t work.
Is there a way to get a push notification of the notification from sidebar?
I have searched and found of an old Blueprint but that didn’t work.
Here’s the automation I use to forward every sidebar notification to my phone:
alias: System Notify Forward
description: ""
mode: queued
triggers:
- event_type: call_service
event_data:
domain: persistent_notification
service: create
trigger: event
conditions: []
actions:
- target:
entity_id:
- input_number.notification_count
device_id: []
area_id: []
data: {}
action: input_number.increment
- data:
message: "{{trigger.event.data.service_data.message}}"
title: "{{trigger.event.data.service_data.title}}"
data:
push:
badge: "{{states('input_number.notification_count')}}"
action: notify.kyle
You need to also have a numeric helper called notification_count
. Here’s the automation to fix the number badge on my phone when I dismiss one or more notifications:
alias: System Notify Delete
description: ""
mode: queued
triggers:
- event_type: call_service
event_data:
domain: persistent_notification
service: dismiss
id: dismiss_one
trigger: event
- event_type: call_service
event_data:
domain: persistent_notification
service: dismiss_all
id: dismiss_all
trigger: event
conditions:
- condition: numeric_state
entity_id: input_number.notification_count
above: "0"
actions:
- if:
- condition: trigger
id:
- dismiss_one
then:
- target:
entity_id:
- input_number.notification_count
device_id: []
area_id: []
data: {}
action: input_number.decrement
else:
- target:
entity_id:
- input_number.notification_count
device_id: []
area_id: []
data:
value: 0
action: input_number.set_value
- data:
message: delete_alert
data:
push:
badge: "{{states('input_number.notification_count')}}"
action: notify.kyle
and in configuration.yaml I have a line:
notify: !include notify.yaml
and in notify.yaml
I have:
- platform: group
name: all
services:
- service: mobile_app_kyles_ipad
- service: mobile_app_kyles_iphone_2
- service: mobile_app_shannons_iphone
- platform: group
name: kyle
services:
- service: mobile_app_kyles_ipad
- service: mobile_app_kyles_iphone_2
- platform: group
name: shannon
services:
- service: mobile_app_shannons_iphone
Thank you very much