2019-03-30 01:47:49 DEBUG (SyncWorker_5) [custom_components.alexa_media.notify] Announce targets: [] entities: ['media_player.livingroom', 'media_player.livingroom']
2019-03-30 01:48:29 DEBUG (Thread-4) [alexapy.alexawebsocket] Got Pong MSG from Server
2019-03-30 01:48:31 DEBUG (SyncWorker_14) [custom_components.alexa_media] *@gmail.com: Found 11 devices, 1 bluetooth
2019-03-30 01:48:31 DEBUG (SyncWorker_14) [custom_components.alexa_media] *@gmail.com: Existing: [<Entity Michael's Fire TV stick: standby>, <Entity My Dash: standby>, <Entity Livingroom: standby>, <Entity Downstairs kindle: standby>, <Entity x 4th Fire: standby>, <Entity Bedroom: standby>, <Entity Everywhere: standby>, <Entity x lenovo tablet: standby>, <Entity Ellas travel: standby>, <Entity This Device: standby>, <Entity x Alexa Apps: standby>] New: []; Filtered by: include_devices: [] exclude_devices:[]
2019-03-30 01:48:31 DEBUG (SyncWorker_14) [custom_components.alexa_media] *@gmail.com: Updated last_called: {'serialNumber': '9************9KA', 'timestamp': 1553909910437}
anyone know how I would write a scipt to play a siriusxm channel?
I’ve tried…
'1553974515375':
alias: The Highway SiriusXM
sequence:
- service: media_player.play_media
data:
entity_id: media_player.alexander_s_echo_dot
media_content_id: “The Highway”
media_content_type: “SiriusXM”
You queued it up properly, but now ya gotta start playing it. Yes, this one caught me off guard also but the following seems to work:
play_jazz:
alias: Play Jazz
sequence:
- data:
entity_id: media_player.406_living_room_echo_dot
media_content_id: “ABC Jazz (Australia)”
media_content_type: “TuneIn”
service: media_player.play_media
- service: media_player.media_play
you both need to check you quotation marks. they look like the “fancy” ones not the regular text based ones.
Okay, a little more testing got me consistent results using the following two scripts to validate:
play_jazz:
alias: Play Jazz
sequence:
- data:
entity_id: media_player.406_living_room_echo_dot
media_content_id: 'ABC Jazz (Australia)'
media_content_type: 'TUNEIN'
service: media_player.play_media
play_french_jazz:
alias: Play French Jazz
sequence:
- data:
entity_id: media_player.406_living_room_echo_dot
media_content_id: 'CAFÉ I Soulside Radio Paris (France)'
media_content_type: 'TUNEIN'
service: media_player.play_media
Note the use of the recommended single quotes which cleared up a couple of things, the ALL CAPS for the content type and thus eliminating the media_player.media_play service call.
All is right in the world here.
and now that this is working (at least for TuneIn)… I notice that the HA attribute for the media_player device is not updating and the clipart is random or non-existent or flashing.
but both of those tests have really good music
Ive checked multiple times, and verified, there are only two places that this would pop up, configuration.yaml and secrets.yaml
if secrets is uncommented, and configuration.yaml is set with the config on my last post, it hangs… if i delete or comment everything out, it works just fine
just tried setting it again, once with no secret anything, and once with secret info in secrets.yaml, and nothing happens at all, just hangs until i change the code
so there is more to this than just a config issue… its definetly not me having a noob duplecafe
OH MY GOD!!!
you have no idea how many hours i have been looking into this tonight…
my alexa’s when from
media_player.christophers_echo_dot
to
media_player.christopher_s_echo_dot
AND NOW IT WORKS!
Thanks so much for that hot tip.
I must say thought, someone REALLY BADLY needs to update the descriptions on this custom component. there are WAY to many conflicting suggestions in these comments
Thank you very much for making this possible. I have been using the custom component for over 6 months and it’s just been getting significantly better and better; to the point that in my limited “user” knowledge I think it’s perfect!
Remove the quotes from your config. Try the Hass check scripts command to review yaml errors before restarting.
@Dixey thanks for your help with this! I have the same issue, the device is showing paused when its actually playing and the clipart is hit or miss…but the most importantly the music is working!
Hey all, I am making this post to try to clarify the current way to set up alexa tts. A few things have changed with the recent updates and it took me hours to find the solution.
I can use the old media_player.alexa_tts
method as well as the new notify.alexa_media
features of tts, announce, and push. All methods perform as expected with my current configuration as of 3/31/19.
By the way, the real turning point in my troubleshooting came when I realized that the entity ids of my echos had changed. For instance, one of them went from media_player.christophers_echo
to media_player.christopher_s_echo
I have no idea why the random _ got added in but all I had to do was run through my automations and add the little _ and they started working again. If you have been trying at this for a while and you just cant get it, I would start here.
First off, you need to fix the custom component files structure and add the new component files. The folder structure changed with the 0.90 update.
The folder path is
~config>custom_components>alexa_media.
Inside the alexa_media folder you should have these files
init.py
const.py
media_player.py
notify.py
This link is were to grab the current custom_component .py files.
https://github.com/keatontaylor/alexa_media_player/tree/master/alexa_media
Note: Home Assistant will create a _pycache_
folder inside the alexa_media folder automatically when it loads the component so if you see that in there thats fine, its supposed to be there
Next, with this change your configuration for alexa_tts should not under the media_player component. Delete or ‘#’ comment out what you had and enter this as a new component into your configuration.yaml:
alexa_media:
accounts:
- email: !secret amazon_login
password: !secret amazon_password
url: "amazon.com"
also add this to your notify component in you configuration.yaml for the notify.alexa_media function
notify:
- platform: alexa_media
name: alexa_media
and this is how to add any of that to an automation
- alias: 'Notifications Test'
initial_state: true
hide_entity: false
trigger:
- platform: state
entity_id: light.hallway_light
from: 'off'
to: 'on'
action:
- service: media_player.alexa_tts
data:
entity_id: media_player.christopher_s_echo_dot
message: "Hello World"
- service: notify.alexa_media
data:
target:
- media_player.christopher_s_echo_dot
data:
type: tts
message: "Hello World"
- service: notify.alexa_media
data:
target:
- media_player.christopher_s_echo
data:
type: announce
#method: all
message: "Hello World"
- service: notify.alexa_media
data:
target:
- media_player.christopher_s_echo_dot
data:
type: push
title: "I just wanted to say"
message: "Hello World"
I am not sure what the method: all
feature does but it apparently does not make it announce to all of your alexas. I will need to do more research on that.
I’m sure there are a few features for this I have not learned about yet but I wanted to do a quick write-up on the process that worked for me because I had to pull information from all over the place to get this working again.
Also, while I’m at it, thanks so much to Keaton for all your hard work on this! I really appreciate your costume component sir.
Bonus tip!
If you want to add words that alexa doesn’t like to say, replace a vowel with a special character like ä ë ï ö ü
shë wïll see the wörds and not recögnize them as bäd words but will still say them without bleeping them and still pronounce them properly. Have fun with that one kids.
Hey all. Ive been using this component for some months now and I m very happy with it. Since a few days I’ve been seeing a lot of switching between standby and pause of my media_player.alexa. This is flooding my logbook. Do others also see this behavior?
can you please explain a bit more how you got this to work? i copied and pasted this as a script but changed the entity_id to my own… how do i trigger it in an automation? and does it work if i swap the content type to ‘SPOTIFY’ and the content id to ‘pop lullabies’?? this is what my kids fall asleep to every night and it would be nice to have HA trigger it when i turn on their night light
Create a file like this in your automations folder named good_night_kids.yaml
(or add this text to your automations file and name it good_night_kids:
- alias: 'Good Night kids'
initial_state: true
trigger:
- at: '20:00:00'
platform: time
condition: []
action:
- service: media_player.volume_set
data:
entity_id: media_player.bedroom_echo_dot
volume_level: 0.6
- delay: '00:00:05'
- service: media_player.play_media
data:
entity_id: media_player.bedroom_echo_dot
media_content_id: 'Kinderling Kids Radio'
media_content_type: 'TUNEIN'
I can’t help ya with the Spotify thing, I don’t have an account to test that.
I have, ive removed all the quotes, and have not had any luck, tried adding them in on the url, again, no luck…
What Hass check scripts?
Try putting the quotes back in but this time use the single quote mark
'
In the configuration menu, clicking General and then Check Config, will also check the syntax of your scripts and automations
I tried that and it just sits there and spins, doesnt give me any errors either way
I’ve been trying to get this to work on a sonos beam, but it never speaks - although I have it working on “true” amazon devices no problem.
Is it not compatible with alexa through sonos…or am I missing something?
Here is the script I use:
- service: notify.alexa_media
data:
target: media_player.den_3
data:
type: tts
message: "This is a test message"
I have google set as my tts:
tts:
- platform: google
base_url: http://192.168.10.5:8123
I’ve also tried to use the sonos tts, but again nothing is spoken but not sure if thats an issue as I use traefik…
Any help much appreciated.
Testet it for you and this works:
- alias: 'Good Night kids'
initial_state: true
trigger:
- at: '20:00:00'
platform: time
condition: []
action:
- service: media_player.volume_set
data:
entity_id: media_player.bedroom_echo_dot
volume_level: 0.6
- delay: '00:00:05'
- service: media_player.play_media
data:
entity_id: media_player.bedroom_echo_dot
media_content_id: 'modern lullabies'
media_content_type: 'SPOTIFY'