for a number of Zigbee devices, I check if the device is offline, if offline - send a notification.
My method today is:
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.
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.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.