Have Alexa play a sound when I enter my property

try removing your ip.

- alias: "test audio"
  hide_entity: false
  initial_state: 'on'
  trigger:
    - platform: state
      entity_id: alarm_control_panel.house
      to: 'triggered'
  action:
    - service: media_player.play_media
      data_template:
        entity_id:
          - media_player.it_room
        media_content_id: "/local/Real_Police_Siren.mp3"
        media_content_type: music

if that doesn’t work, try using the actual location of the mp3 on the device.

I’ve already used the full path, with no luck. I’ll try removing my IP. Will check in when i’ve tested it. Thanks for you time.

edit: @petro So it does do more then it ever did using /local/… but it now complains about TTS, it can only be called with media_player.alexa_tts, but thats not really what i’m trying to do, right?
I’ve tried it also on my sonos but it doesn’t work and the logs dont show anything.

I’m not sure to be honest. Never used Alexa yo play local media.

No problem mate, thanks for helping so far. I now, have setup MyMedia Skill to play local media on my Hass server. Then I setup a routine (added a binary sensor for my alarm on/off) to play a police sound on my alexa’s, as a temp workaround.

1 Like

Yeah, that’s because you can’t…:wink:

:smile:

Hi,

You said that using MyMediaSkill you can play a mp3 from your media server? May you share how to do that?

Sure,

Install MyMedia skill from within the Alexa App
Go to https://www.mymediaalexa.com/ then download the package for your distro (i’ve used it on one of my Ubuntu servers)
Install it and then go to http://IPADDRESSOFTHEMACHINE:52051
There just follow the instructions

Now you can use routines to setup automations with devices and audio files

I bought the 1 year plan for 5 dollar, there’s a 7 day free trial. (not sure if you can just use it or have some features disabled)
You should use the same email for MyMedia as you have used for Alexa

1 Like

Blockquote
Now you can use routines to setup automations with devices and audio files

That’s the part that I missed. You use the media_player.play_media service right? What about the “media_content_id”?

Hang on, MyMedia Skill is purely on Alexa and has nothing to do with Home assistant. So still playing audio files via HASS is not supported by Alexa as of this moment.

MyMedia is just a server that serves files to alexa and has no intergration to HASS

I see… so you are talking about Alexa routines, right? The ones you made using the alexa app? And how do you trigger them?

Yes indeed. As of the last update you can view your HASS sensors (door/motion etc) as smart home devices in the alexa app.

You can also create an automation to turn an empty sensor on or off based on your other switches input (or anything else for that matter)

Let me know what you are trying to accomplish, ill give a hand.

Hi,

Ty. I’ll explore a little the routines and what I can do with that, but I think I will start with something like you did: play a sound when I open the front door (I already have a front door sensor).

No problem, let me know if you need help.

I also have setup some alarm TTS (but i’d like a nuclear or air raid alarm to sound ^^) automations like:

Alarm pending: you have xx seconds to leave the residence
Alarm tripped: Please input the disarm code within 30 seconds or the alarm will go off

based on sensors

So you could also let Alexa welcome you home, like:

Hello name,(device tracker based) welcome home. Can i do anything for you?

Is it possible to have a door trigger or similar to play a particular sound from Spotify, on all Alexa devices ( I have 5 around the house ) ??

I’ve found an angry dog sound track on Spotify which would be perfect to scare off any intruders :laughing:

Any progress been made on this one?

Have you installed the alexa media player from HACS?

I use TTS on this to announce when one of our cars arrive home, i am sure however that you can play spotify sounds… https://github.com/custom-components/alexa_media_player/wiki

I use the alexa-remote2 palette in Node Red to play a doorbell chime on all Echo devices when a motion sensor is triggered. It’s the “Alexa Routine” node:
Screen Shot 2020-11-28 at 5.54.49 PM

Hi inkylatte have you further info on this setup.
I use an esp-01 to trigger my doorbell but cannot get any sound from anything

cheers

@Alarm_guy1, I have more info on the Node Red setup here:
https://donnlee.com/2020/11/02/basic-alexa-speak-with-node-red-palette-node-red-contrib-alexa-remote2/

at the bottom of that page, there’s a link to a detailed howto youtube video

Many thanks i wil take a look