SeanPM5 / homeassistant-config

14 stars 0 forks source link

Add thread ID's and anps-collapse-id's to all my iOS notifications #11

Closed SeanPM5 closed 5 years ago

SeanPM5 commented 5 years ago

With thread id's and iOS 12, you can group notifications together. So add these thread id's to group all related notifications (car, presence, system, feedreader, etc). iOS notification docs:

    action:
      service: notify.ios_<your_device_id_here>
      data:
        title: "Smart Home Alerts"
        message: "Something happened at home!"
        data:
          push:
            thread-id: "example-notification-group"

And just added in iOS 2.0 beta is something even cooler, apns-collapse-id. This works very similar to notification_id in persistent_notifications in that it will replace an existing notification with that same ID. Good for motion detected notifications and stuff, where you might want to get those notifications but don't want dozens of them on your lock screen.

- alias: Notify iOS app
    trigger:
      ...
    action:
      service: notify.mobile_app_robbies_iphone
      data:
        message: "Something happened at home!"
        data:
          apns_headers:
            'apns-collapse-id': 'my-cool-collapse-id'