Hyperion: add light client that clears its priority when turned off

Currently, in the HA Hyperion integration we have 2 light entities that act differently when being turned off:

  • the light entity (enabled by default): when turning off it will turn off the LED device of Hyperion therefore disabling it entirely and making it unavailable for other source
  • the light_priority entity (disabled by default): when turning off it will send a black color to Hyperion therefore allowing other sources with higher priority to be used

Suggestion:
I have multiple sources that can send data to hyperion and all of them follow a different strategy. In my opinion that is the one that should be added to the HA integration as well: clear the input when the light is turned off. That means, after turning the light off in HA, when we go to the Hyperion web interface to Remote ControlSource selection it is no longer listed there as input, while the LED device stays turned on.

For example, in NodeRED (using node-red-contrib-hyperion) this can be done by sending a {"clear":true} payload.

I have tested this in a dev build by adding another light entity called light_client that does just that.

Additional considerations:

  • replace the light_priority entirely with this new entity (maybe keep the name?). The “send black color” variant seems to me like a hacky solution, where we still maintain an active connection where it is not necessary. Clearing the input from HA should be the proper fix for this issue.
  • as we already have a switch.led_device entity in the integration, in my opinion we might also disable the logic that turning on light while led_device is off turns led_device on. This behaviour can be constructed in HA if the user wants to. This effectively means, removing the current light entity altogether.

Both of these suggestions would also make the code of the integration leaner.

Since I already tested this on a dev build I’m willing to make the changes and create the PR. Please let me know if you agree with this and I will go ahead and do it.

Thank you.

Previous GitHub issue regarding this: https://github.com/home-assistant/core/issues/77020

CC @dermotduffy

Hi

I have been playing with node red and controlling Hyperion. So far so good. I was really looking for a way to clear my source sins I cannot rely on the hyperion plugin. It seems to hang once in a while.

I managed to control the colors etc and the clear command works great but I cannot turn on the USB capture with the following Json

{
 "command":"componentstate",
 "componentstate":{
   "component":"V4l",
   "state":true
 }
}

Could you confirm it is the right syntax

VIncent