I’ve made a modification to the Plex component to allow me to pass it the content I want it to play.
This script is invoked when I tell my Echo - “Alexa, turn on video workout”. It turns on the the lights in the workout room, turns on the whole home audio speaker for the workout room, sets the speaker to the workout room tv source, launches Plex on the Roku attached to the workout room tv, then starts the workout video on Plex.
For this last bit I overloaded the Plex component ‘source’ function to support a bit of json that contains the library and content to play. It seems to be working. I’m going to play with some variants for different media types (e.g. movies, music, etc.)
script:
video_workout:
sequence:
- service: light.turn_on
entity_id: light.workout
- service: media_player.turn_on
entity_id: media_player.workout_speaker
- service: media_player.select_source
entity_id: media_player.workout_speaker
data:
source: Workout
- service: media_player.select_source
entity_id: media_player.roku_workout
data:
source: 'Plex'
- service: media_player.select_source
entity_id: media_playerr.roku_workout
data:
source: '{ "library" : "Fitness", "title" : "Jillian Michaels 30 Day Shred" }'
Now I just need to stop sitting around hacking on HA and actually workout.