Skip to content

Home Assistant Hyperion Integration / How to automate TV ambient light and Hyperion?

Kiril Peyanski and Home Assistant Hyperion Integration

Today I will show you the Home Assistant Hyperion Integration! In other words – how to automate TV ambient light and Hyperion with Home Assistant. I will create several automations that will turn on and off Hyperion and the TV ambient light along with your TV. It is going to be fun, so stay tuned.

Home Assistant Hyperion Integration / How to automate TV ambient light and Hyperion?

Success stories from users?

With Hyperion software, Raspberry PI, HDMI capture card and few meters of RGB LED strip you can make a beautiful TV ambient light that will change colors in sync with your TV image.

TV Ambient Light with Hyperion sent by @HozBlic in my Discord server.
TV Ambient Light with Hyperion sent by @HozBlic in my Discord server.

I described the whole process about how to make TV ambient light in this article and since then many of you managed to make this work. I received multiple success stories as well as pictures & videos in my Discord server. Which is pretty cool! 😎

I’m also very happy user of Hyperion and TV Ambient lIght, but I often forget to turn on or off the LED Strip along with my TV. As end result the LEDs are either working the whole night or they don’t work at all. And when I managed to remember I have to manually open the Hyperion dashboard to enable or disable the LED Device.

That made me think of how to make an automation. What if I add Hyperion to Home Assistant (check this article of mine if you want more info about Home Assistant) and to make the automations there. Surprisingly, I managed to do that and now I’m about to show you how.

But first I have a quick question for you 85% of the views that I’m getting in my YouTube channel are coming from people that are not subscribed and only 15% are from subscribers. Let me know in which group you are in the comments. Now we can start the Home Assistant Hyperion integration.

Home Assistant Hyperion Integration

That part is very easy. Just open you Home Assistant and do the following steps:

Click on Configuration > Integrations > Add Integration > Search for Hyperion > click on the result > as Host enter the IP of the device where Hyperion is installed > leave port as it is > click Submit and then Finish.

Home Assistant Hyperion Integration step-by-step
Home Assistant Hyperion Integration step-by-step

Add Hyperion switch to Home Assistant

To add the Hyperion switch to Home Assistant Lovelace do the following:

Click on “1 device” link under the already added Hyperion integration > click on the device itself in my case the default name was “First LED Hardware instance” > Under Entities section click on the “Add to Lovelace” button > choose a view (if you have more than one) > and finally click on “Add to Lovelace UI” button.

Adding a Hyperion switch in Home Assistant step-by-step
Adding a Hyperion switch in Home Assistant step-by-step

Automate TV ambient light and Hyperion from Home Assistant

We now have the Hyperion in Home Assistant and we can switch on and off the TV ambient light from the Home Assistant Lovelace. It is time to automate this.

I’m going to use several automations to cover most of the possible options. The first option will work great if you have a media player like Apple TV, chromecast and so on that is already added to Home Assistant. The automation will monitor the media player current state – if it is playing – will start and if it is off, pause or idle it will stop the TV ambient lights. Let’s see this first and then we will talk about the second option.

TIP!: Below you will find the YAML way of doing automations! If you want the GUI way – check my video as I’m using it there. This statement is valid for all of the automations in this article.

Start Hyperion from Home Assistant with media player automation

Open your automations.yaml file and paste the following code inside:

# automation.yaml entry
alias: start hyperion when media player play
description: ''
trigger:
  - platform: state
    entity_id: media_player.living_room
    to: playing
condition: []
action:
  - service: light.turn_on
    target:
      entity_id: light.first_led_hardware_instance
    data:
      effect: USB Capture
mode: single

You may wish to change the entity_id: media_player.living_room with your media player entity and entity_id: light.first_led_hardware_instance with your Hyperion entity (if your name is different).

Save the changes in the automations.yaml file and reload your automations from Configuration > Server Controls.

Then you can test the automation by just play anything on your media player. The Hyperion Ambient TV light will automatically turn on, thanks to the Home Assistant Hyperion integration and the Hyperion automation above.

