itho ventilation control

The flow uses an itho wifi add-on (https://github.com/arjenhiemstra/ithowifi) to control an itho CVE-S ventilation unit. The flow monitors absolute humidity (shower) and presence (toilets) to increase ventilation flow. Ventilation is stopped during the night. When the indoor temperature is above 25°C and the outdoor temperature is cooler ventilation is increased (night cooling). Telegram messages are sent when: the ventilation is high for more than 45 minutes; when actual ventilation differs from setpoint (e.g. because of CO2 control in the itho unit). Many variables are published to a Domoticz client. Interaction with the itho add-on is through web API calls.
Node-RED version 3.1.0
20230321 Added some bug fixes
20231016 Many changes: Shelly Mqttt workaround, RF disable, moved Fritz sleeping room to other flow,

[{"id":"c12650984412069f","type":"tab","label":"itho api statemachine","disabled":false,"info":""},{"id":"508ce121339c83a1","type":"group","z":"c12650984412069f","name":"select speed","style":{"label":true},"nodes":["f6199881f9d56e97","4d1498fc61d3fc35","510e6f7932879a07","69af1c1e572865dd","84a3c4b14e003b87","4127729f703614c5","d62b76d817f8e0d3"],"x":364,"y":179,"w":832,"h":132},{"id":"86d56dfcedb3b472","type":"group","z":"c12650984412069f","name":"monitor speed change","style":{"label":true},"nodes":["80356fe925e9e564","76ec9d1b5be92afc","25c7d2398981f042","b9783d5974354f6c","fbbe8e88b47d79b8","fbde63351c87cf6e","80b7f9bedd8bec35","231ff9cb919fa201","b3f1c4de5012b6fc","f4b9212175e08afb"],"x":484,"y":1049,"w":1082,"h":142},{"id":"62d4d40cc94b4816","type":"group","z":"c12650984412069f","name":"night cooling","style":{"label":true},"nodes":["0bad47e83e4c2306","80adccee447ffcea","4dbca1290760f896","672407d4b4266bba","db0e4b745e0464a6","0b9ea83f628685cd","dff86be5c34f1fd2","6ba34035decb1bcc","12b7ce3735b242d2","601fc62a1479e2ad","ccc9387daa9798e9","4804938ab786038d","d129fcf27598a305","abae0f7861cbab93","8096dbd498f14c8d","90b6b5810d177ab3","2ca665c577a6b8e6","50a7977a449336c0","64ede0ef8d9642b5"],"x":274,"y":1329,"w":872,"h":302},{"id":"4ca02ea2ce93bc3c","type":"group","z":"c12650984412069f","name":"watchdog high speed (> 1300 rpm)","style":{"label":true},"nodes":["b4119ebbeaa85ca4","ddb2a0e877c7012c","7957f942669eea90","ab20747a9ed96493","7788a3ed84eb3269"],"x":484,"y":1209,"w":932,"h":122},{"id":"b0b8a4672afac9ba","type":"group","z":"c12650984412069f","name":"toilets","style":{"label":true},"nodes":["da693d8f9b2cbb7a","aef25af6f9379d3e","8c159c9cc1d8558e","1816a4fff982527c","3f3ec63075ecc39b","a1c7f34301339e87","e6272fc16248a128","33d0adef922c24aa","ae4379a2194affdf","c9059a8f7a78db41","a1f55f2d3aa8863a","18855b7befb40da9","961a4513e9e88d4a","edcf1789536d6090","8ca5b7e8a477dc83","7d65356c75e672f4","7322457fe7d34e14","b2154aabf71ee75f","34132d5ec5e2f764","2e6d4a37853938e5","0dbc0935c689f61d","e3622dec4da42c67","e9572912209eff89","dc361b3391ec6fd7"],"x":274,"y":2119,"w":1572,"h":292},{"id":"e6802439eed38acd","type":"group","z":"c12650984412069f","name":"shower","style":{"label":true},"nodes":["089b68e837cd2650","451a64b8c2d777b0","e4d5431e2cb50675","03bbaa7200d5374f","6e9d16d5264d955a","1f51962f906ae1f0","25b0ec1162e9a4d9","3d43cf9cc64301c9","be252f28a21f7d1b","e4070d8cfc1e08f5","9f03bc73c081fef0","725a7a2db3b6572f","3a18257577d2a496","1f0f97c761e1213b","85893b1075b005ea","1d61d8bff5f19d81","72d238f86fe5a449","17c363fa93c257f1","1554a4438bf9d70f","028b33566dbe25cc","60d9d34e8eb72d57","214cdbf235c65f0d","79997b24ee4ec057","70c2a1f4729bee47","cb3ce9cfc47b3db9","d6d7522ecf8d3924","5e44c3de120d2691","7793d16907a6aa0f","7ba8d1139cf651a6","94111d03cc6b1e9f","25e1160a37b5cf01"],"x":274,"y":1649,"w":1332,"h":449.5},{"id":"49a13161c344dff6","type":"group","z":"c12650984412069f","name":"manual cmds (remotes, web API)","style":{"label":true},"nodes":["5d4d2eb06ffee211","69b5cbaef462289f","ded07e79bc99e744","12d7a66ca7dee54d","525e2c4a695d0646","07d7e9b96f3488dd","198dfefe34979e84","96dc9c21697e541c","28d08d5ed0c4e8bb","0d4179ad111a9780","d9466a480782f717"],"x":274,"y":2619,"w":1282,"h":192},{"id":"f818056a1296bc10","type":"group","z":"c12650984412069f","name":"check manual cmd's","style":{"label":true},"nodes":["4bf8af4d2d590e83","3035b6099b5647d3","c61053377aa24f6b","c9571b702edecf0e","2edb7c405ee2086b","16d64463c6e97f9f","cddeee34d89a998d"],"x":1164,"y":799,"w":452,"h":192},{"id":"5b2d63fc0738c328","type":"group","z":"c12650984412069f","name":"reporting","style":{"label":true},"nodes":["96ef862cb52e50fc","798e2a0cc16a1b38","a07f4a0a32302de5","0dca8d08eaf570e9","9c0a782f967b2194","204e05191cca2662","b567d7c7afe38177"],"x":274,"y":2439,"w":1092,"h":152},{"id":"9ce84d808c9de582","type":"group","z":"c12650984412069f","name":"domoticz data (see separate tab for additional temperatures)","style":{"label":true},"nodes":["db05f320b5fac6de","791532cb172262d6","0538bae7764fe0db","fbfc3607653cdf9f","24953caf4921699c","77ce647e31872d0f","543e5bd7b3792c4f","3f46e8216d2dd45a","087c98c1c042d113"],"x":364,"y":379,"w":992,"h":292},{"id":"b874aa69348cd6b1","type":"group","z":"c12650984412069f","name":"MQTT output","style":{"label":true},"nodes":["cb3f6302cd039851","9eadc12383c17251","12030fbef532f87d","a35ff5a936879220","7d10d181ca2b8439","91364ab3dd3c08cd","1cd2a27cba25b6ad"],"x":484,"y":799,"w":632,"h":232},{"id":"39735c9250feda9f","type":"group","z":"c12650984412069f","name":"day/night timer","style":{"label":true},"nodes":["a099530f5725d8ee","5175351671101856","775c28816bd8c100","4ec79cfeda29804f","97ab30e5d55e83cf","6ebd6d082fbc50aa","51edd3fdacea166a","7ec721e5203ed558","297e923dba375f50","43553d334adf115b","82e9f8c9d1a69429","c763f71221e012bf","3e7c641c2f7696ae","035baf32a009d3cc","ee3eb7841bcaa67f","227a5b8c279fa4fc","348b85e224a89802","c7dde5b95b9c987d","cb9d7ee29c249b2c","16a4f54961a8d14c","18ec1e8193702060","d289b6ba9cd2b430","495469f3efa8c006","5fe2eda405bb77e3","9cdafc59a973faa3","ac2c3b7a928b6004","95ca0ba6d98a1b65","adaf39baeada3b54","c7466f7fabea107d","113f90e7bc2e740e","28eb8972a430f684","c38c11b4face0655","df87a6dd26e22c70","70ada8191884d072","91300afe8b00edad","8e1b6bd094016d59","ece5e0f8643951f7","5e7f31f8f8a6766b","e2b952c0c8492ff5","9bda6cb7d1a04860","5ec8b88711be3c95","a449b775e9d7fa9d"],"x":274,"y":2839,"w":1462,"h":462},{"id":"3f46e8216d2dd45a","type":"junction","z":"c12650984412069f","g":"9ce84d808c9de582","x":390,"y":530,"wires":[["791532cb172262d6","0538bae7764fe0db","24953caf4921699c","fbfc3607653cdf9f","543e5bd7b3792c4f","db05f320b5fac6de"]]},{"id":"0d60a5dc4445231f","type":"junction","z":"c12650984412069f","x":280,"y":870,"wires":[["cb3f6302cd039851","9eadc12383c17251"]]},{"id":"7f7bf1e1971b0789","type":"junction","z":"c12650984412069f","x":150,"y":1500,"wires":[["089b68e837cd2650"]]},{"id":"4bf8af4d2d590e83","type":"junction","z":"c12650984412069f","g":"f818056a1296bc10","x":1190,"y":890,"wires":[["3035b6099b5647d3","c61053377aa24f6b","16d64463c6e97f9f"]]},{"id":"90b6b5810d177ab3","type":"junction","z":"c12650984412069f","g":"62d4d40cc94b4816","x":300,"y":1500,"wires":[["0bad47e83e4c2306","6ba34035decb1bcc"]]},{"id":"af3e7022d2c76021","type":"junction","z":"c12650984412069f","x":1110,"y":780,"wires":[["4bf8af4d2d590e83"]]},{"id":"7601387897e93736","type":"junction","z":"c12650984412069f","x":290,"y":780,"wires":[["af3e7022d2c76021"]]},{"id":"91300afe8b00edad","type":"junction","z":"c12650984412069f","g":"39735c9250feda9f","x":1510,"y":3100,"wires":[["70ada8191884d072","5e7f31f8f8a6766b"]]},{"id":"9bda6cb7d1a04860","type":"junction","z":"c12650984412069f","g":"39735c9250feda9f","x":610,"y":3080,"wires":[["5ec8b88711be3c95"]]},{"id":"b3731a1e4fa752b0","type":"http request","z":"c12650984412069f","name":"get ithostatus","method":"GET","ret":"obj","paytoqs":"ignore","url":"http://192.168.1.91/api.html?get=ithostatus","tls":"","persist":false,"proxy":"","authType":"","x":140,"y":530,"wires":[["7db806e73e4d8fe4","3f46e8216d2dd45a","0d60a5dc4445231f","7f7bf1e1971b0789","7601387897e93736"]]},{"id":"089b68e837cd2650","type":"change","z":"c12650984412069f","g":"e6802439eed38acd","name":"get ppmw","rules":[{"t":"set","p":"payload","pt":"msg","to":"$round(payload.ppmw,0)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":1690,"wires":[["1f0f97c761e1213b"]]},{"id":"7ee9fe02239b2e3e","type":"inject","z":"c12650984412069f","name":"Every 5 sec","props":[],"repeat":"5","crontab":"","once":true,"onceDelay":0.1,"topic":"","x":110,"y":270,"wires":[["b3731a1e4fa752b0","d3430a3b4201044d","69af1c1e572865dd","ade26bac382964f4","790fb3851eeb78b5"]]},{"id":"d3430a3b4201044d","type":"http request","z":"c12650984412069f","name":"get currentspeed","method":"GET","ret":"obj","paytoqs":"ignore","url":"http://192.168.1.91/api.html?get=currentspeed","tls":"","persist":false,"proxy":"","authType":"","x":460,"y":140,"wires":[["ee31e9c689db8411","a59d1d59c96543ed"]]},{"id":"1c2f0feb90f262d1","type":"mqtt out","z":"c12650984412069f","name":"itho/currentspeed","topic":"itho/currentspeed","qos":"1","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"b4eed736.102278","x":1030,"y":140,"wires":[]},{"id":"451a64b8c2d777b0","type":"mqtt out","z":"c12650984412069f","g":"e6802439eed38acd","name":"itho/humidity","topic":"itho/humidity","qos":"1","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"b4eed736.102278","x":1220,"y":1690,"wires":[]},{"id":"80356fe925e9e564","type":"function","z":"c12650984412069f","g":"86d56dfcedb3b472","name":"FanSetp -> currentspeed2","func":"// calculate setting from rpm\n// setTimeout(function() {\nif (msg.payload != 0)\n{\n    msg.payload =Math.round(msg.payload*0.1132-49.957);\n}\n// }, 5000);\n// msg.payload =Math.round(msg.payload*0.1132-49.957);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":620,"y":1090,"wires":[["1cd2a27cba25b6ad","80b7f9bedd8bec35"]]},{"id":"12030fbef532f87d","type":"function","z":"c12650984412069f","g":"b874aa69348cd6b1","name":"FanSpeed -> m3/h","func":"if (msg.payload != 0)\n{\n    if (msg.payload <= 580)\n    {\n        msg.payload =25;\n    }\n    else\n    {\n        msg.payload =Math.round(msg.payload*0.1271-33.764);\n    }\n}\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":600,"y":940,"wires":[["91364ab3dd3c08cd"]]},{"id":"91364ab3dd3c08cd","type":"mqtt out","z":"c12650984412069f","g":"b874aa69348cd6b1","name":"itho/flow m³/h","topic":"itho/flow","qos":"1","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"b4eed736.102278","x":980,"y":940,"wires":[]},{"id":"9eadc12383c17251","type":"change","z":"c12650984412069f","g":"b874aa69348cd6b1","name":"get CO2 ppm","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload[\"CO2level (ppm)\"]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":890,"wires":[["7d10d181ca2b8439"]]},{"id":"7d10d181ca2b8439","type":"mqtt out","z":"c12650984412069f","g":"b874aa69348cd6b1","name":"itho/co2","topic":"itho/co2","qos":"1","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"b4eed736.102278","x":970,"y":890,"wires":[]},{"id":"e4d5431e2cb50675","type":"stoptimer-varidelay","z":"c12650984412069f","g":"e6802439eed38acd","duration":"40","durationType":"num","units":"Minute","payloadtype":"num","payloadval":"0","name":"40 minutes","reporting":"last_minute_seconds","persist":true,"ignoretimerpass":false,"x":1020,"y":1950,"wires":[["17c363fa93c257f1"],[],[]]},{"id":"03bbaa7200d5374f","type":"change","z":"c12650984412069f","g":"e6802439eed38acd","name":"set high, reset low","rules":[{"t":"set","p":"high","pt":"global","to":"true","tot":"bool"},{"t":"set","p":"low","pt":"global","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1200,"y":1860,"wires":[["e4d5431e2cb50675","6e9d16d5264d955a"]]},{"id":"6e9d16d5264d955a","type":"change","z":"c12650984412069f","g":"e6802439eed38acd","name":"itho 220","rules":[{"t":"set","p":"speedShower","pt":"global","to":"220","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1520,"y":1820,"wires":[[]]},{"id":"d36bd8258f84db7d","type":"config","z":"c12650984412069f","name":"set variables at start","properties":[{"p":"high","pt":"global","to":"false","tot":"bool"},{"p":"currentspeed","pt":"global","to":"15","tot":"num"},{"p":"low","pt":"global","to":"true","tot":"bool"},{"p":"hum","pt":"global","to":"false","tot":"bool"},{"p":"speedchange","pt":"global","to":"false","tot":"bool"},{"p":"presentup","pt":"global","to":"false","tot":"bool"},{"p":"speedTarget","pt":"global","to":"15","tot":"num"},{"p":"speedDayNight","pt":"global","to":"15","tot":"num"},{"p":"speedNightCooling","pt":"global","to":"0","tot":"num"},{"p":"speedShower","pt":"global","to":"0","tot":"num"},{"p":"speedWCup","pt":"global","to":"0","tot":"num"},{"p":"speedWCdown","pt":"global","to":"0","tot":"num"},{"p":"presentdown","pt":"global","to":"false","tot":"bool"},{"p":"enablecooling","pt":"global","to":"true","tot":"bool"},{"p":"coolingmsg","pt":"global","to":"false","tot":"bool"},{"p":"notcoolingmsg","pt":"global","to":"true","tot":"bool"},{"p":"speedCmd","pt":"global","to":"15","tot":"num"},{"p":"day","pt":"global","to":"on","tot":"str"},{"p":"ppmw","pt":"global","to":"7000","tot":"num"},{"p":"cooling","pt":"global","to":"false","tot":"bool"},{"p":"power","pt":"global","to":"true","tot":"bool"}],"active":true,"x":150,"y":50,"wires":[]},{"id":"1f51962f906ae1f0","type":"change","z":"c12650984412069f","g":"e6802439eed38acd","name":"STOP","rules":[{"t":"set","p":"payload","pt":"msg","to":"STOP","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":1960,"wires":[["e4d5431e2cb50675"]]},{"id":"ade26bac382964f4","type":"moment","z":"c12650984412069f","name":"format date variable","topic":"","input":"","inputType":"date","inTz":"Europe/Amsterdam","adjAmount":0,"adjType":"days","adjDir":"add","format":"YYYY-MM-DD HH:mm:ss","locale":"nl-NL@euro","output":"date","outputType":"global","outTz":"Europe/Amsterdam","x":470,"y":90,"wires":[[]]},{"id":"25b0ec1162e9a4d9","type":"switch","z":"c12650984412069f","g":"e6802439eed38acd","name":"Δ > 1000?","property":"$globalContext(\"ppmw\")-1000","propertyType":"jsonata","rules":[{"t":"gt","v":"payload.min","vt":"msg"}],"checkall":"true","repair":false,"outputs":1,"x":980,"y":1860,"wires":[["03bbaa7200d5374f"]]},{"id":"3d43cf9cc64301c9","type":"switch","z":"c12650984412069f","g":"e6802439eed38acd","name":"Δ < -700?","property":"$globalContext(\"ppmw\")+700","propertyType":"jsonata","rules":[{"t":"lt","v":"payload.max","vt":"msg"}],"checkall":"true","repair":false,"outputs":1,"x":1020,"y":2050,"wires":[["1f51962f906ae1f0","72d238f86fe5a449"]]},{"id":"be252f28a21f7d1b","type":"smooth","z":"c12650984412069f","g":"e6802439eed38acd","name":"max 10 min","property":"payload.max","action":"max","count":"120","round":"","mult":"single","reduce":false,"x":590,"y":2040,"wires":[["9f03bc73c081fef0"]]},{"id":"e4070d8cfc1e08f5","type":"smooth","z":"c12650984412069f","g":"e6802439eed38acd","name":"min 8min","property":"payload.min","action":"min","count":"96","round":"","mult":"single","reduce":false,"x":650,"y":1840,"wires":[["3a18257577d2a496"]]},{"id":"9f03bc73c081fef0","type":"switch","z":"c12650984412069f","g":"e6802439eed38acd","name":"if high","property":"high","propertyType":"global","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":730,"y":2040,"wires":[["725a7a2db3b6572f"]]},{"id":"725a7a2db3b6572f","type":"switch","z":"c12650984412069f","g":"e6802439eed38acd","name":"changed?","property":"currentspeed","propertyType":"global","rules":[{"t":"neq","v":"220","vt":"num"},{"t":"eq","v":"220","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":860,"y":2040,"wires":[["1554a4438bf9d70f"],["3d43cf9cc64301c9"]]},{"id":"3a18257577d2a496","type":"switch","z":"c12650984412069f","g":"e6802439eed38acd","name":"if low","property":"low","propertyType":"global","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":790,"y":1840,"wires":[["25b0ec1162e9a4d9","1d61d8bff5f19d81"]]},{"id":"1f0f97c761e1213b","type":"smooth","z":"c12650984412069f","g":"e6802439eed38acd","name":"avg 3","property":"payload","action":"mean","count":"3","round":"0","mult":"multi","reduce":false,"x":530,"y":1690,"wires":[["451a64b8c2d777b0","7ba8d1139cf651a6"]]},{"id":"85893b1075b005ea","type":"stoptimer-varidelay","z":"c12650984412069f","g":"e6802439eed38acd","duration":"15","durationType":"num","units":"Minute","payloadtype":"num","payloadval":"0","name":"15 minutes","reporting":"last_minute_seconds","persist":false,"ignoretimerpass":false,"x":1340,"y":2050,"wires":[["028b33566dbe25cc"],[],[]]},{"id":"1d61d8bff5f19d81","type":"switch","z":"c12650984412069f","g":"e6802439eed38acd","name":"ppmw >15000?","property":"payload.ppmw","propertyType":"msg","rules":[{"t":"gt","v":"15000","vt":"num"}],"checkall":"true","repair":true,"outputs":1,"x":1000,"y":1820,"wires":[["60d9d34e8eb72d57"]]},{"id":"72d238f86fe5a449","type":"change","z":"c12650984412069f","g":"e6802439eed38acd","name":"reset high","rules":[{"t":"set","p":"high","pt":"global","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1190,"y":2050,"wires":[["85893b1075b005ea"]]},{"id":"17c363fa93c257f1","type":"change","z":"c12650984412069f","g":"e6802439eed38acd","name":"reset high, set low","rules":[{"t":"set","p":"high","pt":"global","to":"false","tot":"bool"},{"t":"set","p":"low","pt":"global","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1230,"y":1920,"wires":[["cb3ce9cfc47b3db9"]]},{"id":"1554a4438bf9d70f","type":"change","z":"c12650984412069f","g":"e6802439eed38acd","name":"reset high, set low","rules":[{"t":"set","p":"high","pt":"global","to":"false","tot":"bool"},{"t":"set","p":"low","pt":"global","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":1960,"wires":[["1f51962f906ae1f0"]]},{"id":"028b33566dbe25cc","type":"change","z":"c12650984412069f","g":"e6802439eed38acd","name":"set low","rules":[{"t":"set","p":"low","pt":"global","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1490,"y":1970,"wires":[["cb3ce9cfc47b3db9"]]},{"id":"60d9d34e8eb72d57","type":"change","z":"c12650984412069f","g":"e6802439eed38acd","name":"set hum, reset low","rules":[{"t":"set","p":"hum","pt":"global","to":"true","tot":"bool"},{"t":"set","p":"low","pt":"global","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1200,"y":1820,"wires":[["6e9d16d5264d955a"]]},{"id":"214cdbf235c65f0d","type":"switch","z":"c12650984412069f","g":"e6802439eed38acd","name":"ppmw <14500","property":"payload.ppmw","propertyType":"msg","rules":[{"t":"lt","v":"14500","vt":"num"}],"checkall":"true","repair":true,"outputs":1,"x":1000,"y":1780,"wires":[["79997b24ee4ec057"]]},{"id":"79997b24ee4ec057","type":"change","z":"c12650984412069f","g":"e6802439eed38acd","name":"reset hum, set low","rules":[{"t":"set","p":"hum","pt":"global","to":"false","tot":"bool"},{"t":"set","p":"low","pt":"global","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1200,"y":1780,"wires":[["cb3ce9cfc47b3db9"]]},{"id":"70c2a1f4729bee47","type":"switch","z":"c12650984412069f","g":"e6802439eed38acd","name":"if hum","property":"hum","propertyType":"global","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":640,"y":1780,"wires":[["214cdbf235c65f0d"]]},{"id":"ee31e9c689db8411","type":"change","z":"c12650984412069f","name":"save currentspeed","rules":[{"t":"set","p":"currentspeed","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":140,"wires":[["1c2f0feb90f262d1"]]},{"id":"db05f320b5fac6de","type":"change","z":"c12650984412069f","g":"9ce84d808c9de582","name":"make idx=1 currentspeed","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"command\":\"switchlight\",\"idx\":1,\"nvalue\":1,\"switchcmd\":\"Set Level\",\"level\":\"24\"}","tot":"json"},{"t":"set","p":"payload.level","pt":"msg","to":"currentspeed","tot":"global"},{"t":"set","p":"payload.level","pt":"msg","to":"$round(payload.level/2.56)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":420,"wires":[["087c98c1c042d113"]]},{"id":"791532cb172262d6","type":"function","z":"c12650984412069f","g":"9ce84d808c9de582","name":"make idx=93 temp,hum","func":"temp = msg.payload.temp;\nhum = msg.payload.hum;\nmsg.payload = {\"svalue\":temp+\";\"+hum+\";1\",\"nvalue\":0,\"idx\":93}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":820,"y":470,"wires":[["087c98c1c042d113"]]},{"id":"087c98c1c042d113","type":"mqtt out","z":"c12650984412069f","g":"9ce84d808c9de582","name":"domoticz/in","topic":"domoticz/in","qos":"1","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"b4eed736.102278","x":1260,"y":480,"wires":[]},{"id":"cb3ce9cfc47b3db9","type":"change","z":"c12650984412069f","g":"e6802439eed38acd","name":"itho low","rules":[{"t":"set","p":"speedShower","pt":"global","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1520,"y":1870,"wires":[[]]},{"id":"0538bae7764fe0db","type":"function","z":"c12650984412069f","g":"9ce84d808c9de582","name":"make idx=96 ppmw","func":"ppmw=Math.round(msg.payload.ppmw);\nppmw=ppmw.toString();\nmsg.payload={\"idx\":96,\"nvalue\":0,\"svalue\": ppmw}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":800,"y":510,"wires":[["087c98c1c042d113"]]},{"id":"1cd2a27cba25b6ad","type":"mqtt out","z":"c12650984412069f","g":"b874aa69348cd6b1","name":"itho/currentspeed2","topic":"itho/currentspeed2","qos":"1","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"b4eed736.102278","x":1000,"y":990,"wires":[]},{"id":"d6d7522ecf8d3924","type":"function","z":"c12650984412069f","g":"e6802439eed38acd","name":"set min, max","func":"ppmw=msg.payload;\nmsg.payload={ppmw:ppmw, max: ppmw,min:ppmw};\n//msg.payload.min=ppmw;\n//msg.payload.max=ppmw;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":400,"y":1870,"wires":[["be252f28a21f7d1b","e4070d8cfc1e08f5","70c2a1f4729bee47"]]},{"id":"fbfc3607653cdf9f","type":"function","z":"c12650984412069f","g":"9ce84d808c9de582","name":"make idx=97 co2","func":"co2=Math.round(msg.payload[\"CO2level (ppm)\"]);\n// co2=Math.round(msg.payload.co2);\n// co2=msg.payload;\nco2=co2.toString();\nmsg.payload={\"idx\":97,\"nvalue\":0,\"svalue\": co2}\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":800,"y":630,"wires":[["77ce647e31872d0f"]]},{"id":"24953caf4921699c","type":"function","z":"c12650984412069f","g":"9ce84d808c9de582","name":"make idx=98 FanSetp","func":"rpm=msg.payload[\"Fan setpoint (rpm)\"];\nrpm=rpm.toString();\nmsg.payload={\"idx\":98,\"nvalue\":0,\"svalue\": rpm};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":810,"y":550,"wires":[["087c98c1c042d113"]]},{"id":"0d453ad559e328ee","type":"telegrambot-payload","z":"c12650984412069f","name":"itho to telegram","bot":"1bbf6588b510402d","chatId":"716514617","sendMethod":"sendMessage","payload":"","x":1730,"y":1250,"wires":[[]]},{"id":"76ec9d1b5be92afc","type":"switch","z":"c12650984412069f","g":"86d56dfcedb3b472","name":"speed change?","property":"payload-20","propertyType":"jsonata","rules":[{"t":"gt","v":"currentspeed","vt":"global"},{"t":"lte","v":"currentspeed","vt":"global"}],"checkall":"true","repair":false,"outputs":2,"x":1120,"y":1110,"wires":[["fbbe8e88b47d79b8"],["fbde63351c87cf6e"]]},{"id":"25c7d2398981f042","type":"change","z":"c12650984412069f","g":"86d56dfcedb3b472","name":"reset change","rules":[{"t":"set","p":"speedchange","pt":"global","to":"false","tot":"bool"},{"t":"set","p":"payload","pt":"msg","to":"{\"text\":\"speed decrease\",\"parse_mode\":\"Markdown\"}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":1470,"y":1130,"wires":[["0d453ad559e328ee"]]},{"id":"b9783d5974354f6c","type":"change","z":"c12650984412069f","g":"86d56dfcedb3b472","name":"set change","rules":[{"t":"set","p":"speedchange","pt":"global","to":"true","tot":"bool"},{"t":"set","p":"payload","pt":"msg","to":"{\"text\":\"speed increase\",\"parse_mode\":\"Markdown\"}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":1470,"y":1090,"wires":[["0d453ad559e328ee"]]},{"id":"fbbe8e88b47d79b8","type":"switch","z":"c12650984412069f","g":"86d56dfcedb3b472","name":"change not set?","property":"speedchange","propertyType":"global","rules":[{"t":"false"}],"checkall":"true","repair":false,"outputs":1,"x":1300,"y":1090,"wires":[["b9783d5974354f6c"]]},{"id":"fbde63351c87cf6e","type":"switch","z":"c12650984412069f","g":"86d56dfcedb3b472","name":"change set?","property":"speedchange","propertyType":"global","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":1290,"y":1130,"wires":[["25c7d2398981f042"]]},{"id":"80b7f9bedd8bec35","type":"rbe","z":"c12650984412069f","g":"86d56dfcedb3b472","name":"","func":"deadbandEq","gap":"5","start":"","inout":"in","septopics":false,"property":"payload","topi":"topic","x":810,"y":1110,"wires":[["231ff9cb919fa201","f4b9212175e08afb"]]},{"id":"7957f942669eea90","type":"stoptimer-varidelay","z":"c12650984412069f","g":"4ca02ea2ce93bc3c","duration":"45","durationType":"num","units":"Minute","payloadtype":"num","payloadval":"0","name":"WDT 45 minutes","reporting":"every_second","persist":true,"ignoretimerpass":false,"x":970,"y":1260,"wires":[["ab20747a9ed96493"],[],[]]},{"id":"7788a3ed84eb3269","type":"change","z":"c12650984412069f","g":"4ca02ea2ce93bc3c","name":"send WDT","rules":[{"t":"set","p":"wdt","pt":"global","to":"true","tot":"bool"},{"t":"set","p":"payload","pt":"msg","to":"{\"text\":\"Not low for more than 45 minutes\",\"parse_mode\":\"Markdown\"}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":1320,"y":1250,"wires":[["0d453ad559e328ee"]]},{"id":"ab20747a9ed96493","type":"switch","z":"c12650984412069f","g":"4ca02ea2ce93bc3c","name":"WDT !sent?","property":"wdt","propertyType":"global","rules":[{"t":"false"}],"checkall":"true","repair":false,"outputs":1,"x":1160,"y":1250,"wires":[["7788a3ed84eb3269"]]},{"id":"b4119ebbeaa85ca4","type":"switch","z":"c12650984412069f","g":"4ca02ea2ce93bc3c","name":"speed < 1300 rpm?","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"1300","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":600,"y":1250,"wires":[["7957f942669eea90","ddb2a0e877c7012c"]]},{"id":"ddb2a0e877c7012c","type":"change","z":"c12650984412069f","g":"4ca02ea2ce93bc3c","name":"clr WDT sent","rules":[{"t":"set","p":"wdt","pt":"global","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":790,"y":1290,"wires":[[]]},{"id":"da693d8f9b2cbb7a","type":"stoptimer-varidelay","z":"c12650984412069f","g":"b0b8a4672afac9ba","duration":"3","durationType":"num","units":"Minute","payloadtype":"num","payloadval":"0","name":"3 minutes","reporting":"every_second","persist":true,"ignoretimerpass":false,"x":1380,"y":2210,"wires":[["e3622dec4da42c67"],[],[]]},{"id":"aef25af6f9379d3e","type":"change","z":"c12650984412069f","g":"b0b8a4672afac9ba","name":"itho 60","rules":[{"t":"set","p":"speedWCup","pt":"global","to":"60","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1750,"y":2160,"wires":[[]]},{"id":"8c159c9cc1d8558e","type":"switch","z":"c12650984412069f","g":"b0b8a4672afac9ba","name":"if !presentup","property":"presentup","propertyType":"global","rules":[{"t":"false"}],"checkall":"true","repair":false,"outputs":1,"x":1190,"y":2160,"wires":[["1816a4fff982527c"]]},{"id":"1816a4fff982527c","type":"change","z":"c12650984412069f","g":"b0b8a4672afac9ba","name":"set presentup","rules":[{"t":"set","p":"presentup","pt":"global","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1370,"y":2160,"wires":[["aef25af6f9379d3e"]]},{"id":"3f3ec63075ecc39b","type":"change","z":"c12650984412069f","g":"b0b8a4672afac9ba","name":"itho low","rules":[{"t":"set","p":"speedWCup","pt":"global","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1760,"y":2200,"wires":[[]]},{"id":"a1c7f34301339e87","type":"change","z":"c12650984412069f","g":"b0b8a4672afac9ba","name":"itho 220","rules":[{"t":"set","p":"speedWCup","pt":"global","to":"220","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1760,"y":2240,"wires":[[]]},{"id":"e6272fc16248a128","type":"switch","z":"c12650984412069f","g":"b0b8a4672afac9ba","name":"if presentup","property":"presentup","propertyType":"global","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":1190,"y":2240,"wires":[["a1c7f34301339e87","da693d8f9b2cbb7a"]]},{"id":"33d0adef922c24aa","type":"switch","z":"c12650984412069f","g":"b0b8a4672afac9ba","name":"shelly 1/0?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":1020,"y":2220,"wires":[["8c159c9cc1d8558e"],["e6272fc16248a128"]]},{"id":"77ce647e31872d0f","type":"rbe","z":"c12650984412069f","g":"9ce84d808c9de582","name":"changed?","func":"rbe","gap":"2","start":"","inout":"out","septopics":false,"property":"payload","topi":"topic","x":970,"y":630,"wires":[["087c98c1c042d113"]]},{"id":"0b9ea83f628685cd","type":"change","z":"c12650984412069f","g":"62d4d40cc94b4816","name":"send cooling","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"text\":\"Start nachtkoeling\",\"parse_mode\":\"Markdown\"}","tot":"json"},{"t":"set","p":"coolingmsg","pt":"global","to":"true","tot":"bool"},{"t":"set","p":"notcoolingmsg","pt":"global","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1010,"y":1470,"wires":[["0d453ad559e328ee"]]},{"id":"672407d4b4266bba","type":"change","z":"c12650984412069f","g":"62d4d40cc94b4816","name":"send not_cooling","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"text\":\"Stop nachtkoeling\",\"parse_mode\":\"Markdown\"}","tot":"json"},{"t":"set","p":"notcoolingmsg","pt":"global","to":"true","tot":"bool"},{"t":"set","p":"coolingmsg","pt":"global","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1030,"y":1590,"wires":[["0d453ad559e328ee"]]},{"id":"0bad47e83e4c2306","type":"function","z":"c12650984412069f","g":"62d4d40cc94b4816","name":"indoor 22-23, outdoor -2-0 ?","func":"indoortemp = global.get('indoortemp');\noutdoortemp = global.get('outdoortemp');\nithotemp=msg.payload.temp;\nmsg.payload=\"\";\nif (ithotemp> 26\n    && indoortemp > 22.5\n    && outdoortemp - indoortemp < -1.5) \n    {\n       global.set('cooling', true);\n       msg.payload = \"start\"\n    }\nif (ithotemp < 25\n    || indoortemp < 22.5\n    || outdoortemp - indoortemp > -0.5) \n    {\n       global.set('cooling', false);\n       global.set('enablecooling', true);\n       msg.payload = \"stop\"\n    }\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":460,"y":1490,"wires":[["64ede0ef8d9642b5"]]},{"id":"db0e4b745e0464a6","type":"change","z":"c12650984412069f","g":"62d4d40cc94b4816","name":"itho low","rules":[{"t":"set","p":"speedNightCooling","pt":"global","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1020,"y":1550,"wires":[[]]},{"id":"dff86be5c34f1fd2","type":"change","z":"c12650984412069f","g":"62d4d40cc94b4816","name":"itho 180","rules":[{"t":"set","p":"speedNightCooling","pt":"global","to":"180","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1020,"y":1510,"wires":[[]]},{"id":"5d4d2eb06ffee211","type":"rbe","z":"c12650984412069f","g":"49a13161c344dff6","name":"","func":"rbe","gap":"5","start":"","inout":"in","septopics":false,"property":"payload","topi":"topic","x":510,"y":2700,"wires":[["69b5cbaef462289f","96dc9c21697e541c","204e05191cca2662"]]},{"id":"231ff9cb919fa201","type":"delay","z":"c12650984412069f","g":"86d56dfcedb3b472","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":960,"y":1110,"wires":[["76ec9d1b5be92afc","b3f1c4de5012b6fc"]]},{"id":"b3f1c4de5012b6fc","type":"debug","z":"c12650984412069f","g":"86d56dfcedb3b472","name":"","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1130,"y":1150,"wires":[]},{"id":"5e44c3de120d2691","type":"inject","z":"c12650984412069f","g":"e6802439eed38acd","name":"stop","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":670,"y":1890,"wires":[["1f51962f906ae1f0","17c363fa93c257f1"]]},{"id":"543e5bd7b3792c4f","type":"function","z":"c12650984412069f","g":"9ce84d808c9de582","name":"make idx=114 FanSpeed","func":"rpm=msg.payload[\"Fan speed (rpm)\"];\nrpm=rpm.toString();\nmsg.payload={\"idx\":114,\"nvalue\":0,\"svalue\": rpm};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":820,"y":590,"wires":[["087c98c1c042d113"]]},{"id":"7db806e73e4d8fe4","type":"change","z":"c12650984412069f","name":"get FanSetp rpm","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload[\"Fan setpoint (rpm)\"]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":1090,"wires":[["80356fe925e9e564","12030fbef532f87d","b4119ebbeaa85ca4"]]},{"id":"ae4379a2194affdf","type":"stoptimer-varidelay","z":"c12650984412069f","g":"b0b8a4672afac9ba","duration":"3","durationType":"num","units":"Minute","payloadtype":"num","payloadval":"0","name":"3 minutes","reporting":"every_second","persist":true,"ignoretimerpass":false,"x":1380,"y":2340,"wires":[["e9572912209eff89"],[],[]]},{"id":"c9059a8f7a78db41","type":"switch","z":"c12650984412069f","g":"b0b8a4672afac9ba","name":"if !presentdown","property":"presentdown","propertyType":"global","rules":[{"t":"false"}],"checkall":"true","repair":false,"outputs":1,"x":1200,"y":2290,"wires":[["a1f55f2d3aa8863a"]]},{"id":"a1f55f2d3aa8863a","type":"change","z":"c12650984412069f","g":"b0b8a4672afac9ba","name":"set presentdown","rules":[{"t":"set","p":"presentdown","pt":"global","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1380,"y":2290,"wires":[["7d65356c75e672f4"]]},{"id":"798e2a0cc16a1b38","type":"function","z":"c12650984412069f","g":"5b2d63fc0738c328","name":"prepare shelly log","func":"\nvar date = global.get ('date');\nmsg.payload = date  + \" , shelly: \" + msg.topic + \" -> \" + msg.payload;\n return msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":840,"y":2480,"wires":[["9c0a782f967b2194","0dca8d08eaf570e9"]]},{"id":"9c0a782f967b2194","type":"file","z":"c12650984412069f","g":"5b2d63fc0738c328","name":"","filename":"data/hygrorateofchange.log","filenameType":"str","appendNewline":true,"createDir":true,"overwriteFile":"false","x":1220,"y":2530,"wires":[[]]},{"id":"96ef862cb52e50fc","type":"link in","z":"c12650984412069f","g":"5b2d63fc0738c328","name":"get speed","links":["0bcc60c9b708b908","efaf293ef5b61f9f","3cbce7ebb33b8e9f","510e6f7932879a07","ee3eb7841bcaa67f","ceacdd306f229ff0","5fe2eda405bb77e3"],"x":315,"y":2530,"wires":[["204e05191cca2662"]]},{"id":"18855b7befb40da9","type":"switch","z":"c12650984412069f","g":"b0b8a4672afac9ba","name":"if presentdown","property":"presentdown","propertyType":"global","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":1200,"y":2370,"wires":[["edcf1789536d6090","ae4379a2194affdf"]]},{"id":"961a4513e9e88d4a","type":"switch","z":"c12650984412069f","g":"b0b8a4672afac9ba","name":"shelly 1/0?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":1020,"y":2350,"wires":[["c9059a8f7a78db41"],["18855b7befb40da9"]]},{"id":"0dca8d08eaf570e9","type":"debug","z":"c12650984412069f","g":"5b2d63fc0738c328","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1110,"y":2480,"wires":[]},{"id":"a07f4a0a32302de5","type":"function","z":"c12650984412069f","g":"5b2d63fc0738c328","name":"prepare log","func":"var date = global.get ('date');\nmsg.payload = date  + \" , \" + msg.payload;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":820,"y":2530,"wires":[["9c0a782f967b2194"]]},{"id":"f6199881f9d56e97","type":"http request","z":"c12650984412069f","g":"508ce121339c83a1","name":"set speed","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://192.168.1.91/api.html?speed={{{payload}}}","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":1110,"y":240,"wires":[[]]},{"id":"4d1498fc61d3fc35","type":"debug","z":"c12650984412069f","g":"508ce121339c83a1","name":"","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":730,"y":220,"wires":[]},{"id":"510e6f7932879a07","type":"link out","z":"c12650984412069f","g":"508ce121339c83a1","name":"to reporting","mode":"link","links":["96ef862cb52e50fc","2a164dd309d64329"],"x":575,"y":220,"wires":[]},{"id":"69af1c1e572865dd","type":"function","z":"c12650984412069f","g":"508ce121339c83a1","name":"select speed","func":"var speedTarget = 0;\n\nvar speed = global.get ('speedShower');\nif (speed > speedTarget) speedTarget = speed;\n\nspeed = global.get ('speedWCup');\nif (speed > speedTarget) speedTarget = speed;    \n\nspeed = global.get ('speedWCdown');\nif (speed > speedTarget) speedTarget = speed;      \n\nspeed = global.get ('speedDayNight');\nif (speed > speedTarget) speedTarget = speed;    \n\nspeed = global.get ('speedNightCooling');\nif (speed > speedTarget) speedTarget = speed;  \n\nspeed = global.get ('speedCmd');\nif (speed > speedTarget) speedTarget = speed;  \n\nmsg.payload = speedTarget\nif ( speedTarget != global.get ('speedTarget')) \n{\n    global.set('speedTarget', speedTarget)\n    return [msg,null];\n}\nif ( global.get ('currentspeed') !=  global.get ('speedTarget')) return [msg,null];\n\nreturn[null,msg]","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[],"x":460,"y":250,"wires":[["f6199881f9d56e97","4d1498fc61d3fc35","510e6f7932879a07"],["d62b76d817f8e0d3"]]},{"id":"4dbca1290760f896","type":"telegram command","z":"c12650984412069f","g":"62d4d40cc94b4816","name":"/stopcooling","command":"/stopcooling","description":"","registercommand":false,"language":"","scope":"default","bot":"957ad4d124ca76b5","strict":false,"hasresponse":false,"useregex":false,"removeregexcommand":false,"outputs":1,"x":410,"y":1430,"wires":[["601fc62a1479e2ad","50a7977a449336c0"]]},{"id":"80adccee447ffcea","type":"telegram command","z":"c12650984412069f","g":"62d4d40cc94b4816","name":"/startcooling","command":"/startcooling","description":"","registercommand":false,"language":"","scope":"default","bot":"957ad4d124ca76b5","strict":false,"hasresponse":false,"useregex":false,"removeregexcommand":false,"outputs":1,"x":410,"y":1380,"wires":[["ccc9387daa9798e9","2ca665c577a6b8e6"]]},{"id":"a59d1d59c96543ed","type":"debug","z":"c12650984412069f","name":"","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":730,"y":90,"wires":[]},{"id":"edcf1789536d6090","type":"change","z":"c12650984412069f","g":"b0b8a4672afac9ba","name":"itho 220","rules":[{"t":"set","p":"speedWCdown","pt":"global","to":"220","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1760,"y":2370,"wires":[[]]},{"id":"8ca5b7e8a477dc83","type":"change","z":"c12650984412069f","g":"b0b8a4672afac9ba","name":"itho low","rules":[{"t":"set","p":"speedWCdown","pt":"global","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1760,"y":2330,"wires":[[]]},{"id":"7d65356c75e672f4","type":"change","z":"c12650984412069f","g":"b0b8a4672afac9ba","name":"itho 60","rules":[{"t":"set","p":"speedWCdown","pt":"global","to":"60","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1750,"y":2290,"wires":[[]]},{"id":"cb3f6302cd039851","type":"change","z":"c12650984412069f","g":"b874aa69348cd6b1","name":"get day/night","rules":[{"t":"set","p":"payload","pt":"msg","to":"day","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":840,"wires":[["a35ff5a936879220"]]},{"id":"a35ff5a936879220","type":"mqtt out","z":"c12650984412069f","g":"b874aa69348cd6b1","name":"itho/sleep","topic":"itho/sleep","qos":"1","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"b4eed736.102278","x":970,"y":840,"wires":[]},{"id":"7793d16907a6aa0f","type":"switch","z":"c12650984412069f","g":"e6802439eed38acd","name":"if speed not 0","property":"speedDayNight","propertyType":"global","rules":[{"t":"neq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":410,"y":1770,"wires":[["d6d7522ecf8d3924"]],"info":"check for speedN (day/night speed) not zero. When speed is zero ppmw values become unreliable"},{"id":"6ba34035decb1bcc","type":"switch","z":"c12650984412069f","g":"62d4d40cc94b4816","name":"enablecooling?","property":"enablecooling","propertyType":"global","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":420,"y":1580,"wires":[["12b7ce3735b242d2"],["db0e4b745e0464a6","abae0f7861cbab93"]]},{"id":"12b7ce3735b242d2","type":"switch","z":"c12650984412069f","g":"62d4d40cc94b4816","name":"cooling?","property":"cooling","propertyType":"global","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":620,"y":1540,"wires":[["dff86be5c34f1fd2","d129fcf27598a305"],["db0e4b745e0464a6","abae0f7861cbab93"]]},{"id":"601fc62a1479e2ad","type":"change","z":"c12650984412069f","g":"62d4d40cc94b4816","name":"reset enablecooling","rules":[{"t":"set","p":"enablecooling","pt":"global","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":1420,"wires":[["8096dbd498f14c8d"]]},{"id":"ccc9387daa9798e9","type":"change","z":"c12650984412069f","g":"62d4d40cc94b4816","name":"set enablecooling","rules":[{"t":"set","p":"enablecooling","pt":"global","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":1380,"wires":[["4804938ab786038d"]]},{"id":"4804938ab786038d","type":"change","z":"c12650984412069f","g":"62d4d40cc94b4816","name":"set cooling","rules":[{"t":"set","p":"cooling","pt":"global","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":1380,"wires":[[]]},{"id":"d129fcf27598a305","type":"switch","z":"c12650984412069f","g":"62d4d40cc94b4816","name":"cooling msg?","property":"coolingmsg","propertyType":"global","rules":[{"t":"false"}],"checkall":"true","repair":false,"outputs":1,"x":810,"y":1470,"wires":[["0b9ea83f628685cd"]]},{"id":"abae0f7861cbab93","type":"switch","z":"c12650984412069f","g":"62d4d40cc94b4816","name":"not_cooling msg?","property":"notcoolingmsg","propertyType":"global","rules":[{"t":"false"}],"checkall":"true","repair":false,"outputs":1,"x":830,"y":1590,"wires":[["672407d4b4266bba"]]},{"id":"8096dbd498f14c8d","type":"change","z":"c12650984412069f","g":"62d4d40cc94b4816","name":"reset cooling","rules":[{"t":"set","p":"cooling","pt":"global","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":1420,"wires":[[]]},{"id":"84a3c4b14e003b87","type":"inject","z":"c12650984412069f","g":"508ce121339c83a1","name":"set 180","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"180","payloadType":"num","x":900,"y":220,"wires":[["f6199881f9d56e97"]]},{"id":"4127729f703614c5","type":"inject","z":"c12650984412069f","g":"508ce121339c83a1","name":"set 15","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"15","payloadType":"num","x":900,"y":270,"wires":[["f6199881f9d56e97"]]},{"id":"69b5cbaef462289f","type":"switch","z":"c12650984412069f","g":"49a13161c344dff6","name":"select manual cmd's","property":"payload.source","propertyType":"msg","rules":[{"t":"eq","v":"remote0","vt":"str"},{"t":"eq","v":"web interface","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":700,"y":2700,"wires":[["ded07e79bc99e744"],["ded07e79bc99e744"]]},{"id":"ded07e79bc99e744","type":"function","z":"c12650984412069f","g":"49a13161c344dff6","name":"set speedCmd","func":"var txt=msg.payload.command\nif (txt.substr(0,5) == \"speed\")\n    {txt=txt.substr(6,3);\n    var speed = parseInt(txt);\n    global.set('speedCmd', speed);\n    global.set('speedTime', 0);\n    msg.payload = false;\n    return [msg, null]}\nif (txt.substr(0,5) == \"timer\")\n    {txt=txt.substr(6,3);\n    var time = 60*parseInt(txt);\n    global.set('speedTime', time);\n    msg.payload = time;\n    msg.topic=\"control\";\n    global.set('speedCmd', 180);\n    return [null, msg]}","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[],"x":910,"y":2700,"wires":[["12d7a66ca7dee54d","07d7e9b96f3488dd"],["28d08d5ed0c4e8bb","07d7e9b96f3488dd"]]},{"id":"12d7a66ca7dee54d","type":"debug","z":"c12650984412069f","g":"49a13161c344dff6","name":"speed","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1110,"y":2660,"wires":[]},{"id":"525e2c4a695d0646","type":"mqtt in","z":"c12650984412069f","g":"49a13161c344dff6","name":"","topic":"itho/lastcmd","qos":"1","datatype":"auto-detect","broker":"b4eed736.102278","nl":false,"rap":true,"rh":0,"inputs":0,"x":370,"y":2700,"wires":[["5d4d2eb06ffee211"]]},{"id":"7322457fe7d34e14","type":"mqtt in","z":"c12650984412069f","g":"b0b8a4672afac9ba","name":"shelly WC downstairs","topic":"shellies/shellyix3-98CDAC244220/input/0","qos":"0","datatype":"auto-detect","broker":"b4eed736.102278","nl":false,"rap":true,"rh":0,"inputs":0,"x":400,"y":2350,"wires":[["dc361b3391ec6fd7"]]},{"id":"b2154aabf71ee75f","type":"mqtt in","z":"c12650984412069f","g":"b0b8a4672afac9ba","name":"shelly WC upstairs","topic":"shellies/shellyix3-C45BBE5F78EB/input/0","qos":"0","datatype":"auto-detect","broker":"b4eed736.102278","nl":false,"rap":true,"rh":0,"inputs":0,"x":390,"y":2220,"wires":[["34132d5ec5e2f764"]]},{"id":"c9571b702edecf0e","type":"mqtt out","z":"c12650984412069f","g":"f818056a1296bc10","name":"speedtarget","topic":"itho/speedtarget","qos":"1","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"b4eed736.102278","x":1520,"y":840,"wires":[]},{"id":"2edb7c405ee2086b","type":"mqtt out","z":"c12650984412069f","g":"f818056a1296bc10","name":"speedcmd","topic":"itho/speedcmd","qos":"1","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"b4eed736.102278","x":1520,"y":900,"wires":[]},{"id":"3035b6099b5647d3","type":"change","z":"c12650984412069f","g":"f818056a1296bc10","name":"get speedTarget","rules":[{"t":"set","p":"payload","pt":"msg","to":"speedTarget","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":1320,"y":840,"wires":[["c9571b702edecf0e"]]},{"id":"c61053377aa24f6b","type":"change","z":"c12650984412069f","g":"f818056a1296bc10","name":"get speedCmd","rules":[{"t":"set","p":"payload","pt":"msg","to":"speedCmd","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":1320,"y":900,"wires":[["2edb7c405ee2086b"]]},{"id":"96dc9c21697e541c","type":"debug","z":"c12650984412069f","g":"49a13161c344dff6","name":"lastcmd","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":660,"y":2740,"wires":[]},{"id":"f4b9212175e08afb","type":"debug","z":"c12650984412069f","g":"86d56dfcedb3b472","name":"","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":950,"y":1150,"wires":[]},{"id":"28d08d5ed0c4e8bb","type":"debug","z":"c12650984412069f","g":"49a13161c344dff6","name":"timer","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1110,"y":2770,"wires":[]},{"id":"07d7e9b96f3488dd","type":"countdown","z":"c12650984412069f","g":"49a13161c344dff6","name":"timer1/2/3","topic":"","payloadTimerStart":"false","payloadTimerStartType":"bool","payloadTimerStop":"true","payloadTimerStopType":"bool","timer":"300","resetWhileRunning":false,"outputOnReset":false,"setTimeToNewWhileRunning":true,"startCountdownOnControlMessage":true,"x":1150,"y":2710,"wires":[["0d4179ad111a9780"],["d9466a480782f717"]]},{"id":"198dfefe34979e84","type":"change","z":"c12650984412069f","g":"49a13161c344dff6","name":"speedCmd 0","rules":[{"t":"set","p":"speedCmd","pt":"global","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1460,"y":2710,"wires":[[]]},{"id":"0d4179ad111a9780","type":"switch","z":"c12650984412069f","g":"49a13161c344dff6","name":"stopped/true","property":"payload","propertyType":"msg","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":1300,"y":2710,"wires":[["198dfefe34979e84"]]},{"id":"16d64463c6e97f9f","type":"change","z":"c12650984412069f","g":"f818056a1296bc10","name":"get speedTime","rules":[{"t":"set","p":"payload","pt":"msg","to":"speedTime","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":1320,"y":950,"wires":[["cddeee34d89a998d"]]},{"id":"d9466a480782f717","type":"change","z":"c12650984412069f","g":"49a13161c344dff6","name":"set speedTime","rules":[{"t":"set","p":"speedTime","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1310,"y":2760,"wires":[[]]},{"id":"cddeee34d89a998d","type":"mqtt out","z":"c12650984412069f","g":"f818056a1296bc10","name":"speedtime","topic":"itho/speedtime","qos":"1","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"b4eed736.102278","x":1520,"y":950,"wires":[]},{"id":"d62b76d817f8e0d3","type":"debug","z":"c12650984412069f","g":"508ce121339c83a1","name":"","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":730,"y":270,"wires":[]},{"id":"7ba8d1139cf651a6","type":"change","z":"c12650984412069f","g":"e6802439eed38acd","name":"save ppmw","rules":[{"t":"set","p":"ppmw","pt":"global","to":"payload","tot":"msg","dc":true}],"action":"","property":"","from":"","to":"","reg":false,"x":710,"y":1720,"wires":[["7793d16907a6aa0f","94111d03cc6b1e9f"]]},{"id":"25e1160a37b5cf01","type":"config","z":"c12650984412069f","g":"e6802439eed38acd","name":"global.ppmw","properties":[{"p":"ppmw","pt":"global","to":"5000","tot":"num"}],"active":true,"x":390,"y":2050,"wires":[]},{"id":"94111d03cc6b1e9f","type":"debug","z":"c12650984412069f","g":"e6802439eed38acd","name":"debug 1","active":false,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":910,"y":1720,"wires":[]},{"id":"a099530f5725d8ee","type":"switch","z":"c12650984412069f","g":"39735c9250feda9f","name":"on/off","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":910,"y":3120,"wires":[["775c28816bd8c100","82e9f8c9d1a69429"],["5175351671101856","c763f71221e012bf"]]},{"id":"5175351671101856","type":"change","z":"c12650984412069f","g":"39735c9250feda9f","name":"itho + speedCmd 0","rules":[{"t":"set","p":"speedDayNight","pt":"global","to":"0","tot":"num"},{"t":"set","p":"speedCmd","pt":"global","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1110,"y":3150,"wires":[[]]},{"id":"775c28816bd8c100","type":"change","z":"c12650984412069f","g":"39735c9250feda9f","name":"itho 15","rules":[{"t":"set","p":"speedDayNight","pt":"global","to":"15","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1070,"y":3070,"wires":[[]]},{"id":"4ec79cfeda29804f","type":"inject","z":"c12650984412069f","g":"39735c9250feda9f","name":"day (on)","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"on","payloadType":"str","x":400,"y":2880,"wires":[["9bda6cb7d1a04860"]]},{"id":"97ab30e5d55e83cf","type":"inject","z":"c12650984412069f","g":"39735c9250feda9f","name":"night (off)","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"off","payloadType":"str","x":400,"y":2920,"wires":[["9bda6cb7d1a04860"]]},{"id":"6ebd6d082fbc50aa","type":"telegram command","z":"c12650984412069f","g":"39735c9250feda9f","name":"telegram to itho","command":"/night","description":"","registercommand":false,"language":"","scope":"default","bot":"957ad4d124ca76b5","strict":false,"hasresponse":true,"useregex":false,"removeregexcommand":false,"outputs":2,"x":380,"y":3170,"wires":[["297e923dba375f50"],[]]},{"id":"51edd3fdacea166a","type":"telegram command","z":"c12650984412069f","g":"39735c9250feda9f","name":"telegram to itho","command":"/day","description":"","registercommand":false,"language":"","scope":"default","bot":"957ad4d124ca76b5","strict":false,"hasresponse":true,"useregex":false,"removeregexcommand":false,"outputs":2,"x":390,"y":3020,"wires":[["7ec721e5203ed558"],[]]},{"id":"7ec721e5203ed558","type":"change","z":"c12650984412069f","g":"39735c9250feda9f","name":"day -> on","rules":[{"t":"set","p":"payload","pt":"msg","to":"on","tot":"str"},{"t":"set","p":"day","pt":"global","to":"on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":3080,"wires":[["9bda6cb7d1a04860"]]},{"id":"297e923dba375f50","type":"change","z":"c12650984412069f","g":"39735c9250feda9f","name":"night -> off","rules":[{"t":"set","p":"payload","pt":"msg","to":"off","tot":"str"},{"t":"set","p":"day","pt":"global","to":"off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":3230,"wires":[["9bda6cb7d1a04860"]]},{"id":"43553d334adf115b","type":"change","z":"c12650984412069f","g":"39735c9250feda9f","name":"set var day","rules":[{"t":"set","p":"day","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":930,"y":3260,"wires":[[]]},{"id":"82e9f8c9d1a69429","type":"http request","z":"c12650984412069f","g":"39735c9250feda9f","name":"enable RF itho","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://192.168.1.91/api.html?setsetting=6&value=1","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":1100,"y":3010,"wires":[["227a5b8c279fa4fc","df87a6dd26e22c70"]]},{"id":"c763f71221e012bf","type":"http request","z":"c12650984412069f","g":"39735c9250feda9f","name":"disable RF itho","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://192.168.1.91/api.html?setsetting=6&value=0","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":1100,"y":3200,"wires":[["16a4f54961a8d14c","df87a6dd26e22c70"]]},{"id":"3e7c641c2f7696ae","type":"inject","z":"c12650984412069f","g":"39735c9250feda9f","name":"request RF status","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":800,"y":2930,"wires":[["18ec1e8193702060"]]},{"id":"035baf32a009d3cc","type":"http request","z":"c12650984412069f","g":"39735c9250feda9f","name":"get RF","method":"GET","ret":"obj","paytoqs":"ignore","url":"http://192.168.1.91/api.html?getsetting=6","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":1380,"y":3010,"wires":[["348b85e224a89802","d289b6ba9cd2b430","91300afe8b00edad"]]},{"id":"ee3eb7841bcaa67f","type":"link out","z":"c12650984412069f","g":"39735c9250feda9f","name":"variable day/night","mode":"link","links":["96ef862cb52e50fc","2a164dd309d64329"],"x":885,"y":3060,"wires":[]},{"id":"227a5b8c279fa4fc","type":"delay","z":"c12650984412069f","g":"39735c9250feda9f","name":"15 s","pauseType":"delay","timeout":"15","timeoutUnits":"seconds","rate":"1","nbRateUnits":"20","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1260,"y":3010,"wires":[["035baf32a009d3cc"]]},{"id":"348b85e224a89802","type":"switch","z":"c12650984412069f","g":"39735c9250feda9f","name":"?≠1","property":"payload.current","propertyType":"msg","rules":[{"t":"neq","v":"1","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":1500,"y":3010,"wires":[["9cdafc59a973faa3"]]},{"id":"c7dde5b95b9c987d","type":"switch","z":"c12650984412069f","g":"39735c9250feda9f","name":"?≠0","property":"payload.current","propertyType":"msg","rules":[{"t":"neq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":1500,"y":3200,"wires":[["ac2c3b7a928b6004"]]},{"id":"cb9d7ee29c249b2c","type":"http request","z":"c12650984412069f","g":"39735c9250feda9f","name":"get RF","method":"GET","ret":"obj","paytoqs":"ignore","url":"http://192.168.1.91/api.html?getsetting=6","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":1380,"y":3200,"wires":[["c7dde5b95b9c987d","495469f3efa8c006","91300afe8b00edad"]]},{"id":"16a4f54961a8d14c","type":"delay","z":"c12650984412069f","g":"39735c9250feda9f","name":"15 s","pauseType":"delay","timeout":"15","timeoutUnits":"seconds","rate":"1","nbRateUnits":"20","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1260,"y":3200,"wires":[["cb9d7ee29c249b2c"]]},{"id":"18ec1e8193702060","type":"http request","z":"c12650984412069f","g":"39735c9250feda9f","name":"get RF","method":"GET","ret":"obj","paytoqs":"ignore","url":"http://192.168.1.91/api.html?getsetting=6","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":1060,"y":2880,"wires":[["28eb8972a430f684","e2b952c0c8492ff5"]]},{"id":"d289b6ba9cd2b430","type":"debug","z":"c12650984412069f","g":"39735c9250feda9f","name":"RF status","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1510,"y":2960,"wires":[]},{"id":"495469f3efa8c006","type":"debug","z":"c12650984412069f","g":"39735c9250feda9f","name":"RF status","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1510,"y":3260,"wires":[]},{"id":"5fe2eda405bb77e3","type":"link out","z":"c12650984412069f","g":"39735c9250feda9f","name":"resend","mode":"link","links":["96ef862cb52e50fc","2a164dd309d64329","c38c11b4face0655"],"x":1685,"y":3150,"wires":[]},{"id":"9cdafc59a973faa3","type":"delay","z":"c12650984412069f","g":"39735c9250feda9f","name":"10 s","pauseType":"delay","timeout":"10","timeoutUnits":"seconds","rate":"1","nbRateUnits":"20","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1630,"y":3010,"wires":[["82e9f8c9d1a69429"]]},{"id":"ac2c3b7a928b6004","type":"delay","z":"c12650984412069f","g":"39735c9250feda9f","name":"10 s","pauseType":"delay","timeout":"10","timeoutUnits":"seconds","rate":"1","nbRateUnits":"20","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1630,"y":3200,"wires":[["c763f71221e012bf"]]},{"id":"95ca0ba6d98a1b65","type":"mqtt out","z":"c12650984412069f","g":"39735c9250feda9f","name":"itho/RF_enable","topic":"itho/RF_enable","qos":"1","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"310971df985355bd","x":1630,"y":2880,"wires":[]},{"id":"adaf39baeada3b54","type":"mqtt in","z":"c12650984412069f","g":"39735c9250feda9f","name":"","topic":"itho/RF_enable","qos":"1","datatype":"auto-detect","broker":"b4eed736.102278","nl":false,"rap":true,"rh":0,"inputs":0,"x":790,"y":2880,"wires":[["c7466f7fabea107d"]]},{"id":"c7466f7fabea107d","type":"switch","z":"c12650984412069f","g":"39735c9250feda9f","name":"get","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"get","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":940,"y":2880,"wires":[["18ec1e8193702060"]]},{"id":"113f90e7bc2e740e","type":"function","z":"c12650984412069f","g":"39735c9250feda9f","name":"add date/time","func":"var date = global.get ('date');\nmsg.payload = msg.payload + \" - \" +date;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1450,"y":2880,"wires":[["ece5e0f8643951f7","95ca0ba6d98a1b65"]]},{"id":"28eb8972a430f684","type":"debug","z":"c12650984412069f","g":"39735c9250feda9f","name":"RF status","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1190,"y":2960,"wires":[]},{"id":"c38c11b4face0655","type":"link in","z":"c12650984412069f","g":"39735c9250feda9f","name":"link in 1","links":["ceacdd306f229ff0","5fe2eda405bb77e3"],"x":1145,"y":2920,"wires":[["8e1b6bd094016d59"]]},{"id":"df87a6dd26e22c70","type":"debug","z":"c12650984412069f","g":"39735c9250feda9f","name":"RF status","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1310,"y":3110,"wires":[]},{"id":"70ada8191884d072","type":"debug","z":"c12650984412069f","g":"39735c9250feda9f","name":"RF status","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1610,"y":3100,"wires":[]},{"id":"8e1b6bd094016d59","type":"json","z":"c12650984412069f","g":"39735c9250feda9f","name":"","property":"payload","action":"str","pretty":false,"x":1300,"y":2880,"wires":[["113f90e7bc2e740e"]]},{"id":"204e05191cca2662","type":"json","z":"c12650984412069f","g":"5b2d63fc0738c328","name":"","property":"payload","action":"str","pretty":false,"x":670,"y":2530,"wires":[["a07f4a0a32302de5"]]},{"id":"ece5e0f8643951f7","type":"link out","z":"c12650984412069f","g":"39735c9250feda9f","name":"resend","mode":"link","links":["2a164dd309d64329","3c50aecdd25d4a7e","b567d7c7afe38177"],"x":1635,"y":2930,"wires":[]},{"id":"b567d7c7afe38177","type":"link in","z":"c12650984412069f","g":"5b2d63fc0738c328","name":"link in 2","links":["ece5e0f8643951f7"],"x":1055,"y":2550,"wires":[["9c0a782f967b2194"]]},{"id":"5e7f31f8f8a6766b","type":"change","z":"c12650984412069f","g":"39735c9250feda9f","name":"retain","rules":[{"t":"set","p":"retain","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1600,"y":3150,"wires":[["5fe2eda405bb77e3"]]},{"id":"e2b952c0c8492ff5","type":"change","z":"c12650984412069f","g":"39735c9250feda9f","name":"!retain","rules":[{"t":"set","p":"retain","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1180,"y":2880,"wires":[["8e1b6bd094016d59"]]},{"id":"790fb3851eeb78b5","type":"link out","z":"c12650984412069f","name":"5 sec timer","mode":"link","links":["aebcd6bd24ea4f7c"],"x":305,"y":230,"wires":[]},{"id":"2ca665c577a6b8e6","type":"debug","z":"c12650984412069f","g":"62d4d40cc94b4816","name":"debug 6","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1020,"y":1370,"wires":[]},{"id":"50a7977a449336c0","type":"debug","z":"c12650984412069f","g":"62d4d40cc94b4816","name":"debug 7","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":650,"y":1460,"wires":[]},{"id":"64ede0ef8d9642b5","type":"debug","z":"c12650984412069f","g":"62d4d40cc94b4816","name":"debug 8","active":false,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":450,"y":1530,"wires":[]},{"id":"ce66274eba949854","type":"rpi-gpio in","z":"c12650984412069f","name":"power supply","pin":"4","intype":"tri","debounce":"1000","read":true,"bcm":true,"x":1180,"y":80,"wires":[["6843541e4dce219d"]]},{"id":"864321e0510f244f","type":"change","z":"c12650984412069f","name":"send no external power","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"text\":\"Raspberry no external power\",\"parse_mode\":\"Markdown\"}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":1760,"y":100,"wires":[["0d453ad559e328ee"]]},{"id":"6843541e4dce219d","type":"switch","z":"c12650984412069f","name":"power?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":1340,"y":80,"wires":[["3a581fb7a698f176"],["143694ce9bca3dcf"]]},{"id":"af7085d99a8e85f6","type":"change","z":"c12650984412069f","name":"send external power restored","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"text\":\"Raspberry external power restored\",\"parse_mode\":\"Markdown\"}","tot":"json"},{"t":"set","p":"power","pt":"global","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1770,"y":60,"wires":[["0d453ad559e328ee"]]},{"id":"143694ce9bca3dcf","type":"change","z":"c12650984412069f","name":"set power false","rules":[{"t":"set","p":"power","pt":"global","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1520,"y":100,"wires":[["864321e0510f244f"]]},{"id":"3a581fb7a698f176","type":"switch","z":"c12650984412069f","name":"power not set?","property":"power","propertyType":"global","rules":[{"t":"false"}],"checkall":"true","repair":false,"outputs":1,"x":1520,"y":60,"wires":[["af7085d99a8e85f6"]]},{"id":"6cec1265393cf4f8","type":"comment","z":"c12650984412069f","name":"night cooling","info":"","x":220,"y":1470,"wires":[]},{"id":"5ec8b88711be3c95","type":"timerswitch","z":"c12650984412069f","g":"39735c9250feda9f","name":"07:00 - 00:30","ontopic":"","offtopic":"","onpayload":"on","offpayload":"off","disabled":false,"schedules":[{"on_h":"07","on_m":"00","on_s":"00","off_h":"00","off_m":"30","off_s":"00","valid":true}],"x":700,"y":3080,"wires":[["ee3eb7841bcaa67f","a099530f5725d8ee","43553d334adf115b"]]},{"id":"a449b775e9d7fa9d","type":"mqtt in","z":"c12650984412069f","g":"39735c9250feda9f","name":"","topic":"itho/sleepswitch","qos":"1","datatype":"auto-detect","broker":"b4eed736.102278","nl":false,"rap":true,"rh":0,"inputs":0,"x":400,"y":2960,"wires":[["9bda6cb7d1a04860"]]},{"id":"34132d5ec5e2f764","type":"function","z":"c12650984412069f","g":"b0b8a4672afac9ba","name":"set topic","func":"msg.topic = \"WCboven\";\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":590,"y":2220,"wires":[["0dbc0935c689f61d"]]},{"id":"2e6d4a37853938e5","type":"rbe","z":"c12650984412069f","g":"b0b8a4672afac9ba","name":"changed?","func":"rbei","gap":"","start":"","inout":"out","septopics":false,"property":"payload","topi":"topic","x":750,"y":2350,"wires":[["961a4513e9e88d4a","798e2a0cc16a1b38"]]},{"id":"0dbc0935c689f61d","type":"rbe","z":"c12650984412069f","g":"b0b8a4672afac9ba","name":"changed?","func":"rbei","gap":"","start":"","inout":"out","septopics":false,"property":"payload","topi":"topic","x":750,"y":2220,"wires":[["33d0adef922c24aa","798e2a0cc16a1b38"]]},{"id":"e3622dec4da42c67","type":"change","z":"c12650984412069f","g":"b0b8a4672afac9ba","name":"reset presentup","rules":[{"t":"set","p":"presentup","pt":"global","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1570,"y":2200,"wires":[["3f3ec63075ecc39b"]]},{"id":"e9572912209eff89","type":"change","z":"c12650984412069f","g":"b0b8a4672afac9ba","name":"reset presentdown","rules":[{"t":"set","p":"presentdown","pt":"global","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1580,"y":2330,"wires":[["8ca5b7e8a477dc83"]]},{"id":"dc361b3391ec6fd7","type":"function","z":"c12650984412069f","g":"b0b8a4672afac9ba","name":"set topic","func":"msg.topic = \"WCbeneden\";\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":590,"y":2350,"wires":[["2e6d4a37853938e5"]]},{"id":"b4eed736.102278","type":"mqtt-broker","name":"raspberry","broker":"192.168.1.236","port":"1883","clientid":"","autoConnect":true,"usetls":false,"compatmode":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"autoUnsubscribe":true,"birthTopic":"","birthQos":"1","birthRetain":"false","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""},{"id":"1bbf6588b510402d","type":"telegrambot-config","botname":"Itho","usernames":"","chatIds":"","pollInterval":"300"},{"id":"957ad4d124ca76b5","type":"telegram bot","botname":"Ithoreceivebot","usernames":"","chatids":"","baseapiurl":"","updatemode":"polling","pollinterval":"300","usesocks":false,"sockshost":"","socksport":"6667","socksusername":"anonymous","sockspassword":"","bothost":"","botpath":"","localbotport":"8443","publicbotport":"8443","privatekey":"","certificate":"","useselfsignedcertificate":false,"sslterminated":false,"verboselogging":true},{"id":"310971df985355bd","type":"mqtt-broker","name":"MQTT Raspverri RF_enable","broker":"192.168.1.236","port":"1883","clientid":"Client_nodered_rf_enable","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":false,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""}]

Flow Info

Created 1 year, 2 months ago
Updated 6 months, 2 weeks ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • change (x54)
  • comment (x1)
  • debug (x18)
  • delay (x5)
  • file (x1)
  • function (x16)
  • http request (x8)
  • inject (x7)
  • json (x2)
  • link in (x3)
  • link out (x5)
  • mqtt in (x5)
  • mqtt out (x11)
  • mqtt-broker (x2)
  • rbe (x5)
  • switch (x32)
Other

Tags

  • itho
  • ventilation
  • shower
  • humidity
  • control
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option