question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Thermostat causes Node-RED to crash

See original GitHub issue

I 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:closed
  • Created 4 years ago
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ptathcommented, Apr 24, 2019

@radokristof Please take a look #88

0reactions
radokristofcommented, May 13, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nodered crashing when using the node-red-contrib-cast node
It is a bug in the nodes code, not a issue with Node-RED. The author of the node is the one who needs...
Read more >
BUG: Dashboard node not reliably passing input value to output
When I move THOSE nodes to a new flow, the Function node no longer causes a problem. I'm struggling to understand how something...
Read more >
Is nodered supposed to crash if a contrib node throws with a ...
Yes, if the node doesn't catch it's own errors then Node-RED has to exit because it can no longer be sure of the...
Read more >
Bug/Crash nodered and alexa - General - Node-RED Forum
The first thing to check is the node-red log to see if any errors have been logged. On a Pi, you can use...
Read more >
Node-Red Crashing Upon Opening - General
Apparently there is a bug in the ubidots node that crashes node red when it gets invalid data. 1 Like. Colin ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found