Stop Hyperion from Home Assistant with media player automation

And here is how to make an automation that will stop the TV Ambient Light when you stop using your Media Player!

# automation.yaml entry
alias: stop hyperion when playback stop
description: ''
trigger:
  - platform: state
    entity_id: media_player.living_room
    to: 'off'
  - platform: state
    entity_id: media_player.living_room
    to: idle
  - platform: state
    entity_id: media_player.living_room
    to: paused
condition: []
action:
  - service: light.turn_off
    target:
      entity_id: light.first_led_hardware_instance
mode: single

You may wish to change the entity_id: media_player.living_room with your media player entity and entity_id: light.first_led_hardware_instance with your Hyperion entity (if it has different name).

Save the changes in the automations.yaml file and reload your automations from Configuration > Server Controls.

Then you can test the automation by just play and pause (or play & idle or play & off) anything on your media player and the Hyperion Ambient TV light will automatically turn on and then off, thanks to the Home Assistant Hyperion integration.

HELP WANTED!: Alternatively you can make a single automation and combine both above into one, but I’m too lazy right now to read and test what was the right way to do that. If you are not as lazy as me – paste the YAML of the combined automation in the comments and you will receive all the glory and credits for that here in this article and in this section.

Start Hyperion from Home Assistant with ping binary sensor automation

The second method to automatically control the Hyperion TV Ambient Light will cover the case when you don’t have a media player in Home Assistant, but you have any kind of Smart TV. Not very smart TV is enough. As long as it have an IP in your local network everything is fine.

I will make an automation that will ping my TV every 30 seconds and if there is a positive answer It will automatically turn on the Hyperion and the TV Ambient Light. That automation should work fine no matter what media player are you using and what is the source.

How to create Ping Binary sensor?

Let’s create a binary sensor for our TV as it is needed for the automation.

Open your configuration.yaml file and paste the following YAML code inside:

# configuration.yaml entry
binary_sensor:
  - platform: ping
    host: 10.0.0.24
    name: “LG TV”
    count: 1
    scan_interval: 30

You may wish to change the host: 10.0.0.24 with your TV IP and name: “LG TV” with a name of your choice.

Save the changes then click on “Check Configuration” under Configuration > Server Controls (you must enable Home Assistant Advanced mode from your user profile to see that option).

If configuration is valid, restart your Home Assistant from the same menu by click on “Restart” button.

Use the ping binary sensor for Hyperion automation

We have the binary ping sensor! Time to see the end to end demo of Home Assistant Hyperion integration plus ping automation. And it is ping with “g” not pink like the color. While we are talking about colors now is the best time to turn the boring grey like button into a happy blue one. Just click on it and all is done.

Now let’s continue.

Open your automations.yaml file and paste the following code inside:

alias: Start Hyperion when TV starts
description: ''
trigger:
  - platform: state
    entity_id: binary_sensor.lg_tv
    to: 'on'
condition: []
action:
  - service: light.turn_on
    target:
      entity_id: light.first_led_hardware_instance
    data:
      effect: USB Capture
mode: single

You may wish to change the entity_id: binary_sensor.lg_tv with your binary sensor name and entity_id: light.first_led_hardware_instance if it is with different name.

Save the changes in the automations.yaml file and reload your automations from Configuration > Server Controls.

Then you can test the automation by just start your TV and wait for 30 seconds. Your Hyperion Ambient TV light will automatically turn on, thanks to the Home Assistant Hyperion integration and ping binary sensor.

Outro

If you’re interested in Smart Home & IoT don’t forget to subscribe to my Newsletter as I’m releasing such articles every Wednesday.

If you are just entering into the Smart Home world I also have a Smart Home Getting Started Actionable Guide that will save your money and time.

To secure this website and YouTube channel existence you can become one of my supporters.

Follow me on Twitter and join my Discord server!

Stay safe and don’t forget – Home Smart, but not Hard!

Thank you for reading and I will see you next Wednesday.

Leave a Reply

Your email address will not be published. Required fields are marked *