Hi - I'm trying to figure out how to approach the following problem. I have a flow which uses a Raspberry Pi to control an output, I use an input to get feedback from the device being controlled.
All being well - the input follows the output - but... what I want to do is periodically (1 hz) compare the status of the input and output - if they are not matched for more than 2 cycles (so 2 seconds) then I want to trigger an action.
I planned to use a join node with 2 status nodes but I can't figure out how to have this accumulate 2 cycles before triggering.
This is what I have so far - but this will only output a message when the status of the I/O changes. I want to do the check independently. (at the bottom - ignore the rest of the flow - just experimenting)
[{"id":"de2d441d.e51f68","type":"status","z":"d0a0c3ed.6a34b","name":"RPi_Out","scope":["11a8e39c.f4df0c"],"x":80,"y":500,"wires":[["ede3f672.6b63b8"]]},{"id":"d24a3029.7cc5c","type":"status","z":"d0a0c3ed.6a34b","name":"RPi_In","scope":["89f1a0ed.f4fe8"],"x":90,"y":540,"wires":[["ede3f672.6b63b8"]]},{"id":"ede3f672.6b63b8","type":"join","z":"d0a0c3ed.6a34b","name":"Check","mode":"custom","build":"array","property":"","propertyType":"full","key":"topic","joiner":"msg:topic","joinerType":"str","accumulate":false,"timeout":"5","count":"1","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":250,"y":520,"wires":[["f7fcde79.829da"]]},{"id":"f7fcde79.829da","type":"debug","z":"d0a0c3ed.6a34b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":380,"y":520,"wires":[]}]