I needed a method for my wife to quickly and hands free play tv shows for our elder daughter while the other was napping.
As well, I can see it being useful as they grow to limit what shows they can watch on their own. Setting up a small upset of shows they're allowed to launch.
This repo is a set of webhooks and lambda functions that link together an Alexa skill to playing media on our tv.
Alexa -> Lambda -> SNS -> Django (home file server) -> Roku (Plex & Youtube)
It has zero resiliency and error checking, more of a fire and forget, either it works or doesn't. Partially because it's a quick little project, partially because the Alexa skill has no async feedback mechanism because it's not tied to a user login.
But if you find any of the pieces useful to learn for your own project, have at it.
- Lambda (Python 3.x)
- DynamoDB (so the Lambda knows if we have a show before sending the message, no async feedback)
- SNS (send messages home)
- Django (receive webhooks)
- Roku Python API and ECP (External Control Protocol)
- Plex Python API
- Postgres (store where each show lives, what the last shown episode was)
I need to be able to launch shows without saying anything, in case one daughter is sleeping
In theory I can turn the LG tv on, and set the volume and input via RS232 interface. I haven't had a chance to get that working yet. I'd probably hook it up to a Raspberry Pi sitting behind the TV.
It could even set a timer for the show length and turn the TV back off. We can ask Plex if something is playing, but we can't tell if a Youtube video is still playing in the Roku app.
"Play a half hour show"
"Play a movie"
etc.
Most AWS services were setup using the web interfaces. I dislike this. I need to use Serverless and other frameworks to auto-deploy the system so the settings can all be in a VCS.
Maybe in the future the kids will need to say, "play x in the rec room"
Is there a way to inject shows in to the launching of the Netflix app on a Roku? That's how the Youtube app works. Or very careful use of the literals
search function via the Roku ECP?
The code is a mess. But it works. And it's not in production outside our household. ¯_(ツ)_/¯
Idea: https://unix.stackexchange.com/a/371869
Use the RPC api to do similar.
Let's be honest, probably none. Once it works I'll probably leave it alone until it breaks or I need a new feature.