I’ve currently got a pile of action: notify.notify actions triggered from various things like automations, with the notifications going to the HA app on my phone. I’d also like to send them to an external alphanumeric display device, action: device.message but the obvious way to do it, notify groups, isn’t working as expected:
Invalid config for 'group' from integration 'notify' at packages/notify.yaml, line 10: invalid slug device.message (try device_message) for dictionary value 'services->1->action', got 'device.message'
Doesn’t look like any kind of gastropod to me… presumably I need to just use message but then how do I specify which entity to invoke the message action for?
I got that from the error message, but since I have no idea why it’s talking about gastropods or what I’m supposed to do with that error message I also have no idea how to fix it.
What do you mean? It tells you exactly what you need. It needs to be the slug for the notification action you intend to use. Notification actions exist in your actions list, you can see them in settings → developer tools → actions tab
I mean, being a bit more blunt, that that error message is meaningless gibberish to anyone who doesn’t know HA inside out. What is a “slug for a notification action”?
I’d already read the notification groups page before I posted the question. It says “if you’re using notify.x then remove the notify part”. It doesn’t tell me anything about how to forward a notification message to something that has a device.message action that’s used to display messages, which is what I was asking about.
Because device.message is not something that HA does. Can you provide a link to what this means? Or provide an example of the notification you’d normally send from an automation.
What I’m trying to do via the notification group is to send one copy of the notification through the standard channels (i.e. to the HA app on my phone) and a second copy to the display device.
The reason why I don’t add a second action to the automation alongside notify.notify is that there are a lot of automations, as well as notifications coming from other parts of HA that I’d also like to get sent to the external display.
device is not a normal home assistant platform. Is this some custom integration? What integration is creating that action? Google is not showing any custom integrations (or non custom) that provide that. Googling that device.message home assistant only returns this thread and a bunch of unrelated threads on the forums. Where are you getting device.message from?
The term “slug” is not specific to HA, it is broadly used and easily searchable.
The part that is specific to Notify groups is that you only use the name portion of the action ID, excluding the domain portion. Which is described in the docs, as can be seen in the screenshot Petro posted above.
In addition to Petro’s comments about the device.message action, I would recommend you stop using the generic notify.notify action. It is not a reliable method when you have more than one notify action. It is always best practice to use a specific notify action or the notify.send_message action with a specific target. The new docs for the action cover this in the “Good to Know” section, previous versions of the docs had the same information in a warning box.
It’s a custom integration, in this case for a Vestaboard display, so device = vestaboard. ATM I’m triggering the action manually to send test messages via Developer Tools > Actions > Send message, which uses the action vestaboard.message. What I’m having trouble with is connecting the messages from notify.notify to vestaboard.message to be displayed.
Only actions in the notify domain can be grouped with the legacy Notify groups. Basically, the only practical option is to use a script that performs the desired notify action as well as the vestaboard action. Then you call the script as an action instead and pass the message and other data as variables:
So I’d read (several times) the docs on notifications which which say that notify.notify sends a notification message while notify.send_message on the other hand sends a notification message (OK, one is to ‘targets’ and one is to ‘entities’, but that seems to be the same thing in that an entity is a target). So you’re saying I need to change all occurrences of notify.notify in all automations to notify.send_message?
No, you’d need to create a script. In that script you’d use notify.notify, notify.send_message (if you need it for some other service), and vestaboard.message.
So that we don’t get the two related topics confused…
For the cases where you want to get notifications on your phone you should use either notify.send_message or the specific service/action for your phone; which will be something along the lines of notify.mobile_app_YOUR_PHONE if you are using the HA companion app.
For the cases where you want to send the message to your phone and the Vestboard, you should call the script… which will have one of the actions above and the vestaboard.message action.
Corrected Script Config
script:
notify:
description: "Send a notification"
fields:
title:
description: "The notification title"
message:
description: "The notification message"
sequence:
- action: notify.send_message
target:
entity_id: notify.YOUR_PHONE
data:
title: "{{ title }}"
message: "{{ message }}"
- action: vestaboard.message
data:
device_id: abcd1234
title: "{{ title }}"
message: "{{ message }}"
Cool, so that sounds like the example I posted. It’ll take awhile to track down all the notifications in automations so I’ll report back a bit later, and probably need to tweak the YAML as well.
That YAML isn’t correct but because of the target indentation, but to keep your current functionality without swapping over to notification entities and keeping notification services, your script would look like this:
script:
notify:
description: "Send a notification"
fields:
title:
description: "The notification title"
message:
description: "The notification message"
sequence:
- action: notify.notify
data:
title: "{{ title }}"
message: "{{ message }}"
- action: vestaboard.message
data:
device_id: abcd1234
title: "{{ title }}"
message: "{{ message }}"