Time Check From 2 csv files

check this out

[{"id":"2011b9f1be974e16","type":"tab","label":"Flow 2","disabled":false,"info":"","env":[]},{"id":"e80e37bbc79a897b","type":"watch","z":"2011b9f1be974e16","name":"","files":"/config/BlueLog/","recursive":"","x":520,"y":360,"wires":[["dd87ceae5a984b8c"]]},{"id":"dd87ceae5a984b8c","type":"change","z":"2011b9f1be974e16","name":"","rules":[{"t":"set","p":"filename","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":710,"y":360,"wires":[["168efa6cc995af30"]]},{"id":"168efa6cc995af30","type":"file in","z":"2011b9f1be974e16","name":"","filename":"","format":"lines","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":880,"y":360,"wires":[["5b913aaf63651976"]]},{"id":"1e938a4604325843","type":"function","z":"2011b9f1be974e16","name":"last line","func":"let lines = msg.payload\nmsg.payload = lines[lines.length - 2]\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1140,"y":360,"wires":[["1ca26072194c21d7"]]},{"id":"5b913aaf63651976","type":"join","z":"2011b9f1be974e16","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1010,"y":360,"wires":[["1e938a4604325843"]]},{"id":"1ca26072194c21d7","type":"debug","z":"2011b9f1be974e16","name":"file","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1390,"y":320,"wires":[]}]

cool .. you tweak it according to your files and data and see what works for your application :+1:

1 Like

definitely! thanks for the code and direction

this is pretty impressive i figured id share since it is yours

[{"id":"7c8093e112804a45","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"a8e3720248d1d7ad","type":"api-call-service","z":"7c8093e112804a45","name":"ch8 on","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.10013b653f_4","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":990,"y":480,"wires":[["e2374444c0e4ec29"]]},{"id":"b65aeaaaa837116a","type":"api-call-service","z":"7c8093e112804a45","name":"ch8 off","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.10013b653f_4","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1250,"y":480,"wires":[["c89ea2389c80664f"]]},{"id":"e2374444c0e4ec29","type":"delay","z":"7c8093e112804a45","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1120,"y":480,"wires":[["b65aeaaaa837116a"]]},{"id":"458d96ac7caf326f","type":"change","z":"7c8093e112804a45","name":"1131","rules":[{"t":"set","p":"payload.col4","pt":"msg","to":"System Msg (1121): Ppm's went below 1300, dosing system activated","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1410,"y":780,"wires":[["e758886fed4e2b08"]]},{"id":"4f630cc4e0fd73b4","type":"api-call-service","z":"7c8093e112804a45","name":"ch1","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.1001207d06_1","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":990,"y":780,"wires":[["d56e53e370fb54d8"]]},{"id":"1a8ec483ecb2b575","type":"api-call-service","z":"7c8093e112804a45","name":"ch 2","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.1001207d06_2","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":990,"y":840,"wires":[["eb37ae4531a8d01f"]]},{"id":"6ac5e32941f13b5b","type":"api-call-service","z":"7c8093e112804a45","name":"ch 3","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.1001207d06_3","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":990,"y":900,"wires":[["c2e4c2b780e41f48"]]},{"id":"c3e4ae6ffe4d8eb5","type":"api-call-service","z":"7c8093e112804a45","name":"ch 4","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.1001207d06_4","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":990,"y":960,"wires":[["54b1ef740f636584"]]},{"id":"f3468e510564d083","type":"api-call-service","z":"7c8093e112804a45","name":"ch 5","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.10013b653f_1","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":990,"y":1020,"wires":[["c040850a4159a174"]]},{"id":"17b22c5c0901591e","type":"api-call-service","z":"7c8093e112804a45","name":"ch 6","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.10013b653f_2","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":990,"y":1080,"wires":[["607394373a4d70ed"]]},{"id":"e12f39669e9838b7","type":"api-call-service","z":"7c8093e112804a45","name":"ch 7","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.10013b653f_3","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":990,"y":1140,"wires":[["369564a4ad5d6386"]]},{"id":"c7b1855ad0e74a44","type":"api-call-service","z":"7c8093e112804a45","name":"ch1","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.1001207d06_1","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1250,"y":780,"wires":[["458d96ac7caf326f"]]},{"id":"562f90d9d01bf852","type":"api-call-service","z":"7c8093e112804a45","name":"ch 2","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.1001207d06_2","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1250,"y":840,"wires":[["458d96ac7caf326f"]]},{"id":"28758d5c9cbb8e11","type":"api-call-service","z":"7c8093e112804a45","name":"ch 3","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.1001207d06_3","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1250,"y":900,"wires":[["458d96ac7caf326f"]]},{"id":"37e8f70008508b87","type":"api-call-service","z":"7c8093e112804a45","name":"ch 4","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.1001207d06_4","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1250,"y":960,"wires":[["458d96ac7caf326f"]]},{"id":"26d26ebb8a5cb333","type":"api-call-service","z":"7c8093e112804a45","name":"ch 5","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.10013b653f_1","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1250,"y":1020,"wires":[["458d96ac7caf326f"]]},{"id":"6a576509891e8f3c","type":"api-call-service","z":"7c8093e112804a45","name":"ch 6","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.10013b653f_2","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1250,"y":1080,"wires":[["458d96ac7caf326f"]]},{"id":"c84f2c455bcba1a5","type":"api-call-service","z":"7c8093e112804a45","name":"ch 7","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.10013b653f_3","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1250,"y":1140,"wires":[["458d96ac7caf326f"]]},{"id":"d56e53e370fb54d8","type":"delay","z":"7c8093e112804a45","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1120,"y":780,"wires":[["c7b1855ad0e74a44"]]},{"id":"eb37ae4531a8d01f","type":"delay","z":"7c8093e112804a45","name":"","pauseType":"delay","timeout":"6","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1120,"y":840,"wires":[["562f90d9d01bf852"]]},{"id":"607394373a4d70ed","type":"delay","z":"7c8093e112804a45","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1120,"y":1080,"wires":[["6a576509891e8f3c"]]},{"id":"c040850a4159a174","type":"delay","z":"7c8093e112804a45","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1120,"y":1020,"wires":[["26d26ebb8a5cb333"]]},{"id":"54b1ef740f636584","type":"delay","z":"7c8093e112804a45","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1120,"y":960,"wires":[["37e8f70008508b87"]]},{"id":"369564a4ad5d6386","type":"delay","z":"7c8093e112804a45","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1120,"y":1140,"wires":[["c84f2c455bcba1a5"]]},{"id":"c2e4c2b780e41f48","type":"delay","z":"7c8093e112804a45","name":"","pauseType":"delay","timeout":"9","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1120,"y":900,"wires":[["28758d5c9cbb8e11"]]},{"id":"fd1d69b360c2b974","type":"api-call-service","z":"7c8093e112804a45","name":"all off","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.1001207d06_1, switch.1001207d06_2, switch.1001207d06_3, switch.1001207d06_4","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1250,"y":680,"wires":[["d46ad0cf150fafc4"]]},{"id":"21af0a14976f9476","type":"file","z":"7c8093e112804a45","name":"BlueLogs","filename":"/config/BlueLogs.csv","appendNewline":true,"createDir":true,"overwriteFile":"false","encoding":"none","x":1700,"y":640,"wires":[["dc721b77684d5411"]]},{"id":"e758886fed4e2b08","type":"csv","z":"7c8093e112804a45","name":"","sep":",","hdrin":"","hdrout":"none","multi":"one","ret":"\\n","temp":"","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":1570,"y":640,"wires":[["21af0a14976f9476"]]},{"id":"dc721b77684d5411","type":"debug","z":"7c8093e112804a45","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1850,"y":640,"wires":[]},{"id":"c89ea2389c80664f","type":"change","z":"7c8093e112804a45","name":"1133","rules":[{"t":"set","p":"payload.col5","pt":"msg","to":"System Msg (1133): Ph went under 5.4, doser has been activated. Check status ASAP","tot":"str","dc":true}],"action":"","property":"","from":"","to":"","reg":false,"x":1410,"y":480,"wires":[["e758886fed4e2b08"]]},{"id":"d46ad0cf150fafc4","type":"change","z":"7c8093e112804a45","name":"1141","rules":[{"t":"set","p":"payload.col4","pt":"msg","to":"System Msg(1143) Error within system, pumps may need calibrating","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1410,"y":680,"wires":[["e758886fed4e2b08"]]},{"id":"3e628c65f31d6bee","type":"change","z":"7c8093e112804a45","name":"1122","rules":[{"t":"set","p":"payload.col4","pt":"msg","to":"System Msg (1122): Within Recommended Levels","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1410,"y":740,"wires":[["e758886fed4e2b08"]]},{"id":"6fab8f33ae97b205","type":"change","z":"7c8093e112804a45","name":"1124","rules":[{"t":"set","p":"payload.col5","pt":"msg","to":"System Msg(1124): Conditions are Optimal","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1410,"y":540,"wires":[["e758886fed4e2b08"]]},{"id":"9ec35ded97a42349","type":"change","z":"7c8093e112804a45","name":"1143","rules":[{"t":"set","p":"payload.col5","pt":"msg","to":"System Msg(1144): Pump or probe may need attention","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1410,"y":580,"wires":[["e758886fed4e2b08"]]},{"id":"c713a83020298766","type":"change","z":"7c8093e112804a45","name":"1666","rules":[{"t":"set","p":"payload.col4","pt":"msg","to":"System Msg(1666) Fucking all hell is breaking loose SHUT SHIT DOWN!)","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1410,"y":640,"wires":[["e758886fed4e2b08"]]},{"id":"6e28f868fbef1981","type":"api-call-service","z":"7c8093e112804a45","name":"ch8/off","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.10013b653f_4","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1250,"y":580,"wires":[["9ec35ded97a42349"]]},{"id":"d9d5bf159ede78cf","type":"switch","z":"7c8093e112804a45","name":"","property":"payload.col4","propertyType":"msg","rules":[{"t":"gt","v":"2300","vt":"num"},{"t":"gt","v":"2000","vt":"str"},{"t":"btwn","v":"1300","vt":"num","v2":"2000","v2t":"num"},{"t":"lt","v":"1300","vt":"num"}],"checkall":"true","repair":false,"outputs":4,"x":850,"y":700,"wires":[["c713a83020298766"],["fd1d69b360c2b974"],["3e628c65f31d6bee"],["4f630cc4e0fd73b4","1a8ec483ecb2b575","6ac5e32941f13b5b","c3e4ae6ffe4d8eb5","f3468e510564d083","17b22c5c0901591e","e12f39669e9838b7"]]},{"id":"095002630166781f","type":"switch","z":"7c8093e112804a45","name":"","property":"payload.col5","propertyType":"msg","rules":[{"t":"lt","v":"5.4","vt":"str"},{"t":"btwn","v":"5.4","vt":"num","v2":"6.2","v2t":"num"},{"t":"gt","v":"6.2","vt":"num"}],"checkall":"true","repair":false,"outputs":3,"x":850,"y":540,"wires":[["a8e3720248d1d7ad"],["6fab8f33ae97b205"],["6e28f868fbef1981"]]},{"id":"fbd17c2972747592","type":"watch","z":"7c8093e112804a45","name":"watch","files":"/config/BlueLog/","recursive":"","x":70,"y":620,"wires":[["812a6c0c53bb3349"]]},{"id":"812a6c0c53bb3349","type":"change","z":"7c8093e112804a45","name":"change","rules":[{"t":"set","p":"filename","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":200,"y":620,"wires":[["818a73f4e31803db"]]},{"id":"818a73f4e31803db","type":"file in","z":"7c8093e112804a45","name":"","filename":"","format":"lines","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":340,"y":620,"wires":[["293c74a08a4ddd71"]]},{"id":"f69ac80c68f6adaa","type":"function","z":"7c8093e112804a45","name":"last line","func":"let lines = msg.payload\nmsg.payload = lines[lines.length - 2]\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":720,"y":620,"wires":[["095002630166781f","d9d5bf159ede78cf"]]},{"id":"7dec47e81dec9fb2","type":"join","z":"7c8093e112804a45","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":590,"y":620,"wires":[["f69ac80c68f6adaa"]]},{"id":"293c74a08a4ddd71","type":"csv","z":"7c8093e112804a45","name":"","sep":",","hdrin":"","hdrout":"none","multi":"one","ret":"\\n","temp":"","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":470,"y":620,"wires":[["7dec47e81dec9fb2"]]},{"id":"a52fadfc.d75d","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]
1 Like

forgot i use that file in home assistant as readings for some cards...whoops, reinstated the one

but it also allows me to gain a time interval of longer than a minute before the entire program is rerun. it could give false readings if the pumps run without proper time to mix .

[{"id":"7c8093e112804a45","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"a8e3720248d1d7ad","type":"api-call-service","z":"7c8093e112804a45","name":"ch8 on","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.10013b653f_4","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":790,"y":600,"wires":[["e2374444c0e4ec29"]]},{"id":"b65aeaaaa837116a","type":"api-call-service","z":"7c8093e112804a45","name":"ch8 off","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.10013b653f_4","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1050,"y":600,"wires":[["c89ea2389c80664f"]]},{"id":"e2374444c0e4ec29","type":"delay","z":"7c8093e112804a45","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":920,"y":600,"wires":[["b65aeaaaa837116a"]]},{"id":"458d96ac7caf326f","type":"change","z":"7c8093e112804a45","name":"1131","rules":[{"t":"set","p":"payload.col4","pt":"msg","to":"System Msg (1121): Ppm's went below 1300, dosing system activated","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1210,"y":900,"wires":[["e758886fed4e2b08"]]},{"id":"4f630cc4e0fd73b4","type":"api-call-service","z":"7c8093e112804a45","name":"ch1","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.1001207d06_1","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":790,"y":900,"wires":[["d56e53e370fb54d8"]]},{"id":"1a8ec483ecb2b575","type":"api-call-service","z":"7c8093e112804a45","name":"ch 2","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.1001207d06_2","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":790,"y":960,"wires":[["eb37ae4531a8d01f"]]},{"id":"6ac5e32941f13b5b","type":"api-call-service","z":"7c8093e112804a45","name":"ch 3","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.1001207d06_3","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":790,"y":1020,"wires":[["c2e4c2b780e41f48"]]},{"id":"c3e4ae6ffe4d8eb5","type":"api-call-service","z":"7c8093e112804a45","name":"ch 4","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.1001207d06_4","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":790,"y":1080,"wires":[["54b1ef740f636584"]]},{"id":"f3468e510564d083","type":"api-call-service","z":"7c8093e112804a45","name":"ch 5","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.10013b653f_1","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":790,"y":1140,"wires":[["c040850a4159a174"]]},{"id":"17b22c5c0901591e","type":"api-call-service","z":"7c8093e112804a45","name":"ch 6","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.10013b653f_2","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":790,"y":1200,"wires":[["607394373a4d70ed"]]},{"id":"e12f39669e9838b7","type":"api-call-service","z":"7c8093e112804a45","name":"ch 7","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.10013b653f_3","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":790,"y":1260,"wires":[["369564a4ad5d6386"]]},{"id":"c7b1855ad0e74a44","type":"api-call-service","z":"7c8093e112804a45","name":"ch1","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.1001207d06_1","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1050,"y":900,"wires":[["458d96ac7caf326f"]]},{"id":"562f90d9d01bf852","type":"api-call-service","z":"7c8093e112804a45","name":"ch 2","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.1001207d06_2","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1050,"y":960,"wires":[["458d96ac7caf326f"]]},{"id":"28758d5c9cbb8e11","type":"api-call-service","z":"7c8093e112804a45","name":"ch 3","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.1001207d06_3","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1050,"y":1020,"wires":[["458d96ac7caf326f"]]},{"id":"37e8f70008508b87","type":"api-call-service","z":"7c8093e112804a45","name":"ch 4","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.1001207d06_4","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1050,"y":1080,"wires":[["458d96ac7caf326f"]]},{"id":"26d26ebb8a5cb333","type":"api-call-service","z":"7c8093e112804a45","name":"ch 5","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.10013b653f_1","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1050,"y":1140,"wires":[["458d96ac7caf326f"]]},{"id":"6a576509891e8f3c","type":"api-call-service","z":"7c8093e112804a45","name":"ch 6","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.10013b653f_2","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1050,"y":1200,"wires":[["458d96ac7caf326f"]]},{"id":"c84f2c455bcba1a5","type":"api-call-service","z":"7c8093e112804a45","name":"ch 7","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.10013b653f_3","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1050,"y":1260,"wires":[["458d96ac7caf326f"]]},{"id":"d56e53e370fb54d8","type":"delay","z":"7c8093e112804a45","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":920,"y":900,"wires":[["c7b1855ad0e74a44"]]},{"id":"eb37ae4531a8d01f","type":"delay","z":"7c8093e112804a45","name":"","pauseType":"delay","timeout":"6","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":920,"y":960,"wires":[["562f90d9d01bf852"]]},{"id":"607394373a4d70ed","type":"delay","z":"7c8093e112804a45","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":920,"y":1200,"wires":[["6a576509891e8f3c"]]},{"id":"c040850a4159a174","type":"delay","z":"7c8093e112804a45","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":920,"y":1140,"wires":[["26d26ebb8a5cb333"]]},{"id":"54b1ef740f636584","type":"delay","z":"7c8093e112804a45","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":920,"y":1080,"wires":[["37e8f70008508b87"]]},{"id":"369564a4ad5d6386","type":"delay","z":"7c8093e112804a45","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":920,"y":1260,"wires":[["c84f2c455bcba1a5"]]},{"id":"c2e4c2b780e41f48","type":"delay","z":"7c8093e112804a45","name":"","pauseType":"delay","timeout":"9","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":920,"y":1020,"wires":[["28758d5c9cbb8e11"]]},{"id":"fd1d69b360c2b974","type":"api-call-service","z":"7c8093e112804a45","name":"all off","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.1001207d06_1, switch.1001207d06_2, switch.1001207d06_3, switch.1001207d06_4","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1050,"y":800,"wires":[["d46ad0cf150fafc4"]]},{"id":"21af0a14976f9476","type":"file","z":"7c8093e112804a45","name":"BlueLogs","filename":"/config/BlueLogs.csv","appendNewline":true,"createDir":true,"overwriteFile":"false","encoding":"none","x":1500,"y":760,"wires":[["dc721b77684d5411"]]},{"id":"e758886fed4e2b08","type":"csv","z":"7c8093e112804a45","name":"","sep":",","hdrin":"","hdrout":"none","multi":"one","ret":"\\n","temp":"","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":1370,"y":760,"wires":[["21af0a14976f9476"]]},{"id":"dc721b77684d5411","type":"debug","z":"7c8093e112804a45","name":"file","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1630,"y":760,"wires":[]},{"id":"c89ea2389c80664f","type":"change","z":"7c8093e112804a45","name":"1133","rules":[{"t":"set","p":"payload.col5","pt":"msg","to":"System Msg (1133): Ph went under 5.4, doser has been activated. Check status ASAP","tot":"str","dc":true}],"action":"","property":"","from":"","to":"","reg":false,"x":1210,"y":600,"wires":[["e758886fed4e2b08"]]},{"id":"d46ad0cf150fafc4","type":"change","z":"7c8093e112804a45","name":"1141","rules":[{"t":"set","p":"payload.col4","pt":"msg","to":"System Msg(1143) Error within system, pumps may need calibrating","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1210,"y":800,"wires":[["e758886fed4e2b08"]]},{"id":"3e628c65f31d6bee","type":"change","z":"7c8093e112804a45","name":"1122","rules":[{"t":"set","p":"payload.col4","pt":"msg","to":"System Msg (1122): Within Recommended Levels","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1210,"y":860,"wires":[["e758886fed4e2b08"]]},{"id":"6fab8f33ae97b205","type":"change","z":"7c8093e112804a45","name":"1124","rules":[{"t":"set","p":"payload.col5","pt":"msg","to":"System Msg(1124): Conditions are Optimal","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1210,"y":660,"wires":[["e758886fed4e2b08"]]},{"id":"9ec35ded97a42349","type":"change","z":"7c8093e112804a45","name":"1143","rules":[{"t":"set","p":"payload.col5","pt":"msg","to":"System Msg(1144): Pump or probe may need attention","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1210,"y":700,"wires":[["e758886fed4e2b08"]]},{"id":"c713a83020298766","type":"change","z":"7c8093e112804a45","name":"1666","rules":[{"t":"set","p":"payload.col4","pt":"msg","to":"System Msg(1666) ā– ā– ā– ā– ā– ā– ā–  all hell is breaking loose SHUT SHIT DOWN!)","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1210,"y":760,"wires":[["e758886fed4e2b08"]]},{"id":"6e28f868fbef1981","type":"api-call-service","z":"7c8093e112804a45","name":"ch8/off","server":"a52fadfc.d75d","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.10013b653f_4","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1050,"y":700,"wires":[["9ec35ded97a42349"]]},{"id":"d9d5bf159ede78cf","type":"switch","z":"7c8093e112804a45","name":"","property":"payload.col4","propertyType":"msg","rules":[{"t":"gt","v":"2300","vt":"num"},{"t":"gt","v":"2000","vt":"str"},{"t":"btwn","v":"1300","vt":"num","v2":"2000","v2t":"num"},{"t":"lt","v":"1300","vt":"num"}],"checkall":"true","repair":false,"outputs":4,"x":650,"y":820,"wires":[["c713a83020298766"],["fd1d69b360c2b974"],["3e628c65f31d6bee"],["4f630cc4e0fd73b4","1a8ec483ecb2b575","6ac5e32941f13b5b","c3e4ae6ffe4d8eb5","f3468e510564d083","17b22c5c0901591e","e12f39669e9838b7"]]},{"id":"095002630166781f","type":"switch","z":"7c8093e112804a45","name":"","property":"payload.col5","propertyType":"msg","rules":[{"t":"lt","v":"5.4","vt":"str"},{"t":"btwn","v":"5.4","vt":"num","v2":"6.2","v2t":"num"},{"t":"gt","v":"6.2","vt":"num"}],"checkall":"true","repair":false,"outputs":3,"x":650,"y":660,"wires":[["a8e3720248d1d7ad"],["6fab8f33ae97b205"],["6e28f868fbef1981"]]},{"id":"3c0ce4f575f920d7","type":"file","z":"7c8093e112804a45","name":"Nf","filename":"/config/grogreen.csv","appendNewline":false,"createDir":true,"overwriteFile":"false","encoding":"none","x":1030,"y":560,"wires":[["62c8052ad734d829"]]},{"id":"62c8052ad734d829","type":"debug","z":"7c8093e112804a45","name":"GroGreen","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1160,"y":560,"wires":[]},{"id":"116712c9ac9982e0","type":"watch","z":"7c8093e112804a45","name":"watch","files":"/config/BlueLog/","recursive":"","x":130,"y":560,"wires":[["a6ccef87b65a7ae0"]]},{"id":"a6ccef87b65a7ae0","type":"change","z":"7c8093e112804a45","name":"change","rules":[{"t":"set","p":"filename","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":260,"y":560,"wires":[["89f5777026013215"]]},{"id":"89f5777026013215","type":"file in","z":"7c8093e112804a45","name":"","filename":"","format":"lines","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":400,"y":560,"wires":[["7d1493e7b10d62a7"]]},{"id":"a70371905892b177","type":"function","z":"7c8093e112804a45","name":"last line","func":"let lines = msg.payload\nmsg.payload = lines[lines.length - 2]\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":780,"y":560,"wires":[["f514d98944673d13"]]},{"id":"a174fde6f8b28c13","type":"join","z":"7c8093e112804a45","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":650,"y":560,"wires":[["a70371905892b177"]]},{"id":"7d1493e7b10d62a7","type":"csv","z":"7c8093e112804a45","name":"","sep":",","hdrin":"","hdrout":"none","multi":"one","ret":"\\n","temp":"","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":530,"y":560,"wires":[["a174fde6f8b28c13"]]},{"id":"23a6fc3206043cdf","type":"debug","z":"7c8093e112804a45","name":"2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":770,"y":740,"wires":[]},{"id":"f514d98944673d13","type":"csv","z":"7c8093e112804a45","name":"","sep":",","hdrin":"","hdrout":"none","multi":"one","ret":"\\n","temp":"","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":910,"y":560,"wires":[["3c0ce4f575f920d7"]]},{"id":"a56b0b995d58ae1d","type":"inject","z":"7c8093e112804a45","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"600","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"payload","payloadType":"msg","x":90,"y":740,"wires":[["398b30e2bbafc0e3"]]},{"id":"398b30e2bbafc0e3","type":"file in","z":"7c8093e112804a45","name":"read","filename":"/config/grogreen.csv","format":"lines","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":210,"y":740,"wires":[["cfd1fc0d73696df9"]]},{"id":"56cdb646ae260326","type":"function","z":"7c8093e112804a45","name":"last line","func":"let lines = msg.payload\nmsg.payload = lines[lines.length - 2]\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":580,"y":740,"wires":[["23a6fc3206043cdf","095002630166781f","d9d5bf159ede78cf"]]},{"id":"521c820af847e901","type":"join","z":"7c8093e112804a45","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":450,"y":740,"wires":[["56cdb646ae260326"]]},{"id":"cfd1fc0d73696df9","type":"csv","z":"7c8093e112804a45","name":"","sep":",","hdrin":"","hdrout":"none","multi":"one","ret":"\\n","temp":"","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":330,"y":740,"wires":[["521c820af847e901"]]},{"id":"a52fadfc.d75d","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]

@UnborN

hey i came across an issue that is when the program is running it will will a timestamp from the file.. this timestamp is usually 2 minutes old. im trying to write something that allows for a fluctuating variable of +/- 3 minutes but once out of range it will not allow the actual program to run..

i put together something small to test

[{"id":"7c8093e112804a45","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"2c0d0dd0f0d3acab","type":"inject","z":"7c8093e112804a45","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"60","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":310,"y":320,"wires":[["6cb061c2583d4350"]]},{"id":"3283245ef49a2b63","type":"debug","z":"7c8093e112804a45","name":"1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":890,"y":200,"wires":[]},{"id":"7683fb8d76274be5","type":"debug","z":"7c8093e112804a45","name":"2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":770,"y":520,"wires":[]},{"id":"e2e1d73cca438d04","type":"inject","z":"7c8093e112804a45","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"60","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"payload","payloadType":"msg","x":70,"y":380,"wires":[["79e38673010a89f7"]]},{"id":"79e38673010a89f7","type":"file in","z":"7c8093e112804a45","name":"read","filename":"/config/grogreen.csv","format":"lines","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":190,"y":380,"wires":[["ce3d1fadcee16e47"]]},{"id":"52148dcc131136a3","type":"function","z":"7c8093e112804a45","name":"last line","func":"let lines = msg.payload\nmsg.payload = lines[lines.length - 2]\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":560,"y":380,"wires":[["febfebc6f2f62b36"]]},{"id":"555964b74eb069bf","type":"join","z":"7c8093e112804a45","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":430,"y":380,"wires":[["52148dcc131136a3"]]},{"id":"ce3d1fadcee16e47","type":"csv","z":"7c8093e112804a45","name":"","sep":",","hdrin":"","hdrout":"none","multi":"one","ret":"\\n","temp":"","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":310,"y":380,"wires":[["555964b74eb069bf"]]},{"id":"6cb061c2583d4350","type":"moment","z":"7c8093e112804a45","name":"","topic":"","input":"","inputType":"msg","inTz":"America/New_York","adjAmount":0,"adjType":"days","adjDir":"add","format":"YYYY-MM-DD HH:mm:ss","locale":"C","output":"","outputType":"msg","outTz":"America/New_York","x":520,"y":320,"wires":[["3283245ef49a2b63","bca1a7e957f55e97"]]},{"id":"b5a022e5c1e3efc7","type":"change","z":"7c8093e112804a45","name":"","rules":[{"t":"set","p":"complete","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":910,"y":380,"wires":[["bca1a7e957f55e97","7db471604621ed65"]]},{"id":"7db471604621ed65","type":"debug","z":"7c8093e112804a45","name":"4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1250,"y":560,"wires":[]},{"id":"14c72076e4ec317d","type":"function","z":"7c8093e112804a45","name":"","func":"var content1 = payload[0];\nvar content2 = payload[1];\n\nif (content1 - content2 =) ( > 3)\n{\nmsg.payload = 1;\n}\nelse\n{\nmsg.payload = 0;\n}\nreturn msg","outputs":1,"noerr":8,"initialize":"","finalize":"","libs":[],"x":1200,"y":320,"wires":[["d2cad7f0514f98be","2b75a6ccab769eb0","30ec5fc8fe958136"]]},{"id":"d2cad7f0514f98be","type":"debug","z":"7c8093e112804a45","name":"5","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1590,"y":320,"wires":[]},{"id":"bca1a7e957f55e97","type":"join","z":"7c8093e112804a45","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"payload","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"1","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1050,"y":320,"wires":[["14c72076e4ec317d","86addbdca3ba9d22"]]},{"id":"86addbdca3ba9d22","type":"debug","z":"7c8093e112804a45","name":"3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1140,"y":180,"wires":[]},{"id":"febfebc6f2f62b36","type":"change","z":"7c8093e112804a45","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.col1","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":380,"wires":[["b5a022e5c1e3efc7","7683fb8d76274be5"]]},{"id":"2b75a6ccab769eb0","type":"change","z":"7c8093e112804a45","name":"time is within range","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1410,"y":240,"wires":[[]]},{"id":"30ec5fc8fe958136","type":"change","z":"7c8093e112804a45","name":"time is out of range","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1410,"y":380,"wires":[[]]}]

idea, gutted the function code to make it know value then substract the two.

change node to set range of value from function node

var content1 = msg.payload[0];
var content2 = msg.payload[1];

{
msg.payload = (content1 - content2)
}

return msg

trial an error right?

got it! i was trying too hard and probably still am but i worked it in like this, output returns a number i can use in a swtch to continue the program

[{"id":"7c8093e112804a45","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"2c0d0dd0f0d3acab","type":"inject","z":"7c8093e112804a45","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"60","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":890,"y":320,"wires":[["6cb061c2583d4350"]]},{"id":"3283245ef49a2b63","type":"debug","z":"7c8093e112804a45","name":"1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1290,"y":280,"wires":[]},{"id":"7683fb8d76274be5","type":"debug","z":"7c8093e112804a45","name":"2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1110,"y":420,"wires":[]},{"id":"e2e1d73cca438d04","type":"inject","z":"7c8093e112804a45","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"60","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"payload","payloadType":"msg","x":70,"y":380,"wires":[["79e38673010a89f7"]]},{"id":"79e38673010a89f7","type":"file in","z":"7c8093e112804a45","name":"read","filename":"/config/grogreen.csv","format":"lines","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":190,"y":380,"wires":[["ce3d1fadcee16e47"]]},{"id":"52148dcc131136a3","type":"function","z":"7c8093e112804a45","name":"last line","func":"let lines = msg.payload\nmsg.payload = lines[lines.length - 2]\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":560,"y":380,"wires":[["febfebc6f2f62b36"]]},{"id":"555964b74eb069bf","type":"join","z":"7c8093e112804a45","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":430,"y":380,"wires":[["52148dcc131136a3"]]},{"id":"ce3d1fadcee16e47","type":"csv","z":"7c8093e112804a45","name":"","sep":",","hdrin":"","hdrout":"none","multi":"one","ret":"\\n","temp":"","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":310,"y":380,"wires":[["555964b74eb069bf"]]},{"id":"6cb061c2583d4350","type":"moment","z":"7c8093e112804a45","name":"","topic":"","input":"","inputType":"msg","inTz":"America/New_York","adjAmount":0,"adjType":"days","adjDir":"add","format":"YYYYMMDDHHmm","locale":"C","output":"","outputType":"msg","outTz":"America/New_York","x":1100,"y":320,"wires":[["3283245ef49a2b63","bca1a7e957f55e97"]]},{"id":"b5a022e5c1e3efc7","type":"change","z":"7c8093e112804a45","name":"","rules":[{"t":"set","p":"complete","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1150,"y":380,"wires":[["7db471604621ed65","bca1a7e957f55e97"]]},{"id":"7db471604621ed65","type":"debug","z":"7c8093e112804a45","name":"4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1330,"y":380,"wires":[]},{"id":"14c72076e4ec317d","type":"function","z":"7c8093e112804a45","name":"","func":"var content1 = msg.payload[0];\nvar content2 = msg.payload[1];\n\n{\nmsg.payload = (content1 - content2)\n}\n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1440,"y":320,"wires":[["d2cad7f0514f98be","2b75a6ccab769eb0","30ec5fc8fe958136"]]},{"id":"d2cad7f0514f98be","type":"debug","z":"7c8093e112804a45","name":"5","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1590,"y":320,"wires":[]},{"id":"bca1a7e957f55e97","type":"join","z":"7c8093e112804a45","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"payload","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"1","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1290,"y":320,"wires":[["14c72076e4ec317d","86addbdca3ba9d22"]]},{"id":"86addbdca3ba9d22","type":"debug","z":"7c8093e112804a45","name":"3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1430,"y":280,"wires":[]},{"id":"febfebc6f2f62b36","type":"change","z":"7c8093e112804a45","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.col1","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":380,"wires":[["d948807f3b27cfd4"]]},{"id":"2b75a6ccab769eb0","type":"change","z":"7c8093e112804a45","name":"time is within range","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1650,"y":240,"wires":[[]]},{"id":"30ec5fc8fe958136","type":"change","z":"7c8093e112804a45","name":"time is out of range","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1650,"y":380,"wires":[[]]},{"id":"d948807f3b27cfd4","type":"moment","z":"7c8093e112804a45","name":"","topic":"","input":"","inputType":"msg","inTz":"America/New_York","adjAmount":0,"adjType":"days","adjDir":"add","format":"YYYYMMDDHHmm","locale":"C","output":"","outputType":"msg","outTz":"America/New_York","x":920,"y":380,"wires":[["b5a022e5c1e3efc7","7683fb8d76274be5"]]}]

You make the wrong assumption that the datetime from Date/Time Formatter node and the datetime from your file will always arrive in the same order and one will be msg.payload[0] and then other always msg.payload[1]. They may arrive at different times when they get merged in Join node as Array.

Suggestion. Do your logic on the same Flow line.
you dont need two separate 1min Inject nodes. One will do.
also some syntax mistakes in Javascript
you can use Jsonata expression in Change node to get the date format with $moment
prepend payload with msg.

[{"id":"7683fb8d76274be5","type":"debug","z":"7c8093e112804a45","name":"1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":830,"y":320,"wires":[]},{"id":"e2e1d73cca438d04","type":"inject","z":"7c8093e112804a45","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"60","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"payload","payloadType":"msg","x":70,"y":380,"wires":[["79e38673010a89f7"]]},{"id":"79e38673010a89f7","type":"file in","z":"7c8093e112804a45","name":"read","filename":"/config/grogreen.csv","format":"lines","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":190,"y":380,"wires":[["ce3d1fadcee16e47"]]},{"id":"52148dcc131136a3","type":"function","z":"7c8093e112804a45","name":"last line","func":"let lines = msg.payload\nmsg.payload = lines[lines.length - 2]\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":560,"y":380,"wires":[["febfebc6f2f62b36"]]},{"id":"555964b74eb069bf","type":"join","z":"7c8093e112804a45","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":430,"y":380,"wires":[["52148dcc131136a3"]]},{"id":"ce3d1fadcee16e47","type":"csv","z":"7c8093e112804a45","name":"","sep":",","hdrin":"","hdrout":"none","multi":"one","ret":"\\n","temp":"","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":310,"y":380,"wires":[["555964b74eb069bf"]]},{"id":"7db471604621ed65","type":"debug","z":"7c8093e112804a45","name":"4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1250,"y":200,"wires":[]},{"id":"14c72076e4ec317d","type":"function","z":"7c8093e112804a45","name":"","func":"\nif ((msg.now - msg.payload) > 3) {\n    msg.payload = 1;\n}\nelse {\n    msg.payload = 0;\n}\n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":940,"y":380,"wires":[["86addbdca3ba9d22","06dc7f5e2802b25f"]]},{"id":"d2cad7f0514f98be","type":"debug","z":"7c8093e112804a45","name":"5","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1250,"y":240,"wires":[]},{"id":"86addbdca3ba9d22","type":"debug","z":"7c8093e112804a45","name":"2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1050,"y":320,"wires":[]},{"id":"febfebc6f2f62b36","type":"change","z":"7c8093e112804a45","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.col1","tot":"msg"},{"t":"set","p":"now","pt":"msg","to":"$moment().format('YYYY-MM-DD HH:mm:ss')\t","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":380,"wires":[["7683fb8d76274be5","14c72076e4ec317d"]]},{"id":"2b75a6ccab769eb0","type":"change","z":"7c8093e112804a45","name":"time is within range","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1290,"y":440,"wires":[[]]},{"id":"30ec5fc8fe958136","type":"change","z":"7c8093e112804a45","name":"time is out of range","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1290,"y":320,"wires":[[]]},{"id":"06dc7f5e2802b25f","type":"switch","z":"7c8093e112804a45","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"eq","v":"1","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":1110,"y":380,"wires":[["30ec5fc8fe958136"],["2b75a6ccab769eb0"]]}]
1 Like

way to make mine look fisher price AF. nice line

[{"id":"98de13ec8a17d7ab","type":"inject","z":"3a0d749743575c47","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":140,"wires":[["fb5a272007e4ed8a"]]},{"id":"fb5a272007e4ed8a","type":"api-current-state","z":"3a0d749743575c47","name":"","server":"a52fadfc.d75d","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_number.silica","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":360,"y":140,"wires":[["ea86e4629c8b2cc5"]]},{"id":"ea86e4629c8b2cc5","type":"calculator","z":"3a0d749743575c47","name":"","inputMsgField":"payload","outputMsgField":"payload","operation":"div","constant":"0.83","round":false,"decimals":0,"x":570,"y":140,"wires":[["473eaf9cdb6ab0ae"]]},{"id":"a52fadfc.d75d","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]

trying to get this delay node to function properly by recalculating the delay and returning it using a msg

for some reason theres no delay from debugs it passes right thru

sorry a quick search shows its actually measure in milliseconds. added a multiplier of 1000 after division node

1 Like
[{"id":"3a0d749743575c47","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"98de13ec8a17d7ab","type":"inject","z":"3a0d749743575c47","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":140,"wires":[["fb5a272007e4ed8a"]]},{"id":"525c116522dfde01","type":"debug","z":"3a0d749743575c47","name":"2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":850,"y":80,"wires":[]},{"id":"fb5a272007e4ed8a","type":"api-current-state","z":"3a0d749743575c47","name":"","server":"a52fadfc.d75d","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_number.silica","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":360,"y":140,"wires":[["ea86e4629c8b2cc5"]]},{"id":"ea86e4629c8b2cc5","type":"calculator","z":"3a0d749743575c47","name":"","inputMsgField":"payload","outputMsgField":"payload","operation":"div","constant":"0.83","round":false,"decimals":0,"x":570,"y":140,"wires":[["750f8d83a5c9f3dd","78e0613fcd1aa640"]]},{"id":"473eaf9cdb6ab0ae","type":"change","z":"3a0d749743575c47","name":"","rules":[{"t":"set","p":"delay","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":860,"y":140,"wires":[["75b2bea4eab65bf5","607c2c78dfd52e58"]]},{"id":"75b2bea4eab65bf5","type":"delay","z":"3a0d749743575c47","name":"","pauseType":"delayv","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1020,"y":140,"wires":[["6de3d8d609ff1f56"]]},{"id":"750f8d83a5c9f3dd","type":"debug","z":"3a0d749743575c47","name":"1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":690,"y":80,"wires":[]},{"id":"607c2c78dfd52e58","type":"debug","z":"3a0d749743575c47","name":"3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1010,"y":80,"wires":[]},{"id":"6de3d8d609ff1f56","type":"debug","z":"3a0d749743575c47","name":"4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1300,"y":120,"wires":[]},{"id":"78e0613fcd1aa640","type":"calculator","z":"3a0d749743575c47","name":"","inputMsgField":"payload","outputMsgField":"payload","operation":"mult","constant":"1000","round":false,"decimals":0,"x":700,"y":140,"wires":[["473eaf9cdb6ab0ae","525c116522dfde01"]]},{"id":"a52fadfc.d75d","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]

pretty neat delay i added. i found ml/sec then used the value to create a delay allowing user to decide the amount of ml for each channel

hehe .. i share your enthusiasm :wink:
Node-red makes programming fun

ps. i imported your flows but its little difficult to understand what msg comes out of those nodes
because some of us dont have Home assistant.

1 Like

sorry its user input read as ml i just made a sensor

input_number:

silica:
name: Silica
initial: 5
min: 0
max: 120
step: 1
mode: slider
unit_of_measurement: 'ml'

is there anyway to use a similar function to allow for outside source to set switch limits?

illl see about making sensors for each switch then go from there

i dont fully understand the requirement
you mean to create a Dashboard for a user to set the msg.delay for the Delay node ?
or is this something not related to your last flow and create limits for a Switch node ?

in either case a solution is possibly to create a Dashboard using the node-red-dashboard
get the limits from the user and set them to Context (you can read what Context is here)
then read and use those Context limit values to whatever node your application needs them

unrelated to previous flow but related in usage of calling value from home assistant dashboard

[{"id":"3a0d749743575c47","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"0f8f50459a14ccf5","type":"switch","z":"3a0d749743575c47","name":"","property":"payload.col4","propertyType":"msg","rules":[{"t":"gt","v":"2300","vt":"num"},{"t":"gt","v":"2000","vt":"str"},{"t":"btwn","v":"1300","vt":"num","v2":"2000","v2t":"num"},{"t":"lt","v":"1300","vt":"num"}],"checkall":"true","repair":false,"outputs":4,"x":870,"y":600,"wires":[[],[],[],[]]},{"id":"e7dd68b18b3de56b","type":"switch","z":"3a0d749743575c47","name":"","property":"payload[4].col5","propertyType":"msg","rules":[{"t":"lt","v":"payload[0]","vt":"msg"},{"t":"btwn","v":"payload[1]","vt":"msg","v2":"payload[2]","v2t":"msg"},{"t":"gt","v":"payload[3]","vt":"msg"}],"checkall":"true","repair":false,"outputs":3,"x":930,"y":340,"wires":[[],[],[]]},{"id":"469ed0dd47b279c1","type":"debug","z":"3a0d749743575c47","name":"GroGreen","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1060,"y":260,"wires":[]},{"id":"9db4a84aab95cc04","type":"file in","z":"3a0d749743575c47","name":"read","filename":"/config/grogreen.csv","format":"lines","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":190,"y":360,"wires":[["f14684682f84373b"]]},{"id":"e2798e83fe2e5ee3","type":"function","z":"3a0d749743575c47","name":"last line","func":"let lines = msg.payload\nmsg.payload = lines[lines.length - 2]\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":560,"y":360,"wires":[["afaa716648d15e58"]]},{"id":"c3515196c71c9eab","type":"join","z":"3a0d749743575c47","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":430,"y":360,"wires":[["e2798e83fe2e5ee3"]]},{"id":"f14684682f84373b","type":"csv","z":"3a0d749743575c47","name":"","sep":",","hdrin":"","hdrout":"none","multi":"one","ret":"\\n","temp":"","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":310,"y":360,"wires":[["c3515196c71c9eab"]]},{"id":"f27c4cfb4b92f627","type":"api-current-state","z":"3a0d749743575c47","name":"ph dose","server":"a52fadfc.d75d","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_number.ph_dose","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":560,"y":180,"wires":[["afaa716648d15e58"]]},{"id":"634cf7e950d6b2e8","type":"api-current-state","z":"3a0d749743575c47","name":"ph low","server":"a52fadfc.d75d","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_number.ph_low","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":570,"y":220,"wires":[["afaa716648d15e58"]]},{"id":"50771d606cda528c","type":"api-current-state","z":"3a0d749743575c47","name":"ph high","server":"a52fadfc.d75d","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_number.ph_high","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":560,"y":260,"wires":[["afaa716648d15e58"]]},{"id":"94f46951276df31e","type":"api-current-state","z":"3a0d749743575c47","name":"ph warn","server":"a52fadfc.d75d","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_number.ph_warn","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":560,"y":300,"wires":[["afaa716648d15e58"]]},{"id":"afaa716648d15e58","type":"join","z":"3a0d749743575c47","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"5","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":790,"y":280,"wires":[["e7dd68b18b3de56b","469ed0dd47b279c1"]]},{"id":"e71981e15d71879a","type":"inject","z":"3a0d749743575c47","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":220,"y":260,"wires":[["f27c4cfb4b92f627","634cf7e950d6b2e8","50771d606cda528c","94f46951276df31e","9db4a84aab95cc04"]]},{"id":"a52fadfc.d75d","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]

When i import your flow, this is what i get :wink:

The missing Home Assistant nodes because i dont have HA ..
which is a common thing on the Forum because everyone's setup is different

In order to replicate part of the logic and understand what you are trying to do
you have to add complete msg Debug nodes after each of those api-current-state nodes and capture some msgs coming out of them, in order to understand their structure (properties, values, etc)

How to capture and share a message from the Debug window :
Hover over the root of the msg and use the Copy value button

image

Share the message (using image) explaining where its coming from.

I was just snapping you pics too feeling bad you canā€™t see any of this

heres some data for the

ppm dose
1300.0

ppm low
1500.0

ppm high
1390.0

ppm warn
2000.0