azogue/eventsensor

Force update

Gluwc opened this issue · 1 comments

Gluwc commented

This component is great! I was just wondering if there's a possibility to force a sensor update on an event. Currently it only appears to update the sensor if the event has actually changed, however for automations using single buttons I think it would be great if the sensor could update regardless.

Hi @Gluwc, the sensor is updating ;-), but with the same state as before (but inside, the attributes should point to details coming from the last fired event).

This is a problem/feature of HA Core: when an entity in HA changes, if the state changes, a new event "state_changed" is fired, which is the one that automations with "state" trigger are listening to.

So, to trigger automations, it is better to just listen to the original event :), which is the one that fires all times :)

In recent HA versions, most of the devices firing this kind of events have now "device triggers", which are, basically, specific event listeners for button presses and that kind of things, but easily configurable with the Automation UI, I suggest you to explore that way: