Skip to content

Instantly share code, notes, and snippets.

@MarkWattTech
Created April 22, 2021 17:11
Show Gist options
  • Save MarkWattTech/df717195583ecb8a0b1cd6b1ffb78138 to your computer and use it in GitHub Desktop.
Save MarkWattTech/df717195583ecb8a0b1cd6b1ffb78138 to your computer and use it in GitHub Desktop.
Supporting content for the Alexa Custom MP3s video
#Dev Tool
service: notify.alexa_media
data:
message: "<audio src='https://yourPublicURL.ui.nabu.casa/local/mp3/potato.mp3'/>"
target: media_player.downstairs_echo
data:
type: tts
# Script for a random phrase
service: notify.alexa_media
data_template:
message: >
'"{{ ("<audio
src='https://yourPublicURL.ui.nabu.casa/local/mp3/potato.mp3/>",
"<audio src='https://yourPublicURL.ui.nabu.casa/local/mp3/potato.mp3'/>",
"<audio src='https://yourPublicURL.ui.nabu.casa/local/mp3/potato.mp3'/>"
)|random }}"'
data:
type: tts
target: media_player.downstairs_echo
@d0motik3lli
Copy link

No, I've just start using nabu casa but it doesn't work as well. Always the same error message from alexa

@rjnca
Copy link

rjnca commented Aug 7, 2022

Looks like this doesn't work unless you're using Nabu Casa. With Duck DNS, it gives you a message about not being able to connect to the Simon Says skill

I moved my setup from Duck DNS to Cloudflare and got it working. There are a bunch of videos on setting up the Cloudflare addon and that part is pretty easy. First you need to disable Duck DNS and restart though.. And that's where it gets a little tricky. When you disable Duck DNS and remove the SSL certificate lines in your configuration.yaml, you'll need to start accessing your home assistant through the local IP until you get Cloudflare up and running.. and your browser will start complaining about not being a secure connection.
Once you're up and running on Cloudflare though, you should be able to start playing local sound files as long as the Message line is properly formatted.. If it's not formatted correctly, you'll still get the "Simon Says" error

@sudoxnym
Copy link

sudoxnym commented Aug 9, 2022

I am using Nabu Casa and I am getting the Simon Says error. I copy pasted the code into the dev console.

@evilbobbins
Copy link

I am using Nabu Casa and I am getting the Simon Says error. I copy pasted the code into the dev console.

Try running the file through the converter that seems to fix the error

@josedefreitasc
Copy link

Hi,
I been trying to make it work but still not working, I am using just for testing, the url of a recent converted sound in jovo. If I try with the soundbank of Alexa works fine! but not with a custom sound, I get the Simon says error. Could be something that should be configure in my skill to make it work properly?

@josedefreitasc
Copy link

It's appears like amazon doesn't like https urls with Let'sEncrypt certificates, that's why it works with CloudFlare HA config and it's not working with Jovo direct url (use Let'sEncrypt)! . I hope this comment could help anyone with the Simon says error.

@jusplainmike
Copy link

It's appears like amazon doesn't like https urls with Let'sEncrypt certificates, that's why it works with CloudFlare HA config and it's not working with Jovo direct url (use Let'sEncrypt)! . I hope this comment could help anyone with the Simon says error.

Thank you I was trying everything.

@donparlor
Copy link

donparlor commented May 16, 2023

I am using duckdns and the only option that worked for me was using AWS S3 account storage. Alexa is over-protected regarding access to files so they will only allow accessing files on their own servers. Prove me wrong as I would be more than happy to store files locally on my Home Assistant local www/media/audio folder.

Here are some details:

  1. Make sure your mp3 file is the correct bitrate / length
  2. Amazon S3 account (for your region)
  3. Set S3 permissions, public access and bucket policy
  4. Use you S3 link: example: <audio src="https://MyFileCompartmentName.s3.us-west-1.amazonaws.com/zelda.mp3'/>"

@dmayo305
Copy link

Anybody have success sending to a group of echoes rather than a single echo?

@BeyondCurious
Copy link

BeyondCurious commented Oct 7, 2023

@dmayo305, Just use a dash with each echo in your YAML:

service: notify.alexa_media
data:
  message: >-
    <audio
    src='https://myPublicURL.ui.nabu.casa/local/mp3/doorbell-chime.mp3'/>
  target:
    - media_player.colton_s_echo_show
    - media_player.apartment_door_echo_amz
    - media_player.bedroom_echo_right_amz
    - media_player.kitchen_echo_plus_amz
    - media_player.bathroom_echo_amz
    - media_player.bedroom_echo_right_amz
  data:
    type: tts
enabled: true

@rhmunich
Copy link

I had the same problem with "Simon says ...". Finally, I could fix it by correcting the source-statement of the mp3-file.
It seems that the source needs to be like this (watch the different quotation marks):

src='https://abcdef.ui.nabu.casa/local/mp3/Alarm.mp3'/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment