I couldn’t find any instructions for the above so after a few tries I’ve gotten it to work. The goal is to play Pandora in my daughter room using Chromecast at certain time at night.
Needless to say I don’t think this is the best solution but it works for my purpose so here goes in case anyone needs it.
1.Get mkchomecast which uses pychromecast
2. Using shell command to : remove any existing mkchromecast, launch mkchromecast to cast to my daughter room, set default output for pulseaudio to mkchromecast then launch pianobar.
Here are the command lines I’ve used.
shell_command:
clear_existing_cast: 'rm -f /tmp/mkchromecast.pid'
launch_cast: '/usr/bin/python /home/homeassistant/mkchromecast/mkchromecast.py --encoder-backend ffmpeg -n "Britney Bedroom"'
set_default_output: '/usr/bin/pacmd "set-default-sink mkchromecast"'
launch_pianobar: '/usr/local/bin/pianobar'
Lastly, create another script to kill mkchromecast and pianobar after the preset time.