I am using Node-Red to send data from my Solar collector to KNX, mostly status information. IN order to reduce the amount of data being sent, I have included a filter node to only pass messages where the payload has changed.
But I want also each parameter from the collector to be sent for example at least once per hour (ideally at a scheduled time), because some pumps for example don't change their status for weeks.
How can I do this?
I guess you could, at your chosen time inject a spurious value eg "dummy" which would pass through the filter node[s]. Use a switch node to then throw this value away. The next real value arriving at each filter would then be passed through.
It would give a neater flow if you could use a single filter node, applying the filter seperately for each msg.topic, or other msg property.
I was looking at this, but was under the impression that when there's no message sent for many hours it wouldn't send the last value on a regular basis.
It should be possible to create function node that stores the latest (incoming) value and forwards it at a given schedule. Have you searched the node database if there's already a contrib node doing such a job?
I suspect that to re-release the last received messages exactly at a specified time will require some sort of queue node - maybe node-red-contrib-queue-gate.
I'm not sure if that node allows a separate queue per topic though, can't check right now.
There is a semaphore node from @marcus-j-davies too, don't know if that would be applicable.
@andre78,
If you need to give messages exclusive access to some part of your flow, whilst holding back other messages waiting to gain access, then I have a node that may help.
it's a pretty advanced semaphore node, allowing great control over access, to different parts of the flow,
whilst at the same time offering fail-safe - i.e if a part of your flow becomes dead-locked for example.