I have this blueprint working now where it can send notifications to multiple devices (both Android and iOS)
Please note that I am what one would call an āidiotā, so I mightāve done something dumb here, but it does work.
Go to your file editor and open /blueprints/automation/Stan-Gobien/CriticalCollapseOptionNotHomeMotionCameraSnapshotWithClickAction.yaml
Note the section that says:
notify_device:
name: Device to notify
description: Device that runs the official Home Assistant app to receive notifications.
selector:
device:
integration: mobile_app
multiple: false
Duplicate this section and rename the ānotify_deviceā for each into something unique. I did ānotify_device1ā and ānotify_device2ā because I am a simple man. See below for what that looks like:
notify_device1:
name: Device to notify
description: Device that runs the official Home Assistant app to receive notifications.
selector:
device:
integration: mobile_app
multiple: false
notify_device2:
name: Device to notify
description: Device that runs the official Home Assistant app to receive notifications.
selector:
device:
integration: mobile_app
multiple: false
Now scroll down to the āvariablesā section and find:
notify_device1: !input notify_device
Duplicate this line and rename it to what you renamed the devices earlier. In my case:
notify_device1: !input notify_device1
notify_device1: !input notify_device2
Now scroll down to the āactionsā section and find:
- 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: "{% if is_ios %}\n {% if is_critical %}\n {% set platform_data = { \"channel\":
\"%s\", \"url\": \"%s\", \"attachment\": {\"url\": \"%s\", \"content_type\": \"JPEG\"},
\ \"push\": { \"category\": \"%s\", \"sound\": { \"name\": \"default\", \"critical\":
1, \"volume\": 1.0 } } } | format(channel_name, clickAction, snapshot_access_file_path,
group_name) %}\n {% else %}\n {% if overwrite_similar %}\n {% set platform_data
= { \"channel\": \"%s\", \"url\": \"%s\", \"apns_headers\": { \"apns-collapse-id\":
\"%s\" }, \"attachment\": {\"url\": \"%s\", \"content_type\": \"JPEG\"}, \"push\":
{ \"category\": \"%s\", \"sound\": { \"name\": \"default\", \"volume\": 1.0 }
} } | format(channel_name, clickAction, group_name, snapshot_access_file_path,
group_name) %}\n {% else %}\n {% set platform_data = { \"channel\": \"%s\",
\"url\": \"%s\", \"attachment\": {\"url\": \"%s\", \"content_type\": \"JPEG\"},
\ \"push\": { \"category\": \"%s\", \"sound\": { \"name\": \"default\", \"volume\":
1.0 } } } | format(channel_name, clickAction, snapshot_access_file_path, group_name)
%}\n {% endif %}\n {% endif %}\n{% else %}\n {% if is_critical %}\n {%
if overwrite_similar %}\n {% set platform_data = { \"tag\": \"%s\", \"channel\":
\"%s\", \"group\": \"%s\", \"ttl\": 0, \"priority\": \"high\", \"clickAction\":
\"%s\", \"image\": \"%s\"} | format(group_name, channel_name, group_name, clickAction,
snapshot_access_file_path) %}\n {% else %}\n {% set platform_data = {
\"channel\": \"%s\", \"ttl\": 0, \"priority\": \"high\", \"clickAction\": \"%s\",
\"image\": \"%s\"} | format(channel_name, clickAction, snapshot_access_file_path)
%}\n {% endif %}\n {% else %}\n {% if overwrite_similar %}\n {% set
platform_data = { \"tag\": \"%s\", \"channel\": \"%s\", \"group\": \"%s\", \"clickAction\":
\"%s\", \"image\": \"%s\"} | format(group_name, channel_name, group_name, clickAction,
snapshot_access_file_path) %}\n {% else %}\n {% set platform_data = {
\"channel\": \"%s\", \"clickAction\": \"%s\", \"image\": \"%s\"} | format(channel_name,
clickAction, snapshot_access_file_path) %}\n {% endif %}\n {% endif %}\n{%
endif %} {{ platform_data }}\n"
Duplicate this section entirely and rename !input notify_device to what you called your devices earlier.
In my case this section now looks like this:
action:
- delay: '{{ delay }}'
- service: camera.snapshot
entity_id: !input camera
data:
filename: '{{ snapshot_create_file_path }}'
- device_id: !input notify_device1
domain: mobile_app
type: notify
title: '{{ notification_title }}'
message: '{{ notification_message }}'
data: "{% if is_ios %}\n {% if is_critical %}\n {% set platform_data = { \"channel\":
\"%s\", \"url\": \"%s\", \"attachment\": {\"url\": \"%s\", \"content_type\": \"JPEG\"},
\ \"push\": { \"category\": \"%s\", \"sound\": { \"name\": \"default\", \"critical\":
1, \"volume\": 1.0 } } } | format(channel_name, clickAction, snapshot_access_file_path,
group_name) %}\n {% else %}\n {% if overwrite_similar %}\n {% set platform_data
= { \"channel\": \"%s\", \"url\": \"%s\", \"apns_headers\": { \"apns-collapse-id\":
\"%s\" }, \"attachment\": {\"url\": \"%s\", \"content_type\": \"JPEG\"}, \"push\":
{ \"category\": \"%s\", \"sound\": { \"name\": \"default\", \"volume\": 1.0 }
} } | format(channel_name, clickAction, group_name, snapshot_access_file_path,
group_name) %}\n {% else %}\n {% set platform_data = { \"channel\": \"%s\",
\"url\": \"%s\", \"attachment\": {\"url\": \"%s\", \"content_type\": \"JPEG\"},
\ \"push\": { \"category\": \"%s\", \"sound\": { \"name\": \"default\", \"volume\":
1.0 } } } | format(channel_name, clickAction, snapshot_access_file_path, group_name)
%}\n {% endif %}\n {% endif %}\n{% else %}\n {% if is_critical %}\n {%
if overwrite_similar %}\n {% set platform_data = { \"tag\": \"%s\", \"channel\":
\"%s\", \"group\": \"%s\", \"ttl\": 0, \"priority\": \"high\", \"clickAction\":
\"%s\", \"image\": \"%s\"} | format(group_name, channel_name, group_name, clickAction,
snapshot_access_file_path) %}\n {% else %}\n {% set platform_data = {
\"channel\": \"%s\", \"ttl\": 0, \"priority\": \"high\", \"clickAction\": \"%s\",
\"image\": \"%s\"} | format(channel_name, clickAction, snapshot_access_file_path)
%}\n {% endif %}\n {% else %}\n {% if overwrite_similar %}\n {% set
platform_data = { \"tag\": \"%s\", \"channel\": \"%s\", \"group\": \"%s\", \"clickAction\":
\"%s\", \"image\": \"%s\"} | format(group_name, channel_name, group_name, clickAction,
snapshot_access_file_path) %}\n {% else %}\n {% set platform_data = {
\"channel\": \"%s\", \"clickAction\": \"%s\", \"image\": \"%s\"} | format(channel_name,
clickAction, snapshot_access_file_path) %}\n {% endif %}\n {% endif %}\n{%
endif %} {{ platform_data }}\n"
- delay: '{{ delay }}'
- service: camera.snapshot
entity_id: !input camera
data:
filename: '{{ snapshot_create_file_path }}'
- device_id: !input notify_device2
domain: mobile_app
type: notify
title: '{{ notification_title }}'
message: '{{ notification_message }}'
data: "{% if is_ios %}\n {% if is_critical %}\n {% set platform_data = { \"channel\":
\"%s\", \"url\": \"%s\", \"attachment\": {\"url\": \"%s\", \"content_type\": \"JPEG\"},
\ \"push\": { \"category\": \"%s\", \"sound\": { \"name\": \"default\", \"critical\":
1, \"volume\": 1.0 } } } | format(channel_name, clickAction, snapshot_access_file_path,
group_name) %}\n {% else %}\n {% if overwrite_similar %}\n {% set platform_data
= { \"channel\": \"%s\", \"url\": \"%s\", \"apns_headers\": { \"apns-collapse-id\":
\"%s\" }, \"attachment\": {\"url\": \"%s\", \"content_type\": \"JPEG\"}, \"push\":
{ \"category\": \"%s\", \"sound\": { \"name\": \"default\", \"volume\": 1.0 }
} } | format(channel_name, clickAction, group_name, snapshot_access_file_path,
group_name) %}\n {% else %}\n {% set platform_data = { \"channel\": \"%s\",
\"url\": \"%s\", \"attachment\": {\"url\": \"%s\", \"content_type\": \"JPEG\"},
\ \"push\": { \"category\": \"%s\", \"sound\": { \"name\": \"default\", \"volume\":
1.0 } } } | format(channel_name, clickAction, snapshot_access_file_path, group_name)
%}\n {% endif %}\n {% endif %}\n{% else %}\n {% if is_critical %}\n {%
if overwrite_similar %}\n {% set platform_data = { \"tag\": \"%s\", \"channel\":
\"%s\", \"group\": \"%s\", \"ttl\": 0, \"priority\": \"high\", \"clickAction\":
\"%s\", \"image\": \"%s\"} | format(group_name, channel_name, group_name, clickAction,
snapshot_access_file_path) %}\n {% else %}\n {% set platform_data = {
\"channel\": \"%s\", \"ttl\": 0, \"priority\": \"high\", \"clickAction\": \"%s\",
\"image\": \"%s\"} | format(channel_name, clickAction, snapshot_access_file_path)
%}\n {% endif %}\n {% else %}\n {% if overwrite_similar %}\n {% set
platform_data = { \"tag\": \"%s\", \"channel\": \"%s\", \"group\": \"%s\", \"clickAction\":
\"%s\", \"image\": \"%s\"} | format(group_name, channel_name, group_name, clickAction,
snapshot_access_file_path) %}\n {% else %}\n {% set platform_data = {
\"channel\": \"%s\", \"clickAction\": \"%s\", \"image\": \"%s\"} | format(channel_name,
clickAction, snapshot_access_file_path) %}\n {% endif %}\n {% endif %}\n{%
endif %} {{ platform_data }}\n"
Restart Home Assistant and now when you use the blueprint, itāll give you two notification devices to select.
Please note
- You could probably duplicate the line again if you wanted to add another device to notify, but I have not tested that
- Your existing automations that use the old version of the blueprint will not show up anymore if you make changes to the original blueprint. To update those, go to your automations.yaml file and duplicate and update your ānotify_deviceā names to those used in your blueprint.
- Iām not sure if this causes any issues with the iOS specific toggle under āoverwrite similarā in the blueprint. I would imagine it does.
- Iām not adding the file as itās pretty simple stuff and as mentioned before, Iām an idiot. So please try this at your own risk.
- I found that you can duplicate the blueprint and rename it for example to ācameranotifies1ā and ācameranotifies2ā you can keep both.
Hope this helps at all!