[{"id":"32c36e6a.cc10d2","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"1c9783f5.c67d6c","type":"inject","z":"32c36e6a.cc10d2","name":"Front sensor","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":174,"y":72,"wires":[["7f95bce9.47ec34"]]},{"id":"6d024687.407618","type":"inject","z":"32c36e6a.cc10d2","name":"Back sensor","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":174,"y":168,"wires":[["d7db0117.44f22"]]},{"id":"47a13b3f.0b8484","type":"trigger","z":"32c36e6a.cc10d2","op1":"","op2":"","op1type":"pay","op2type":"nul","duration":"2","extend":false,"units":"s","reset":"","bytopic":"all","name":"","x":620,"y":128,"wires":[["8ea84cd.4f29ab","ee4017ca.0db978"]]},{"id":"8ea84cd.4f29ab","type":"debug","z":"32c36e6a.cc10d2","name":"which sensor first?","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":874,"y":80,"wires":[]},{"id":"ee4017ca.0db978","type":"change","z":"32c36e6a.cc10d2","name":"convert to count","rules":[{"t":"change","p":"payload","pt":"msg","from":"Front","fromt":"str","to":"1","tot":"num"},{"t":"change","p":"payload","pt":"msg","from":"Back","fromt":"str","to":"-1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":864,"y":128,"wires":[["efcc6326.384ca","fdf79205.5ae05"]]},{"id":"efcc6326.384ca","type":"debug","z":"32c36e6a.cc10d2","name":"incrementer / decrementer","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1200,"y":80,"wires":[]},{"id":"7f95bce9.47ec34","type":"change","z":"32c36e6a.cc10d2","name":"set to \"Front\"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Front","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":72,"wires":[["47a13b3f.0b8484"]]},{"id":"d7db0117.44f22","type":"change","z":"32c36e6a.cc10d2","name":"set to \"Back\"","rules":[{"t":"set","p":"payload","pt":"msg","to":"Back","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":358,"y":168,"wires":[["47a13b3f.0b8484"]]},{"id":"e3c748d2.3e9e98","type":"debug","z":"32c36e6a.cc10d2","name":"Total in Store","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1534,"y":128,"wires":[]},{"id":"c8053db1.5c77e","type":"inject","z":"32c36e6a.cc10d2","name":"Initialize","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":156,"y":256,"wires":[["631048a.66f95b8"]]},{"id":"631048a.66f95b8","type":"change","z":"32c36e6a.cc10d2","name":"set inStore = 0","rules":[{"t":"set","p":"inStore","pt":"flow","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":376,"y":256,"wires":[[]]},{"id":"fdf79205.5ae05","type":"change","z":"32c36e6a.cc10d2","name":"Calulate total & store","rules":[{"t":"set","p":"inStore","pt":"flow","to":"$flowContext(\"inStore\") + msg.payload","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1124,"y":128,"wires":[["a8cfb807.90ea58"]]},{"id":"a8cfb807.90ea58","type":"change","z":"32c36e6a.cc10d2","name":"Total in store","rules":[{"t":"set","p":"payload","pt":"msg","to":"inStore","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":1350,"y":128,"wires":[["e3c748d2.3e9e98"]]}]