Im stuggeling with Automations.
I have a LED-light under my TVbench.
I want the following to happen.
IF it’s sunset or after sunset and the TV starts → start the led-light.
IF the TV already is on, and the sun goes Down (sunset) → Turn the Led-light on.
3 IF the TV and the Led-light is ON and sunrise → turn Led-light OFF
4 IF the TV turns off → always turn Ledlight off
What kind of LED device, and what kind of TV? Are they integrated with HA?
This is not a problem. First make it simple and when it works add some complexity to it. So drop sunrise, sunset and all the rest.
First you have to figure out when tv is on and when is off. I don’t know how you set it up, but this can be easily done with ie. Smart plug or outlet.
When you solve this than it’s easy to write some simple automation ie. When tv is on turn on led, when tv is off turn off led.