How to spot a static change properly? (noob question)

for a number of Zigbee devices, I check if the device is offline, if offline - send a notification.
My method today is:


Screenshot from 2023-02-16 21-20-32

The "problem" is that I really would like the logic to be for each device:
if (offline_time > 24h) then notify.
I guess the answer is not to duplicate the function node for each element and program the logic into it like I did?
if there another node I should use that can do the:
if (msg.payload === "offline" and its_bee_offline_for > 24h) then ....

I think that this is what you want?

Just not quite certain it will handle things in the right order without trying. OK, just tested and it does indeed do exactly what you want.

Also, you may not need multiple MQTT inputs, you may be able to use wildcards.

1 Like

It seems this "trigger node" must be insterted after my "function node"?

  • or can my "function node" somehow be simplified/moved into something simpler?

No, I don't believe you need a function node at all. The trigger node does everything.

1 Like

Thank you

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.