Advertisement
PlatoNL

Timer Config NodeRed

Aug 14th, 2019
339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [{"id":"af5d981f.ba5798","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"127e0835.3a94d8","type":"function","z":"af5d981f.ba5798","name":"Integer to HH:MM:SS","func":"var sec_num=msg.count;\nvar hours=Math.floor(sec_num/3600)\nvar minutes=Math.floor((sec_num-(hours*3600))/60)\nvar seconds=Math.floor((sec_num-(hours*3600)-(minutes*60)))\n    if (hours   < 10) {hours   = \"0\"+hours;}\n    if (minutes < 10) {minutes = \"0\"+minutes;}\n    if (seconds < 10) {seconds = \"0\"+seconds;}\nvar msg = {payload:hours+':'+minutes+':'+seconds};\nreturn msg;","outputs":1,"noerr":0,"x":640,"y":300,"wires":[["b62f8f8d.c792"]]},{"id":"5f2ef3c4.bb4bfc","type":"looptimer","z":"af5d981f.ba5798","duration":"1","units":"Second","maxloops":"10800","maxtimeout":"4","maxtimeoutunits":"Hour","name":"","x":280,"y":300,"wires":[["2fbfa4c6.af336c"],[]]},{"id":"2fbfa4c6.af336c","type":"counter","z":"af5d981f.ba5798","name":"","init":"0","step":"1","lower":"","upper":"10800","mode":"increment","outputs":"1","x":440,"y":300,"wires":[["127e0835.3a94d8"]]},{"id":"b62f8f8d.c792","type":"mqtt out","z":"af5d981f.ba5798","name":"washing/ontime","topic":"washing/ontime","qos":"","retain":"true","broker":"1cd28398.aba36c","x":700,"y":360,"wires":[]},{"id":"b64c2460.023bb8","type":"change","z":"af5d981f.ba5798","name":"00:00:00","rules":[{"t":"set","p":"payload","pt":"msg","to":"00:00:00","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":360,"wires":[["b62f8f8d.c792"]]},{"id":"ec0dbfd8.f01a6","type":"inject","z":"af5d981f.ba5798","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":"20","x":130,"y":360,"wires":[["28873515.96334a","6ed1743.3fdfe8c"]]},{"id":"8c7df1ac.ec107","type":"trigger-state","z":"af5d981f.ba5798","name":"Laundry Off","server":"52fcfb7c.fc8c24","entityid":"input_boolean.washingmachine","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"id":"io60szfcima","targetType":"this_entity","targetValue":"","propertyType":"previous_state","propertyValue":"old_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"on"},{"id":"5w8qkdlp4lq","targetType":"this_entity","targetValue":"","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"off"}],"constraintsmustmatch":"all","outputs":2,"customoutputs":[],"outputinitially":false,"x":110,"y":240,"wires":[["b64c2460.023bb8","5d2b89a9.c26ec8","6ed1743.3fdfe8c"],[]]},{"id":"2ea5c89e.7cc818","type":"trigger-state","z":"af5d981f.ba5798","name":"Laundry On","server":"52fcfb7c.fc8c24","entityid":"input_boolean.washingmachine","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"id":"i1zlag9oto","targetType":"this_entity","targetValue":"","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"on"}],"constraintsmustmatch":"all","outputs":2,"customoutputs":[],"outputinitially":false,"x":110,"y":300,"wires":[["5f2ef3c4.bb4bfc"],[]]},{"id":"28873515.96334a","type":"api-current-state","z":"af5d981f.ba5798","name":"Washing Halt On","server":"52fcfb7c.fc8c24","version":"1","outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.washingmachine","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":330,"y":360,"wires":[[],["b64c2460.023bb8"]]},{"id":"6ed1743.3fdfe8c","type":"change","z":"af5d981f.ba5798","name":"Reset Counter","rules":[{"t":"set","p":"reset","pt":"msg","to":"0","tot":"str"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":240,"wires":[["2fbfa4c6.af336c"]]},{"id":"5d2b89a9.c26ec8","type":"change","z":"af5d981f.ba5798","name":"stop","rules":[{"t":"set","p":"payload","pt":"msg","to":"stop","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":200,"wires":[["5f2ef3c4.bb4bfc"]]},{"id":"72dc6e52.c2de2","type":"inject","z":"af5d981f.ba5798","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":200,"wires":[["5d2b89a9.c26ec8"]]},{"id":"1cd28398.aba36c","type":"mqtt-broker","z":"","name":"Mosquitto","broker":"192.168.1.27","port":"1883","tls":"","clientid":"NodeRed","usetls":false,"compatmode":false,"keepalive":"300","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"/unxpected_disconnect","willQos":"0","willPayload":""},{"id":"52fcfb7c.fc8c24","type":"server","z":"","name":"Home Assistant","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement