Have Alexa play a sound when I enter my property

alexa
Tags: #<Tag:0x00007f1baa970d20>

#21

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.


#22

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.


#23

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


#24

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.


#25

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

:smile:


#26

Hi,

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


#27

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


#28

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”?


#29

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


#30

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


#31

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.


#32

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).


#33

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?