Make A Dumb TV Smarter with a Chromecast, Roku, and Home Assistant

Starting my Smart-Home with a Broadlink RM-Pro was such a great first step because it gave me control of my IR devices at a fraction of the cost of the other devices out there, but it left me wanting more. My TV, and I think most out there, use a single On/Off function, as opposed to having a separate “On” button and “Off” button. So when I set the Broadlink up to control the TV, it worked, but if you gave the “Off” command while the TV was already off, it would turn back on, and vise versa. I tried to create a script that would use the state of the TV (in Home Assistant) in deciding whether or not to send the command to the TV, but this only worked if Home Assistant was used the turn the TV on in the first place. Using the remote would throw a wrench right into this. This was not super great for the SAF (spouse approval factor). With the noticeable decline of my Roku Express and a birthday on the way, I started looking into ways to make our dumb TV a little bit smarter.

I had 4 main goals that I wanted to be able to accomplish:

  1. Use a single Remote Control for the system.
  2. Be able to wirelessly cast videos from our computers, Chromebooks, cellphones and tablets.
  3. Have the On/Off state of the TV be accurately reflected in Home Assistant, no matter how the TV was turned on.
  4. I wanted a majority of our streaming to be done on an Ethernet connected device.

All of this was easy to accomplish using a Chromecast and a Roku Ultra. The Chromecast provided a great device to Cast videos (duh, right?) and to reflect the state of the TV, while the Roku Ultra gave me a single remote with TV power & volume controls as well as an Ethernet connection. I got what I wanted and it passed the spouse test! The Roku is also compatible with Home Assistant; I can use Alexa commands to turn the TV on, off (I needed the Broadlink to do this), and to switch between Netflix, Hulu, and Amazon video.

This guide will include:

  • Using the Chromecast to reflect the state of the TV in Home Assistant.
  • Integrating the Roku with Home Assistant.
  • Creating scripts or Alexa commands to control the TV & Roku.

Notice:

This post has been marked as a legacy post and has been flagged to be updated.

If you would like to receive updates from Smart Home Hobby, please subscribe below.


Reflect TV State, in Home Assistant, with Chromecast

I won’t go over setting up the Chromecast here; they are very user friendly devices. I will just show you how to use the Chromecast to reflect the TV’s state. In order for this to work, however, you will need to plug the Chromecast USB into the TV to power it. This way, when the Chromecast is on, so is the TV.

img_0210.jpg

  • Do not add the Chromecast to the Home Assistant config file. If it’s added, but off, you can get errors because Home Assistant will keep looking for it.
  • The configuration uses the Ping binary sensor, a switch template, and separate ‘on’ and ‘off’ scripts for the TV.

https://gist.github.com/smarthomehobby/093e6309b85073bf67b9a14cccfddc29

Connecting the Roku to Home Assistant

We use our Roku for a large majority of our entertainment needs. The Roku Ultra allowed us to have an Ethernet connected device and to put away our TV remote since it can also control the TV’s power and volume.

IMG_0107

Home Assistant’s discover component will find Roku devices, but I prefer to add the Roku manually.

https://gist.github.com/smarthomehobby/fcf30e7686b8f8d41b8e7326683a53ff

Creating Scripts to Control Roku

Now you can navigate different to different Roku apps from within Home Assistant as well as Play & Pause with a couple of scripts. You can also use these scripts with Alexa to control the system with your voice!

https://gist.github.com/smarthomehobby/8d402e51f4ae80707eba33148c689200

All combined, the Chromecast, Roku Ultra, and Home Assistant work well together to give me more control over my TV and make it feel much smarter than it actually is. I like being able to have the accurate state for my TV reflected in Home Assistant, and my SO loves the Roku Ultra remote since now we only have to use one remote for the TV.

Have you been able to make a dumb device a little smarter? How did you do it? Please share in the comments!  If these guides have been helpful to you , please share them! If you have any questions, please reach out to me in the comments. Thanks for visiting!

3 thoughts on “Make A Dumb TV Smarter with a Chromecast, Roku, and Home Assistant

  • June 30, 2018 at 3:49 pm
    Permalink

    Thank you for the idea, I never considered using the state of a device connected to USB! I control my projector via a Broadlink as well, but have been unable to figure out how to accurately track the state.

    Instead of a Chromecast I flashed a $3 Wemos D1 Mini with Sonoff-Tasmota, and then made the binary_sensor based off the MQTT LWT. Works perfect.

    Have you combined these different entities into a universal media player? https://www.home-assistant.io/components/media_player.universal/

    Reply
    • July 10, 2018 at 8:10 am
      Permalink

      Hey diybrad. I have’t combined my entities into a universal media player, but that sounds cool so I’ll have to check it out. I haven’t gotten to the point of flashing anything onto hardware, but I have a couple Sonoff devices I plan to do eventually. I’m not that advanced yet, but am excited to get to that point. Thanks for the ideas!

      Reply
  • January 11, 2019 at 2:44 pm
    Permalink

    Do you have the problem of you are watching a video on the Chromecast and you forget you are watching on it and you hit the play pause button on the regular physical Roku remote and that it switches to the Roku source and your like oops. And can’t switch back to the Chromecast video.

    I would somehow like to be able to hit the play pause button on the roku remote and it will pause the chromecast if playing. Wonder if it’s possible.

    Reply

Leave a Reply to Alex Jensen-SharpCancel reply