Hey All.
I’m a software engineer, so I want to DRY my code. One aspect that I would really like to centralize is sending notifications to a specific set of devices. For this reason, I would like to create a script which can be used to send notifications to specific devices, but the title, message, actions, etc should all be dictated by the automation or other trigger.
It is trivial to pass title and message to the script (doc for reference); however according to the section on passing parameters, it seems like only strings are supported. This means that I cannot pass dynamic actions which is a big feature of the notifications I would like to send to mobile devices specifically.
Here is my script so far:
alias: Notify Monitors - Basic
sequence:
- service: notify.mobile_app_bryans_iphone
data:
title: '{{ title }}'
message: '{{ message }}'
description: Notify all of devices
fields:
title:
description: The Title of the notification
example: Example text
message:
description: The content
example: Example text
required: true
mode: single
icon: mdi:message-badge
Even if I add the actions
parameter to the script and attempt to pass it to the notify....
service under data
(like normal), it fails. It seems like the parameter is probably being stringified which is probably not supported by the notifier.
Am I missing anything, or is this just a limitation of the system at this time?