Did you ever want to go supercharged on your smart home automations and execute one through your TV remote?
This can be handy – for example – whenever you want to turn off the lights before watching something on Netflix , but all you have at your hand is the remote.

It’s not that complicated, Those are the things you will need:

  1. A streamer that runs Android TV
  2. Home Assistant
  3. A little patience

Let’s get started!

 

Integrate Android TV to Home Assistant

First, activate developer mode on your Android TV.

After you did it, go into Home Assistant Devices and integrations, add a new integration – search for “Android TV”.
Add the IP of your Streamer/TV and hit “Submit”.

Now, after our Android TV is connected to our smart home, we can control it and see the current active app. We will use this entity to trigger our automation.

The main concept

Let’s say that we want that whenever we open Netflix app – the lights should change. That’s pretty easy – but not really versatile. Sometimes we watch TV during the day; or someone might be in the kitchen – turning all of the lights may annoy him. Or Her. You don’t want to do that.

What’s the solution? A little “hack”.  Trigger an unused app that is useless to the user, just to get the state change on home assistant.
I will use this app for triggering my automation – com.google.android.tv.remote.service – but you can use any other app to your liking – by visiting your Android TV entity and see the current active app.

Map your buttons

But how can we open this app? Well, that’s easy – we can use the Button Mapper app and map one of our remote buttons to open it.

Screenshot image 1

Download the app on your TV and hit “Add Buttons”. Add your button and map it to the relevant app to open.

 

The final part

Build yourself an automation! My automation will trigger a different automation, which is being used to toggle “Movie mode”

I hope you’ll have fun with this!

Cheers.