I am trying to play a “chime” tone on my Echo speakers when a Unifi G4 doorbell is pressed. Following other threads (mainly aimed at Sonos speakers) I have managed to get the following yaml automation code, but it returns a Message malformed: Unable to determine action @ data[‘actions’][0] error when I try to save it.
The url for the chime is where I have placed the mp3 file using HA’s File Editor ( /www/chime.mp3 ), and if I put that url in to my browser the chime does play.
Any ideas as to where I am going wrong? What I want to happen is for what ever the speaker(s) are playing to (ideally) mute, play the chime, wait 4 seconds, then resume whatever they were playing.
TIA
alias: Doorbell to Echo Speakers
description: ""
triggers:
- trigger: state
entity_id: binary_sensor.u00_doorbell_doorbell
to: "on"
conditions: []
actions:
- target:
entity_id:
- media_player.office_echo
- media_player.workshop_echo
data:
media_content_type: music
media_content_id: http://192.168.5.56:8123/local/chime.mp3
action: media_player.play_media
- delay:
hours: 0
minutes: 0
seconds: 4
milliseconds: 0
mode: single
@Holdestmade, that’s just going to get OP an error message about how “Direct music streaming isn’t supported…”
You can’t treat Amazon’s smart speakers like they are normal media players. They do not allow local streaming, so your file path needs to be through an externally available address. Also, be aware that Amazon has specific formatting and length limits that must be followed.
My media files are stored like this…
For me in configuration.yaml
homeassistant:
media_dirs:
local: /media
Then the /media path becomes part of /local .
And put the mp3 in a folder in HA under
/media/mp3
(The media folder already exists, you would want to add a sub folder to that, or at least I did, to keep your OCD happy.)
When I want to use an MP3, the path is
The issues in the thread you opened are answered in my post above. You must use Alexa’s Notify platform, and .wav files are not acceptable under Alexa’s requirements.