Automation that triggers on light turned on even if it was already on

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).

There’s an example in the documentation:


EDIT

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.

That’s a good idea with the event watcher. I’m going to give this a shot. Thank you!!

Although: doesn’t this only regard incoming events? Will rfxcom post an event in outgoing commands as well?

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.

Ah, darn… I need to react when RFXCOM is SENDING an event in this case, so I’m out of luck I guess.

Then you’re in luck because that’s exactly what Home Assistant receives from the RFXCOM integration, namely the events RFXCOM sends.