I am using Plex Home (with multiple users) and I have few music playlists. However, I don’t know how to use HA to play a playlist from my Plex account. I have tried using Developer Tools > Services and then select…
Domain: media_player
Service: play_media
Service Data: {“entity_id”:“media_player.plex_web_firefox”, “media_content_id”:“360771”, “media_content_type”:“PLAYLIST”}
When I call the service, nothing happened. I suspect media_content_id value I used is wrong. May I know how to fix this? Thanks.
[redacted] I totally misunderstood your question! Instead, try using the full URI for the playlist in the content_id field.
I can’t seem to get the service to work, even when specifying these details. I can only get it to work when casting directly from Spotify to media_player.bedroom. But the full track URI is specified in media_content_id. Granted, this is an individual track, not a playlist. This is a bit frustrating.
The same happens when you try playing a live stream. For example, I can play a TuneIn Radio station on my GoogleHome, and do not get a media_content_type. Or I can play a playlist from Spotify and the media_content_id is the individual track itself.
It seems there is a fair amount of inconsistency with media_player as a service, still.
I am trying to play a movie through a script on the chromecast in my livingroom (woonkamer in Dutch)
plexplay:
alias: plex play test
sequence:
- service: media_player.play_media
data:
entity_id: media_player.woonkamer
media_content_id: "/library/metadata/12323"
media_content_type: video
For media_content_type I tried video and movie.
Where “video” is given in the example on the component page.
and movie was indicated at the state overview at media_player.woonkamer.
Hey guys,
I’m still searching for a better way to cast Plex music playlist to chromecast audio but in the meantime, I’ve started working on a workaround
I have plex, hass and a few other services running in docker on the same machine, so I can get away without using any token/authentification
You can post the song url into almost any sensor state, I’m using boolean because it looks cleaner and it’s easier to reset
It’s cool to see improvements added to it that’s the beauty of open source and so maybe we can make it to display the song info in hass
Thank you. Im also running several docker containers in the same machine, but perhaps as Im using Nginx it doesnt let me access without the token. Not sure why, but didn’t work without it.
Another issue is that your automaton triggers again when the player goes to idle. I guess it works on Chromecast, any suggestion for other players? I use Bose Soundtouch and the state remains playing after the song is finished. So no re-triggering.
Did some digging and it turns out that you can disable auth
Plex has an option under settings > network > “List of IP addresses and networks that are allowed without auth”
Hass has http > trusted_networks
If your player state doesn’t change to idle maybe you can check media_duration vs media_position or do some math based on when the automation was triggered vs media_duration
off topic…what other goodies do you have in docker?I’m always looking for new ideas
EDIT: I managed to fix the error code 52. Found the right position for the script file. Now there’s something wrong somewhere else, because I hear the Google Home speaker activating but no song is played. I already added the token as suggested by @juan11perez (thanks!) and I can listen to the song in the browser. @zanerv, is your solution working fine? Or did you change something else after this?
Does anyone know how to troubleshoot something like this?
Thanks.
OLD MESSAGE: Where did you put the song.sh file? I tried putting it in /usr/share/hassio/homeassistant/ but I get error code 52 when I try to execute the shell command /bin/bash -c “/config/song.sh”