I have taken the code from someones blue print and I am attempting to make an option to define a name for grouping notifications.
action:
- delay: "{{ delay }}"
- service: camera.snapshot
entity_id: !input "camera"
data:
filename: "{{ snapshot_create_file_path }}"
- device_id: !input "notify_device"
domain: mobile_app
type: notify
title: "{{ notification_title }}"
message: "{{ notification_message }}"
data:
'{% set android_data = { "channel": "alarm_motion", "group": "alarm_motion",
"ttl": 0, "priority": "high", "clickAction": "%s", "image": "%s"} | format(clickAction,
snapshot_access_file_path) %} {% set ios_data = { "channel": "alarm_motion", "url":
"%s", "apns_headers": { **"apns-collapse-id": "groupingname"** }, "attachment": {"url":
"%s", "content_type": "JPEG"}, "push": { "sound": { "name": "default" } } } | format(clickAction, snapshot_access_file_path) %} {{
ios_data if is_ios else android_data }}'
This line overwrites past notifications with the latest on iOS. but doing this just groups them all together as groupingname. I want to use this blueprint for other devices so don’t want to group all notifications. I want groupingname to be defined when using the blueprint by the user.
apns-collapse-id": “groupingname”
I have added this to the blueprint
variables:
groupingname: !input "groupingname"
However no joy… two different notifications set up in two automations overwrite each other.