Hi!
I’ve created a new custom component: Man in the Middle Light . It lets you select a light entity and then creates two linked light entities and an on/off switch. The selected light will follow one or the other linked lights, depending on the state of the switch. The use case that made me write this component is this: I have light that’s close to my projection screen. Whenever I’m watching media on the screen, I want the light to turn off automatically. I tried achieving this with normal automation rules, but that’s a pain. You have to store the previous state, and then restore that when the media player pauses or stops. And it’s impossible to prevent scenes to interfere with this.
Enter: Man in the Middle Light (mitmili for short). It creates a _proxy and an _override light. I can use the automation that detects state changes on the media player to toggle the overridden switch. I’ve changed all my scenes and other automations to use the _proxy light. So now, when I change scenes while watching a movie, the light will stay off. And when the movie stops or pauses, the light will go back on, to the brightness and color temperature of the new scene that I selected during the movie.
I’ve created this for my own use case in the first place, but I’m happy to share it here. I’m also curious what others think of it, and I hope it’s useful for others as well. Let me know what you think, and if you run into any issues. This is my very first Home Assistant custom component, so there will be things that I didn’t do right, for sure.
