This post will show you how to use home automation to autoplay shows on a Roku throughout the night. On a variety of apps (i.e., Hulu, Netflix, Amazon) you can only stream a limited number of episodes before the app checks if “you’re still watching”.
You can copy this flow from the following gist. https://gist.github.com/aznoohwee/2dd83cc57b44abc900853435659b3cdb
How the script works is basically it detects the current state of the Roku. If the state is “playing” and transitions to “on or paused” then a command is issued to resume playing.
I found that apps behave differently from each other. For example in Hulu, pressing “play” when “paused” usually resumes playing. In Netflix, however, the “select” command will resume playing.