Event triggers? I need help!

HA yelled at me this morning because it no longer likes my years-old automation based on my binary_sensor from my Ring Doorbell. This was my old automation:

image

But now I guess it wants me to use the Ding event rather than the binary_sensor:
image

I just can’t figure out what the syntax would be. The entity_id of the ding event is event.front_door_ding. Can anyone help?

You should just need a State trigger:

trigger:
  - platform: state
    entity_id: event.front_door_ding

Thanks @Didgeridrew, but I feel like there should be more to it than that. When I look at my event states, the current state is a timestamp.

Just to clarify, don’t confuse Event triggers with what you are asking about… Event entities

Yes, event entities return a timestring for their state; just like the other “stateless” entity types: button, input_button, scene, and conversation. This timestring is when the event last occurred.

By using an open State trigger (without a defined to or from), the trigger will fire whenever the state updates. The attributes of the event entity should be static. If you want to be extra safe and guard against the possibility that an attribute change causes the trigger to fire, you can add a to or from or one of the “not” variations as follows:

trigger:
  - platform: state
    entity_id: event.front_door_ding
    not_to: unknown

I think you just nailed it. Thank you!

Hi Mike,

Did it yell anything in particular?

What you show appears to be the legacy syntax, but it should work that way and continue to work that way al-be-it with a warning that it’s legacy syntax from Code Server Ha extension.

Unfortunately I dismissed the notifications a little too quickly, but I think it said that the binary_sensor would be removed in 2024.11.0. I’m not sure if it is a HA thing or specific to the Ring integration. But we’ll know in a couple of days!