NRCHKB / node-red-contrib-homekit-bridged

Node-RED Contribution - HomeKit Bridged : Node-RED nodes to simulate Apple HomeKit devices.
https://nrchkb.github.io
MIT License
418 stars 52 forks source link

Scene not turning off all light #9

Closed bolfox closed 6 years ago

bolfox commented 6 years ago

I have made some scene with 9-10 light, when i launch, it tun off only two lights, not all...

It work on knx bus, on ets monitor i can see only two command from nodered

oliverrahner commented 6 years ago

Can you share your flow?

bolfox commented 6 years ago

[{"id":"89cc6cc0.185a78","type":"tab","label":"Homekit","disabled":false,"info":""},{"id":"c25f596.e3ac4a8","type":"debug","z":"89cc6cc0.185a78","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"hap.newValue","x":930,"y":40,"wires":[]},{"id":"8f819ce4.84643","type":"homekit-service","z":"89cc6cc0.185a78","bridge":"9c8b6083.39aee","name":"Bianche","serviceName":"Lightbulb","manufacturer":"By-me","model":"Knx","serialNo":"1/6/1","characteristicProperties":"{}","x":500,"y":180,"wires":[["a2ce31c6.2428e"]]},{"id":"a2ce31c6.2428e","type":"function","z":"89cc6cc0.185a78","name":"Bianche","func":"msg.payload={\"dstgad\":\"1/6/1\",\"value\":msg.hap.newValue.toString(),\"dtp\":\"1\"};\nreturn msg;","outputs":1,"noerr":0,"x":720,"y":180,"wires":[["67af9d1d.7d3414"]]},{"id":"67af9d1d.7d3414","type":"link out","z":"89cc6cc0.185a78","name":"Web_OUT","links":["1cfe2246.dee10e","8228a973.6086b8","a3ecd3ce.bb7de"],"x":975,"y":300,"wires":[]},{"id":"2d955dde.a678b2","type":"link in","z":"89cc6cc0.185a78","name":"Web_IN","links":["65fe2145.da4d2","e21c591e.370fe8"],"x":55,"y":60,"wires":[["dd23dd27.71f7e","a33326a1.79cf18","ebfd086f.ec2e38","ebc3af05.27ed9","8c43aa7b.26d9b8","93f64f5c.5806d","283dcec2.4bb842","79a2d8a7.464098","7e52bc8d.ebffe4","46cba12d.d2d82"]]},{"id":"fdec3748.3344f8","type":"homekit-service","z":"89cc6cc0.185a78","bridge":"9c8b6083.39aee","name":"Rosse","serviceName":"Lightbulb","manufacturer":"By-me","model":"Knx","serialNo":"1/6/9","characteristicProperties":"{}","x":490,"y":220,"wires":[["61977556.b4a73c"]]},{"id":"61977556.b4a73c","type":"function","z":"89cc6cc0.185a78","name":"Rosse","func":"msg.payload={\"dstgad\":\"1/6/9\",\"value\":msg.hap.newValue.toString(),\"dtp\":\"1\"};\nreturn msg;","outputs":1,"noerr":0,"x":710,"y":220,"wires":[["67af9d1d.7d3414"]]},{"id":"18d7fdb0.a81362","type":"inject","z":"89cc6cc0.185a78","name":"","topic":"","payload":"{\"On\":1}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":290,"y":40,"wires":[["8f819ce4.84643"]]},{"id":"27660af3.f7b8f6","type":"inject","z":"89cc6cc0.185a78","name":"","topic":"","payload":"{\"On\": 0}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":300,"y":80,"wires":[["8f819ce4.84643"]]},{"id":"dd23dd27.71f7e","type":"function","z":"89cc6cc0.185a78","name":"stato Bianche","func":"if (msg.payload.dstgad == \"1/6/1\")\n{\n if (msg.payload.value == \"1\")\n {\n return {payload : {\"On\" : 1}};\n } else\n {\n return {payload : {\"On\" : 0}};\n }\n}","outputs":1,"noerr":0,"x":240,"y":180,"wires":[["8f819ce4.84643"]]},{"id":"a33326a1.79cf18","type":"function","z":"89cc6cc0.185a78","name":"stato Rosse","func":"if (msg.payload.dstgad == \"1/6/9\")\n{\n if (msg.payload.value == \"1\")\n {\n return {payload : {\"On\" : 1}};\n } else\n {\n return {payload : {\"On\" : 0}};\n }\n}","outputs":1,"noerr":0,"x":230,"y":220,"wires":[["fdec3748.3344f8"]]},{"id":"ebfd086f.ec2e38","type":"function","z":"89cc6cc0.185a78","name":"stato Bagno","func":"if (msg.payload.dstgad == \"1/6/25\")\n{\n if (msg.payload.value == \"1\")\n {\n return {payload : {\"On\" : 1}};\n } else\n {\n return {payload : {\"On\" : 0}};\n }\n}","outputs":1,"noerr":0,"x":230,"y":260,"wires":[["659492e0.d2b63c"]]},{"id":"659492e0.d2b63c","type":"homekit-service","z":"89cc6cc0.185a78","bridge":"9c8b6083.39aee","name":"Bagno","serviceName":"Lightbulb","manufacturer":"By-me","model":"Knx","serialNo":"1/6/25","characteristicProperties":"{}","x":490,"y":260,"wires":[["db261b45.6ba168"]]},{"id":"db261b45.6ba168","type":"function","z":"89cc6cc0.185a78","name":"Bagno","func":"msg.payload={\"dstgad\":\"1/6/25\",\"value\":msg.hap.newValue.toString(),\"dtp\":\"1\"};\nreturn msg;","outputs":1,"noerr":0,"x":710,"y":260,"wires":[["67af9d1d.7d3414"]]},{"id":"ebc3af05.27ed9","type":"function","z":"89cc6cc0.185a78","name":"stato Lavandino","func":"if (msg.payload.dstgad == \"1/5/241\")\n{\n if (msg.payload.value == \"1\")\n {\n return {payload : {\"On\" : 1}};\n } else\n {\n return {payload : {\"On\" : 0}};\n }\n}","outputs":1,"noerr":0,"x":240,"y":300,"wires":[["8b9341ee.41eb3"]]},{"id":"8b9341ee.41eb3","type":"homekit-service","z":"89cc6cc0.185a78","bridge":"9c8b6083.39aee","name":"Lavandino","serviceName":"Lightbulb","manufacturer":"By-me","model":"Knx","serialNo":"1/5/241","characteristicProperties":"{}","x":510,"y":300,"wires":[["5b6bec7a.91dbb4"]]},{"id":"5b6bec7a.91dbb4","type":"function","z":"89cc6cc0.185a78","name":"Lavandino","func":"msg.payload={\"dstgad\":\"1/5/241\",\"value\":msg.hap.newValue.toString(),\"dtp\":\"1\"};\nreturn msg;","outputs":1,"noerr":0,"x":730,"y":300,"wires":[["67af9d1d.7d3414"]]},{"id":"8c43aa7b.26d9b8","type":"function","z":"89cc6cc0.185a78","name":"stato Cappa","func":"if (msg.payload.dstgad == \"1/5/233\")\n{\n if (msg.payload.value == \"1\")\n {\n return {payload : {\"On\" : 1}};\n } else\n {\n return {payload : {\"On\" : 0}};\n }\n}","outputs":1,"noerr":0,"x":230,"y":340,"wires":[["ce10e932.c6c2f8"]]},{"id":"ce10e932.c6c2f8","type":"homekit-service","z":"89cc6cc0.185a78","bridge":"9c8b6083.39aee","name":"Cappa","serviceName":"Lightbulb","manufacturer":"By-me","model":"Knx","serialNo":"1/5/233","characteristicProperties":"{}","x":490,"y":340,"wires":[["58711735.0e3c48"]]},{"id":"58711735.0e3c48","type":"function","z":"89cc6cc0.185a78","name":"Cappa","func":"msg.payload={\"dstgad\":\"1/5/233\",\"value\":msg.hap.newValue.toString(),\"dtp\":\"1\"};\nreturn msg;","outputs":1,"noerr":0,"x":710,"y":340,"wires":[["67af9d1d.7d3414"]]},{"id":"93f64f5c.5806d","type":"function","z":"89cc6cc0.185a78","name":"stato Angolo Elia","func":"if (msg.payload.dstgad == \"1/5/249\")\n{\n if (msg.payload.value == \"1\")\n {\n return {payload : {\"On\" : 1}};\n } else\n {\n return {payload : {\"On\" : 0}};\n }\n}","outputs":1,"noerr":0,"x":250,"y":380,"wires":[["768c2874.c01998"]]},{"id":"768c2874.c01998","type":"homekit-service","z":"89cc6cc0.185a78","bridge":"9c8b6083.39aee","name":"Angolo Elia","serviceName":"Lightbulb","manufacturer":"By-me","model":"Knx","serialNo":"1/5/249","characteristicProperties":"{}","x":510,"y":380,"wires":[["3555372e.8c31a8"]]},{"id":"3555372e.8c31a8","type":"function","z":"89cc6cc0.185a78","name":"Angolo Elia","func":"msg.payload={\"dstgad\":\"1/5/249\",\"value\":msg.hap.newValue.toString(),\"dtp\":\"1\"};\nreturn msg;","outputs":1,"noerr":0,"x":730,"y":380,"wires":[["67af9d1d.7d3414"]]},{"id":"283dcec2.4bb842","type":"function","z":"89cc6cc0.185a78","name":"stato Banco","func":"if (msg.payload.dstgad == \"1/5/225\")\n{\n if (msg.payload.value == \"1\")\n {\n return {payload : {\"On\" : 1}};\n } else\n {\n return {payload : {\"On\" : 0}};\n }\n}","outputs":1,"noerr":0,"x":230,"y":420,"wires":[["f19f556c.38d688"]]},{"id":"f19f556c.38d688","type":"homekit-service","z":"89cc6cc0.185a78","bridge":"9c8b6083.39aee","name":"Banco","serviceName":"Lightbulb","manufacturer":"By-me","model":"Knx","serialNo":"1/5/225","characteristicProperties":"{}","x":490,"y":420,"wires":[["9b1774a3.030c18"]]},{"id":"9b1774a3.030c18","type":"function","z":"89cc6cc0.185a78","name":"Banco","func":"msg.payload={\"dstgad\":\"1/5/225\",\"value\":msg.hap.newValue.toString(),\"dtp\":\"1\"};\nreturn msg;","outputs":1,"noerr":0,"x":710,"y":420,"wires":[["67af9d1d.7d3414"]]},{"id":"79a2d8a7.464098","type":"function","z":"89cc6cc0.185a78","name":"stato Tavolo","func":"if (msg.payload.dstgad == \"1/5/185\")\n{\n if (msg.payload.value == \"1\")\n {\n return {payload : {\"On\" : 1}};\n } else\n {\n return {payload : {\"On\" : 0}};\n }\n}","outputs":1,"noerr":0,"x":230,"y":460,"wires":[["94a74b61.ee06f8"]]},{"id":"94a74b61.ee06f8","type":"homekit-service","z":"89cc6cc0.185a78","bridge":"9c8b6083.39aee","name":"Tavolo","serviceName":"Lightbulb","manufacturer":"By-me","model":"Knx","serialNo":"1/5/185","characteristicProperties":"{}","x":490,"y":460,"wires":[["b5f0f113.0046f"]]},{"id":"b5f0f113.0046f","type":"function","z":"89cc6cc0.185a78","name":"Tavolo","func":"msg.payload={\"dstgad\":\"1/5/185\",\"value\":msg.hap.newValue.toString(),\"dtp\":\"1\"};\nreturn msg;","outputs":1,"noerr":0,"x":710,"y":460,"wires":[["67af9d1d.7d3414"]]},{"id":"7e52bc8d.ebffe4","type":"function","z":"89cc6cc0.185a78","name":"stato Righe","func":"if (msg.payload.dstgad == \"1/5/193\")\n{\n if (msg.payload.value == \"1\")\n {\n return {payload : {\"On\" : 1}};\n } else\n {\n return {payload : {\"On\" : 0}};\n }\n}","outputs":1,"noerr":0,"x":230,"y":500,"wires":[["8f844894.12ce28"]]},{"id":"8f844894.12ce28","type":"homekit-service","z":"89cc6cc0.185a78","bridge":"9c8b6083.39aee","name":"Righe","serviceName":"Lightbulb","manufacturer":"By-me","model":"Knx","serialNo":"1/5/193","characteristicProperties":"{}","x":490,"y":500,"wires":[["a9730714.f26368"]]},{"id":"a9730714.f26368","type":"function","z":"89cc6cc0.185a78","name":"Righe","func":"msg.payload={\"dstgad\":\"1/5/193\",\"value\":msg.hap.newValue.toString(),\"dtp\":\"1\"};\nreturn msg;","outputs":1,"noerr":0,"x":710,"y":500,"wires":[["67af9d1d.7d3414"]]},{"id":"46cba12d.d2d82","type":"function","z":"89cc6cc0.185a78","name":"stato Libreria","func":"if (msg.payload.dstgad == \"1/5/201\")\n{\n if (msg.payload.value == \"1\")\n {\n return {payload : {\"On\" : 1}};\n } else\n {\n return {payload : {\"On\" : 0}};\n }\n}","outputs":1,"noerr":0,"x":230,"y":540,"wires":[["a6dbbddb.d359f"]]},{"id":"a6dbbddb.d359f","type":"homekit-service","z":"89cc6cc0.185a78","bridge":"9c8b6083.39aee","name":"Libreria","serviceName":"Lightbulb","manufacturer":"By-me","model":"Knx","serialNo":"1/5/201","characteristicProperties":"{}","x":500,"y":540,"wires":[["a400e08f.efebd"]]},{"id":"a400e08f.efebd","type":"function","z":"89cc6cc0.185a78","name":"Libreria","func":"msg.payload={\"dstgad\":\"1/5/201\",\"value\":msg.hap.newValue.toString(),\"dtp\":\"1\"};\nreturn msg;","outputs":1,"noerr":0,"x":720,"y":540,"wires":[["67af9d1d.7d3414"]]},{"id":"9c8b6083.39aee","type":"homekit-bridge","z":"","bridgeName":"NR-bridge","pinCode":"222-22-222","port":"","manufacturer":"NodeRED","model":"Rpi-zero-w","serialNo":"222-22-222"}]

oliverrahner commented 6 years ago

One basic information: You should probably filter for messages which originate in Homekit, so that input messages don't get passed through to KNX again which could cause loops. Example code:

if (msg.hap.context !== undefined)
{
  // your actions
}

You can try 2 things to debug further:

bolfox commented 6 years ago

Tnx for your support, seems to be a knx ip problem, with a tpuart interface it works...