[BUG] Thermostat causes Node-RED to crash
See original GitHub issueI have bought a controller which can control my climate. I want to represent this as a Thermostat in HomeKit.
However I’m running into issues. I can’t really figure out why this happens. It seems that changing state works (but sometimes not), but if I try to change the temp, the device in HomeKit immediately says that ‘No Response’ and sometimes Node-RED also quit and restarts…
Why this happens? Someone can have a look at it what I might miss during the config?
My config:
[{"id":"6300582b.ae2dc8","type":"homekit-service","z":"f3e6f30e.eac5c","isParent":true,"bridge":"db6c4c1.9b703b","parentService":"","name":"Nappali klíma","serviceName":"Thermostat","topic":"","filter":false,"manufacturer":"Sensibo","model":"Sky","serialNo":"11445","characteristicProperties":"{\n \"TargetHeatingCoolingState\": {\n \"validValues\": [0, 1, 2]\n },\n \"CurrentHeatingCoolingState\": {\n \"validValues\": [0, 1, 2]\n },\n \"CurrentRelativeHumidity\" : true,\n \"TemperatureDisplayUnits\" : 0\n}","x":940,"y":200,"wires":[["60277129.1884f","8e23421.ab7aac","8b641ef1.5c698"]]},{"id":"19df1217.c655de","type":"function","z":"f3e6f30e.eac5c","name":"ON/OFF","func":"if(msg.payload == \"ON\") {\n msg.payload = {\n \"CurrentHeatingCoolingState\" : 2\n };\n flow.set(\"ON\", 1);\n}\nelse {\n msg.payload = {\n \"CurrentHeatingCoolingState\": 0\n };\n flow.set(\"ON\", 0);\n}\nreturn msg;","outputs":1,"noerr":0,"x":680,"y":160,"wires":[["6300582b.ae2dc8"]]},{"id":"1ab4bebc.359b21","type":"function","z":"f3e6f30e.eac5c","name":"Target Temp","func":"var input = msg.payload;\nmsg.payload = {\n \"TargetTemperature\": input\n};\nreturn msg;","outputs":1,"noerr":0,"x":690,"y":200,"wires":[["6300582b.ae2dc8"]]},{"id":"783740f7.41a49","type":"function","z":"f3e6f30e.eac5c","name":"Current Temp","func":"var input = msg.payload;\nmsg.payload = {\n \"CurrentTemperature\": input\n};\nreturn msg;","outputs":1,"noerr":0,"x":700,"y":240,"wires":[["6300582b.ae2dc8"]]},{"id":"a931a997.bb9b58","type":"function","z":"f3e6f30e.eac5c","name":"Current Humidity","func":"var input = msg.payload;\nmsg.payload = {\n \"CurrentRelativeHumidity\": input\n};\nreturn msg;","outputs":1,"noerr":0,"x":710,"y":280,"wires":[["6300582b.ae2dc8"]]},{"id":"a18da4.4d77426","type":"function","z":"f3e6f30e.eac5c","name":"Heating/Cooling mode","func":"var on = flow.get(\"ON\");\n\nif(msg.payload == \"cool\" && on == 1) {\n msg.payload = {\n \"TargetHeatingCoolingState\" : 2\n };\n flow.set(\"Mode\", 2)\n}\nelse if(msg.payload == \"heat\" && on == 1) {\n msg.payload = {\n \"TargetHeatingCoolingState\" : 1\n };\n flow.set(\"Mode\", 1)\n}\nelse if(on === 0) {\n msg.payload = {\n \"TargeHeatingCoolingState\" : 0\n };\n}\nreturn msg;","outputs":1,"noerr":0,"x":720,"y":320,"wires":[["6300582b.ae2dc8"]]},{"id":"e42d1f16.03ceb","type":"openhab-v2-in","z":"f3e6f30e.eac5c","name":"","controller":"427d851b.f7e23c","item":"SensiboState","ohCompatibleTimestamp":false,"eventTypes":["ItemStateChangedEvent"],"outputAtStartup":true,"storeStateInFlow":false,"x":490,"y":160,"wires":[["19df1217.c655de"],[]]},{"id":"a0de957e.c529a8","type":"openhab-v2-in","z":"f3e6f30e.eac5c","name":"","controller":"427d851b.f7e23c","item":"SensiboTarget","ohCompatibleTimestamp":false,"eventTypes":["ItemStateChangedEvent"],"outputAtStartup":true,"storeStateInFlow":false,"x":490,"y":200,"wires":[["1ab4bebc.359b21"],[]]},{"id":"a5e24dc2.7de9a","type":"openhab-v2-in","z":"f3e6f30e.eac5c","name":"","controller":"427d851b.f7e23c","item":"SensiboTemp","ohCompatibleTimestamp":false,"eventTypes":["ItemStateChangedEvent"],"outputAtStartup":true,"storeStateInFlow":false,"x":490,"y":240,"wires":[["783740f7.41a49"],[]]},{"id":"5bec70be.4568f","type":"openhab-v2-in","z":"f3e6f30e.eac5c","name":"","controller":"427d851b.f7e23c","item":"SensiboHumidity","ohCompatibleTimestamp":false,"eventTypes":["ItemStateChangedEvent"],"outputAtStartup":true,"storeStateInFlow":false,"x":500,"y":280,"wires":[["a931a997.bb9b58"],[]]},{"id":"aeb6d8a1.c27eb8","type":"openhab-v2-in","z":"f3e6f30e.eac5c","name":"","controller":"427d851b.f7e23c","item":"SensiboMode","ohCompatibleTimestamp":false,"eventTypes":["ItemStateChangedEvent"],"outputAtStartup":true,"storeStateInFlow":false,"x":490,"y":320,"wires":[["25f8a680.237b5a"],[]]},{"id":"f86a8169.e06ba","type":"openhab-v2-out","z":"f3e6f30e.eac5c","name":"","controller":"427d851b.f7e23c","item":"SensiboState","topic":"ItemCommand","topicType":"oh_cmd","payload":"payload","payloadType":"msg","storeStateInFlow":false,"x":1350,"y":140,"wires":[]},{"id":"d807b6ad.280408","type":"openhab-v2-out","z":"f3e6f30e.eac5c","name":"","controller":"427d851b.f7e23c","item":"SensiboTarget","topic":"ItemCommand","topicType":"oh_cmd","payload":"payload","payloadType":"msg","storeStateInFlow":false,"x":1380,"y":180,"wires":[]},{"id":"3328b139.b1ea5e","type":"openhab-v2-out","z":"f3e6f30e.eac5c","name":"","controller":"427d851b.f7e23c","item":"SensiboMode","topic":"ItemCommand","topicType":"oh_cmd","payload":"payload","payloadType":"msg","storeStateInFlow":false,"x":1320,"y":300,"wires":[]},{"id":"60277129.1884f","type":"function","z":"f3e6f30e.eac5c","name":"ON/OFF","func":"if(msg.hap.context !== undefined) {\n if(msg.payload.hasOwnProperty(\"TargetHeatingCoolingState\")) {\n if(msg.payload.TargetHeatingCoolingState === 0) {\n msg.payload = \"OFF\";\n }\n else {\n msg.payload = \"ON\";\n }\n }\n return msg;\n}","outputs":1,"noerr":0,"x":1160,"y":140,"wires":[["f86a8169.e06ba"]]},{"id":"8e23421.ab7aac","type":"function","z":"f3e6f30e.eac5c","name":"Target Mode","func":"if(msg.hap.context !== undefined) {\n if(msg.payload.hasOwnProperty(\"TargetHeatingCoolingState\")) {\n if(msg.payload.TargetHeatingCoolingState === 1) {\n msg.payload = \"heat\";\n }\n else if(msg.payload.TargetHeatingCoolingState === 2) {\n msg.payload = \"cool\";\n }\n }\n return msg;\n}","outputs":1,"noerr":0,"x":1150,"y":300,"wires":[["3328b139.b1ea5e"]]},{"id":"8b641ef1.5c698","type":"function","z":"f3e6f30e.eac5c","name":"Target Temp","func":"if(msg.hap.context !== undefined) {\n if(msg.payload.hasOwnProperty(\"TargetTemperature\")) {\n var input = msg.payload.TargetTemperature;\n msg.payload = input;\n }\n return msg;\n}","outputs":1,"noerr":0,"x":1170,"y":180,"wires":[["d807b6ad.280408"]]},{"id":"25f8a680.237b5a","type":"delay","z":"f3e6f30e.eac5c","name":"","pauseType":"delay","timeout":"50","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":610,"y":380,"wires":[["a18da4.4d77426"]]},{"id":"db6c4c1.9b703b","type":"homekit-bridge","z":"","bridgeName":"openHAB - RED","pinCode":"111-22-333","port":"","manufacturer":"Node-RED","model":"v2.0","serialNo":"Default Serial Number"},{"id":"427d851b.f7e23c","type":"openhab-v2-controller","z":"","name":"openhab2","protocol":"http","host":"localhost","port":"8080","path":"","username":"","password":"","allowRawEvents":true}]
Thanks!
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (8 by maintainers)
Top GitHub Comments
@radokristof Please take a look #88
My assumption was right. The problem was not in HomeKit, but in openHAB (and also some little bugs in the function nodes transforming the states). Problem solved.