[{"id":"8553d42c.9c72f8","type":"server-state-changed","z":"a533205c.6d71f","name":"Hotwater Heater","server":"f65d7dca.9fa39","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.voltage","entityidfiltertype":"exact","outputinitially":false,"state_type":"num","haltifstate":".1","halt_if_type":"num","halt_if_compare":"gt","outputs":2,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":100,"y":140,"wires":[["9ab76594.503838"],[]]},{"id":"a1afd68a.2386e8","type":"api-call-service","z":"a533205c.6d71f","name":"","server":"f65d7dca.9fa39","version":1,"debugenabled":false,"service_domain":"input_boolean","service":"turn_on","entityId":"input_boolean.waterheateron","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1000,"y":120,"wires":[[]]},{"id":"981b2f5f.12132","type":"mytimeout","z":"a533205c.6d71f","name":"Timer","outtopic":"","outsafe":"","outwarning":"","outunsafe":"on","warning":"0","timer":"30","debug":false,"ndebug":false,"ignoreCase":false,"repeat":false,"again":false,"x":830,"y":260,"wires":[["8762a2.069e3d6"],[]]},{"id":"8762a2.069e3d6","type":"api-call-service","z":"a533205c.6d71f","name":"","server":"f65d7dca.9fa39","version":1,"debugenabled":false,"service_domain":"input_boolean","service":"turn_off","entityId":"input_boolean.waterheateron","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1000,"y":320,"wires":[[]]},{"id":"e9f08f87.9a58","type":"switch","z":"a533205c.6d71f","name":"","property":"payload","propertyType":"msg","rules":[{"t":"btwn","v":".001","vt":"num","v2":".099","v2t":"num"},{"t":"btwn","v":".1","vt":"num","v2":".14","v2t":"num"},{"t":"btwn","v":".141","vt":"num","v2":"1","v2t":"num"}],"checkall":"true","repair":false,"outputs":3,"x":510,"y":140,"wires":[["4f4f3513.55eabc"],["e26013ef.b17ef","68596569.990dfc"],["4f4f3513.55eabc"]]},{"id":"e26013ef.b17ef","type":"change","z":"a533205c.6d71f","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":140,"wires":[["981b2f5f.12132","a1afd68a.2386e8"]]},{"id":"20a66941.79cd36","type":"inject","z":"a533205c.6d71f","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0.13","payloadType":"str","x":100,"y":60,"wires":[["9ab76594.503838"]]},{"id":"9ab76594.503838","type":"change","z":"a533205c.6d71f","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$number(payload)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":140,"wires":[["e9f08f87.9a58"]]},{"id":"68596569.990dfc","type":"change","z":"a533205c.6d71f","name":"Start","rules":[{"t":"set","p":"payload","pt":"msg","to":"run","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":470,"y":340,"wires":[["130e73c2.fce6bc"]]},{"id":"4f4f3513.55eabc","type":"change","z":"a533205c.6d71f","name":"Stop","rules":[{"t":"set","p":"payload","pt":"msg","to":"stop","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":499,"y":292,"wires":[["130e73c2.fce6bc"]]},{"id":"ac33ed6a.20fa3","type":"api-call-service","z":"a533205c.6d71f","name":"Time On","server":"f65d7dca.9fa39","version":1,"debugenabled":false,"service_domain":"input_number","service":"set_value","entityId":"input_number.whontime","data":"{\"value\" : \"{{payload}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":900,"y":480,"wires":[[]]},{"id":"12d6d8a0.cc78d7","type":"inject","z":"a533205c.6d71f","name":"Run","props":[{"p":"payload","v":"run","vt":"str"},{"p":"topic","v":"","vt":"string"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"run","payloadType":"str","x":170,"y":500,"wires":[["130e73c2.fce6bc"]]},{"id":"2300e9a9.76fec6","type":"inject","z":"a533205c.6d71f","name":"Stop","props":[{"p":"payload","v":"stop","vt":"str"},{"p":"topic","v":"","vt":"string"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"stop","payloadType":"str","x":170,"y":560,"wires":[["130e73c2.fce6bc"]]},{"id":"d10919c1.ed5708","type":"inject","z":"a533205c.6d71f","name":"Reset","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"59 23 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"reset","payloadType":"str","x":180,"y":400,"wires":[["130e73c2.fce6bc"]]},{"id":"130e73c2.fce6bc","type":"function","z":"a533205c.6d71f","name":"","func":"if (msg.payload == \"reset\") {\n flow.set(\"counter\",0);\n}\n\nflow.set(\"status\",msg.payload);","outputs":0,"noerr":0,"x":500,"y":500,"wires":[]},{"id":"a5ec0ed0.301f8","type":"inject","z":"a533205c.6d71f","name":"","props":[{"p":"payload","v":"1","vt":"num"},{"p":"topic","v":"","vt":"string"}],"repeat":"1","crontab":"","once":true,"onceDelay":"0.5","topic":"","payload":"1","payloadType":"num","x":170,"y":660,"wires":[["6ebacdb1.431cf4"]]},{"id":"6ebacdb1.431cf4","type":"function","z":"a533205c.6d71f","name":"","func":"var status = flow.get(\"status\") || \"stop\";\nvar count = flow.get(\"counter\") || 0;\n\nif (status == \"run\"){\n count = count + 1;\n}\n\nflow.set(\"counter\",count);\nmsg.payload = count;\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":370,"y":660,"wires":[["b6e1a25e.eec7c"]]},{"id":"b6e1a25e.eec7c","type":"calculator","z":"a533205c.6d71f","name":"/60","inputMsgField":"payload","outputMsgField":"payload","operation":"div","constant":"60","round":true,"decimals":"6","x":610,"y":600,"wires":[["1aca852e.dc496b"]]},{"id":"1aca852e.dc496b","type":"calculator","z":"a533205c.6d71f","name":"/60","inputMsgField":"payload","outputMsgField":"payload","operation":"div","constant":"60","round":true,"decimals":"3","x":770,"y":560,"wires":[["ac33ed6a.20fa3"]]},{"id":"f65d7dca.9fa39","type":"server","name":"Home Assistant","addon":true}]