This blueprint is one that I made to slightly simplify the process of sending notifications to Alexa devices while using Alexa Media Player, in a way inspired by Grumblezz’s Notify Mobile Companion Devices script. While the notify service provided by AMP isn’t super complex, I wasn’t aware of some of its functionality (namely the Announce notification type) and wanted a GUI-driven way to quickly set those parameters.
Getting started
First, you need to install Alexa Media Player and make sure it’s working.
Once you’ve done that, click the below button to add the blueprint to your install, then create a script from it. Make sure to give it a memorable name!
tts - Alexa will read out the message immediately without any beep beforehand. Does not work on mobile devices in my testing (this is an AMP limitation).
announce - Alexa will read out the message following a beep. This will also show the message on devices with a screen, such as Echo Shows or Spots. This does not work on mobile devices in my testing (this is an AMP limitation).
push - This will send a mobile push notification to the Alexa app. Only works on mobile devices.
title (optional) - The title to display. Only works with announce and push notifications.
devices (optional) - The device(s) to direct the notifications to. These take device IDs, and translates them to entity IDs. If this is not supplied, all Alexa devices will be notified.
Despite what the UI says, there is no response variable support.
Hopefully some of you find this useful! It’s my first blueprint, but I think it has value.
UPDATES
2024.03.7
Fixed a small issue where it would try to include a title when none is supplied, leading to spurious log file messages. Thanks @masterpete!
2024.03.29
Added a description for when you’re first creating a script using this blueprint. Thanks @Tockra and nothra on Github!
Just did some testing and it seems like that message gets logged when you don’t have a title set. That’s definitely a bug, not sure why that’s happening…
Just fixed the issue and pushed an update to it! As I don’t think blueprints have any sort of automatic update capability, you’ll need to go to Settings → Automations & Scenes → Blueprints and re-import the blueprint like so:
I don’t think restarting HA from here is a necessary step, but it couldn’t hurt.
After I successfully did my alexa media player integration I installed your blueprint and wanted to test it.
The blueprint for Alexa notify has no input:
There are no configurable inputs during that initial setup; all of the configuration comes when you’re actually using the created script in automations. Once created, the options described in the OP should all show up as expected.
Apologies for not making that clearer; I’d meant to add some text to that screen to explain it but forgot. Whoops…
As an update, I just updated the script with a little introduction! It should be a bit clearer that you need to make the script first before you have access to the configuration options. Thanks again for the suggestion!
Just found your blueprint and testing it right now, am i right when i say the it send a mobile push but (even if the alexa app is open) it does not read the message?
Is this blueprint still the way to go If I want notifications through my alexa speakers?
At least this is one prominent search result of my google search.
I’d say yes, though I am a bit biased on this front Ultimately this is just a wrapper around Alexa Media Player so strictly speaking this isn’t needed, but it’s nice to have.
The major uncertainty with this as of late, I’d say, is the weird spot that Alexa Media Player itself is in. AMP apparently isn’t actively maintained anymore outside of community contributed patches, which was demonstrated by the v4.12.13 memory leak and how long it took for an update to drop that fixed it once the cause was isolated. There was a discussion about bringing AMP out of HACS into HA Core on the HA Discord, but I don’t know if or when that’s going to happen.
However when using your script to select them I never receive any of the notifications. The syntax or the action doesn’t seems to execute properly.
ie: this is the config of the automation when I create each notification manually:
alias: Notification
description: ""
triggers:
- trigger: state
entity_id:
- binary_sensor.dome_leak_sensor_water_leak_detected
conditions: []
actions:
- action: notify.mobile_app_patricks_iphone
metadata: {}
data:
message: "A water leak has been detected in the bathroom downstairs. "
title: Warning!
- action: notify.alexa_media_home_echo_bathroom
metadata: {}
data:
message: "A water leak has been detected in the bathroom downstairs. "
title: Warning!
- action: notify.alexa_media_home_echo_kitchen_hub
metadata: {}
data:
message: "A water leak has been detected in the bathroom downstairs. "
title: Warning!
- action: notify.alexa_media_home_echo_living_room_bar
metadata: {}
data:
message: "A water leak has been detected in the bathroom downstairs. "
title: Warning!
- action: notify.alexa_media_home_echo_entrance
metadata: {}
data:
message: "A water leak has been detected in the bathroom downstairs. "
title: Warning!
- action: notify.alexa_media_garage_echo_office
metadata: {}
data:
message: "A water leak has been detected in the bathroom downstairs. "
title: Warning!
- action: notify.alexa_media_garage_echo_arcade
metadata: {}
data:
message: "A water leak has been detected in the bathroom downstairs. "
title: Warning!
- action: notify.alexa_media_home_echo_guest_room_downstairs
metadata: {}
data:
message: "A water leak has been detected in the bathroom downstairs. "
title: Warning!
- action: notify.alexa_media_home_echo_guest_room_upstairs
metadata: {}
data:
message: "A water leak has been detected in the bathroom downstairs. "
title: Warning!
- action: notify.alexa_media_home_echo_master_bathroom
metadata: {}
data:
title: Warning!
message: "A water leak has been detected in the bathroom downstairs. "
- action: notify.alexa_media_home_echo_laundry_room
metadata: {}
data:
message: "A water leak has been detected in the bathroom downstairs. "
title: Warning!
- action: notify.alexa_media_home_echo_master_bedroom
metadata: {}
data:
message: "A water leak has been detected in the bathroom downstairs. "
title: Warning!
type: push
mode: single
Apologies for the delay (I evidently need to update my HA forum notification settings). I’m testing it out on my end right now and it seems to still be working just fine, so I’m confused what the issue might be…
Can you try running the script via the Actions tab in the Developer Tools, and see if anything happens there? If it doesn’t work there, shoot me the YAML and I’ll see if I can replicate the issue.
Hmm, seems it’s working on my end so long as the notification type is set to “Mobile Push.” Doesn’t appear to work if the type is set to TTS or Announce.
See if your install of AMP can send messages to the mobile app in general. Go to the Developer Tools → Actions, hit Enter YAML Mode, and paste in the following action:
action: notify.alexa_media
data:
title: Message from Alexa Media Player
message: Your installation of Alexa Media Player should be configured correctly.
data:
type: push
target:
- media_player.<REPLACE_WITH_YOUR_ALEXA_APP_MEDIA_PLAYER_ENTITY>
You can find your phone’s entity name by going to Devices and Services → Alexa Media Player → Devices and searching for the one whose model is listed as Alexa Mobile Voice iOS/Android, then clicking on the media player entity in the Controls section and getting its entity name. Once you’ve substituted that in the service call above, it should pop a notification up on your phone. If it does, then the issue lies somewhere in my code. If not, you’ve got an issue in your install of AMP that needs to be addressed first.
Notification doesn’t work with my correct set entity name. So the issue lies within the installation. But I don’t know where to start as everything else is working.