I have a setup where I can cast a playlist from my plex library in shuffle mode to my group of speakers around the house (2 google hubs, 3 nest mini) using:
action:
- service: media_player.volume_set
metadata: {}
data:
volume_level: 0.2
target:
device_id:
- 64f07714a06102daba07ec465aa96c36
- service: media_player.play_media
data:
media_content_type: playlist
media_content_id: "plex://{ \"playlist_name\": \"Family\" , \"shuffle\": \"1\" }"
target:
device_id: 64f07714a06102daba07ec465aa96c36
mode: single
This works great, and plays in sync nicely with the volume set equally before playing.
The next automation I needed was when a TV gets turned on the Hub in that same room stops playing without interrupting the other rooms. Since Google Cast & Media.Player do not support join/unjoin I tried muting/changing volume/turning off the device:
alias: RADIO - turn off living hub if living tv is turned on
description: ""
trigger:
- platform: device
device_id: 87ef18832beb69315c9ed35df0138dac
domain: media_player
entity_id: 5ab8bcfe4965ab030b5068df34c5027e
type: turned_on
condition:
- condition: device
device_id: 4eaafaeaab12b4823a26ec9ce0bad92b
domain: media_player
entity_id: 97a7e48aa28991518d351a5f199e683b
type: is_playing
action:
- service: media_player.volume_set
target:
device_id:
- 4eaafaeaab12b4823a26ec9ce0bad92b
data:
volume_level: 0
mode: single
But this always (anything I do with the mediaplayer) loads the media player app, which interrupts the Plex cast and thus cancels the playback on all speakers.
Is there any solution to his? Or plain not possible with Google devices?
Much appreciated,
Riz