Hey, just looking to get this setup and very excited about it! When I’ve added alexa.py to the custom_components/media_player folder the config validator in Hassio just hangs and hangs on the loading screen… When I remove the alexa.py file the config validator runs and says all is okay… Any one else experienced this?
Did you download the raw version? If not, you need to.
What do you mean by raw version? I used the link in the top post of this thread…
When you go that link, you will see a RAW button to the right.
Are there any examples of how to use the “last_called” option? I’m assuming you’d use this to have a media_player.alexa_tts send a message to the last used alexa?
I’ve tried the last_called - it’s not perfect but does kind of work.
Each media player has the last_called attribute - the one that was last called will be set to true with the others set to false.
I’ve got a routine that responds with a TTS (via nodered), and I’ve updated this to use last location, and this attribute doesn’t appear to be updated through the routine - I’ve then tried adding some additional stuff to the routine, which seemed to help, but it’s still a bit unpredictable.
It might be to do with update timings/etc.
My best success has been to say
- “Alexa, hello”
- “Routine prompt”
but even then - the last_called isn’t always up to date.
Possibly to do with timings of when the mediaplayer is updated, so I don’t blame this component
I need to somehow force the media players to update, or wait I think…
Replying to myself somewhat - a 5 second delay before a TTS response seems enough to allow the last_called to be updated.
So my process is
- Alexa routine
- First thing in routine is a “let me check… just a second… or similar” response from Alexa
- Call the smart switch I’m interested in (which isn’t really a switch )
- This does what it needs to in order to collect the info
- Delay for 5 seconds - then get the last_called.
- Initiate the TTS response back based on the last called
This seems to work repeatedly, though I’ve only done a small amount of testing.
Thanks all for putting this change in
depends.
if the mediaplayer is updated every 5 seconds then thats enough.
but with 13 dots i dont think my network will be fast enough to scan them all every 5 seconds
Hi, I tried to use this example, but my Alexa keeps reading the name of the sensor as opposed to the value
Any ideas? My automation:
- id: '1548858157210'
alias: Ask Alexa House Temperature
trigger:
- entity_id: input_boolean.house_temp
platform: state
to: 'on'
condition: []
action:
- data:
entity_id: input_boolean.house_temp
service: input_boolean.turn_off
- data:
entity_id: media_player.joaos_echo_dot
message: -> 'The Current Temperature in the Living room is {{states.sensor.netatmo_the_inside_temperature}}''
service: media_player.alexa_tts
Here’s me with a mere 4 !
I do need to look at alternatives as it’s definitely not scalable… was more trying to prove it worked first!
Great idea. Hope you can fix custom tts playing on Alexa.
i think the mediaplayer component is great and it makes things easy for a lot of users, but i dont use media player components in general.
you always need a lot of network traffic for it.
for me its useless to be able to see what is playing on an alexa through HA, i can see that in the app if i like (and even that i dont use)
i want to send commands to the alexa devices, start playing music, stop it, use TTS, etc.
i dont need a mediaplayer for that.
but in general i have seen in HA that a great deal of people like mediaplayers, so its certainly good that they are there.
Change ‘data:’ to ‘data_template:’ and your automation will work.
What’s the purpose to putting the “->” in front of the message?
Oh, that makes sense. I’ll give it a try when I’m back home. It would be handy to have a way of not having to say “Alexa, Turn On, Whats the house temperature” but guess thats for a next time?
Thanks for the help. I’ll give it a test later today.
create a routine where you say “Alexa, Whats the house temperature” and let it turn on the switch.