State stalled - detect with node red

Hi,

for my entity sensor.power_consumption_total I want to detect “stalled” state. Thus normally this state changes every 1-3 seconds but sometimes my integration hangs for a while (minutes-hours). I want to detect that via node-red and reload the integration (then it is solved).

But I can’t get my head around a feasible way to detect/to do.

Use a trigger-state node, RBE, compare… but how ?

any hint or example?

Have an inject node to current state node of the sensor.

Then a switch node if msg.payload == flow.previous.
And one output of otherwise.

After the switch if payload == previous perform the reload.

Otherwise change node flow.previous = msg.payload

Now set the inject to repeat however often you think is reasonable (every three seconds or five seconds).

1 Like

I’ll set an event state to the entity and leave the rest blank. Then use a trigger node set like so. As long as there is updates to the sensor it will reset the timer. If it doesn’t it fires a message that I send to a notify call service.

1 Like