[{"id":"e01cd0e3.b9bbf8","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"b10f794c.605748","type":"ui_slider","z":"e01cd0e3.b9bbf8","name":"Heater value 0..100%","label":"Heater value 0..100%","tooltip":"","group":"56943ca1.7f3dac","order":3,"width":"0","height":"0","passthru":true,"outs":"end","topic":"","min":0,"max":"100","step":"10","x":200,"y":220,"wires":[["1a41cd67.05e083","984e3223.cebca","c74b96a1.5c1508"]]},{"id":"34af1dda.e384aa","type":"function","z":"e01cd0e3.b9bbf8","name":"global get heater true/false","func":"var obtaindata = global.get (\"heater\")\nif (obtaindata == \"1\"){msg.payload = 0}\nif (obtaindata == \"0\"){msg.payload = 1}\nreturn msg;","outputs":1,"noerr":0,"x":200,"y":140,"wires":[["efbb72d.db7429","b10f794c.605748"]]},{"id":"efbb72d.db7429","type":"debug","z":"e01cd0e3.b9bbf8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":790,"y":140,"wires":[]},{"id":"e72b9557.cb72f","type":"inject","z":"e01cd0e3.b9bbf8","name":"","topic":"","payload":"1","payloadType":"num","repeat":"1","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":400,"wires":[["924d9ae7.df8368"]]},{"id":"e7d294f5.f73048","type":"debug","z":"e01cd0e3.b9bbf8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":830,"y":460,"wires":[]},{"id":"27d97eeb.5ee842","type":"delay","z":"e01cd0e3.b9bbf8","name":"delay","pauseType":"delayv","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":530,"y":400,"wires":[["b8513d7c.f45898"]]},{"id":"b8513d7c.f45898","type":"change","z":"e01cd0e3.b9bbf8","name":"off (0)","rules":[{"t":"set","p":"payload","pt":"msg","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":670,"y":400,"wires":[["e7d294f5.f73048","fb09be08.a2fd18"]]},{"id":"924d9ae7.df8368","type":"change","z":"e01cd0e3.b9bbf8","name":"get delay","rules":[{"t":"set","p":"delay","pt":"msg","to":"delay","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":400,"wires":[["27d97eeb.5ee842","38472853.2a9de8"]]},{"id":"12742810.7fc79","type":"change","z":"e01cd0e3.b9bbf8","name":"set delay","rules":[{"t":"set","p":"delay","pt":"flow","to":"payload*2000","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":300,"wires":[[]]},{"id":"38472853.2a9de8","type":"debug","z":"e01cd0e3.b9bbf8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":550,"y":460,"wires":[]},{"id":"1a41cd67.05e083","type":"function","z":"e01cd0e3.b9bbf8","name":"gloabl.get (heater) =1 / msg.payload=0","func":"var obtaindata = global.get (\"heater\")\nif (obtaindata === 1){return msg}\nif (obtaindata === 0){msg.payload = 0}\nreturn msg;","outputs":1,"noerr":0,"x":230,"y":300,"wires":[["12742810.7fc79","924d9ae7.df8368"]]},{"id":"65adc14f.5a1a2","type":"ui_switch","z":"e01cd0e3.b9bbf8","name":"ON/OFF","label":"ON/OFF","tooltip":"","group":"56943ca1.7f3dac","order":2,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":220,"y":60,"wires":[["34af1dda.e384aa"]]},{"id":"fb09be08.a2fd18","type":"modbus-write","z":"e01cd0e3.b9bbf8","name":"ModbusTCP Write DO_03 (Q3)","showStatusActivities":true,"showErrors":false,"unitid":"1","dataType":"HoldingRegister","adr":"3","quantity":"1","server":"2312041.d3ca1fc","x":890,"y":400,"wires":[[],[]]},{"id":"984e3223.cebca","type":"debug","z":"e01cd0e3.b9bbf8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":430,"y":200,"wires":[]},{"id":"c74b96a1.5c1508","type":"ui_gauge","z":"e01cd0e3.b9bbf8","name":"heater gauge","group":"56943ca1.7f3dac","order":1,"width":0,"height":0,"gtype":"gage","title":"power","label":"% power","format":"{{value}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":790,"y":220,"wires":[]},{"id":"e5aabfe3.b406b8","type":"comment","z":"e01cd0e3.b9bbf8","name":"Conditions of get delay","info":"get delay has to function, if global.heater=1 (is on)","x":340,"y":440,"wires":[]},{"id":"b6e2bf5c.975838","type":"comment","z":"e01cd0e3.b9bbf8","name":"Conditions of get delay","info":"set delay is active, if global.heater=1 (is on)\nand heater value is > 0;","x":520,"y":280,"wires":[]},{"id":"aaba54a0.ae42a","type":"comment","z":"e01cd0e3.b9bbf8","name":"Error on inject:","info":"If the inject is setting with interval of x secondes,\nthe flow send allways the 0 and 1 as message, regardless\nof whether the main switch is set to on or off","x":140,"y":440,"wires":[]},{"id":"56943ca1.7f3dac","type":"ui_group","z":"","name":"heater value","tab":"e8005803.ae17c8","order":1,"disp":false,"width":"8","collapse":false},{"id":"2312041.d3ca1fc","type":"modbus-client","z":"","name":"modbus-tcp@192.168.1.5","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"tcpHost":"192.168.1.5","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":"1","commandDelay":"1","clientTimeout":"1000","reconnectTimeout":"1000"},{"id":"e8005803.ae17c8","type":"ui_tab","z":"","name":"Heater ON/OFF 2","icon":"dashboard","order":32,"disabled":false,"hidden":false}]