Changing the state from "on" to "on", does it reset the "time"?

I have a device that spams “I am on” every minute.

So the bar looks like this:

on | on | on | on | on | on | on | on | on | on | on | on | on | on

Not neat, but ok.

But now I set up a trigger that says “on for 5 minutes”. It never triggers.

Is it because it only counts as on for 1 minute at a time and never reaches 5 minute on?

probably

You can verify it by looking at the “last_changed” and “last_updated” attributes of the entity in the dev tools template editor:


{{ states.<your device entity id here>.last_changed }}

{{ states.<your device entity id here>.last_updated }}

We’d need to see your actual trigger. I don’t think that sending “on” repeatedly should result in a state_changed event that would cause problems, but I supposed it could.

Edit: And yes, what finity suggests will provide a clue as to whether the entity has actually changed. But if only an attribute changed, I would expect last_updated to change, but I wouldn’t necessarily expect that trigger to reset.

Thanks, that Dev Tool monitoring helped me. It actually does change it’s state, but not on “on” → “on” transitions, it actually changes from “on” to “unavailable(1sec)” to “on”.

This is because the device loses MQTT connection every couple of minutes (Wifi is 88% though). Now I have to figure out why this is the case. At least the automation behavior is explained.

The plug was Tasmota 6.5.0 and the disconnects were fixed by deactivating Belkin WeMo Emulation.

Now the state bar looks smooth as an android’s bottom and the automations work.