I’m tearing my hair out trying to get an automation to trigger when I turn on a light even if it was already on. I just can’t find a way to do this.
Why?
433mhz receivers sometimes miss a command and in this case you turn them on even though HA assumes them being on. But how the heck do I react to the act of turning the light on regardless of its current state?
By monitoring the event that was received to turn on the light, assuming such an event is available.
You’ll need to post more information about how you’re modeling the light in Home Assistant. For example, what is the integration you’re using to detect the light’s state.
I’m using rfxcom and the light may be turned on by a variety of things: automation, api, Google assistant or the ui. I want the same result regardless of what turned it on.
According to the documentation for the RFXCOM integration, it is able to report events. Your automation can use an Event Trigger to detect events whose event_type is rfxtrx_event and contain the data you want to detect (packet_type, sub_type, etc representing a light turning on).
Your challenge is to detect the event values produced when the light is turned on. I suggest you use Developer Tools > Events > Listen to events. While it’s listening, turn on the light and copy the event data that’s reported.
The events described in the documentation refer to the ones produced by the RFXCOM integration. That means these events are received by Home Assistant from the RFXCOM integration.