@medicus07
Der Flow und die Funktionen sind nicht von mir…der ist von @Micha…DANKE @Micha!!! Habs nur für mich angepasst
Funktioniert alles bis auf die Rückmeldung der Farbe, wenn in hue App geändert wird.
[{"id":"f0814f37.fff96","type":"homeeDevice","z":"9794c480.ea90d8","homee-sim":"c7073da5.2d1028","name":"Sofalampe","nodeId":"40","profile":"1002","attributes":"[{\"id\":40,\"node_id\":40,\"instance\":0,\"minimum\":0,\"maximum\":1,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"\",\"step_value\":1,\"editable\":1,\"type\":1,\"state\":1,\"last_changed\":12345555,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\"},{\"id\":41,\"node_id\":40,\"instance\":0,\"minimum\":0,\"maximum\":100,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"%25\",\"step_value\":1,\"editable\":1,\"type\":2,\"state\":1,\"last_changed\":12345555,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\"},{\"id\":42,\"node_id\":40,\"instance\":0,\"minimum\":153,\"maximum\":500,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"K\",\"step_value\":1,\"editable\":1,\"type\":42,\"state\":1,\"last_changed\":12345555,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\"},{\"id\":43,\"node_id\":40,\"instance\":0,\"minimum\":0,\"maximum\":16777215,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"\",\"step_value\":1,\"editable\":1,\"type\":23,\"state\":1,\"last_changed\":12345555,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"7001020%3B16419669%3B12026363%3B16525995\"}]","x":230,"y":500,"wires":[["34666423.1e6014"]]},{"id":"e6fceb06.45376","type":"homeeDevice","z":"9794c480.ea90d8","homee-sim":"c7073da5.2d1028","name":"Kugellampe","nodeId":"50","profile":"1002","attributes":"[{\"id\":50,\"node_id\":50,\"instance\":0,\"minimum\":0,\"maximum\":1,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"\",\"step_value\":1,\"editable\":1,\"type\":1,\"state\":1,\"last_changed\":12345555,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\"},{\"id\":51,\"node_id\":50,\"instance\":0,\"minimum\":0,\"maximum\":100,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"%25\",\"step_value\":1,\"editable\":1,\"type\":2,\"state\":1,\"last_changed\":12345555,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\"},{\"id\":52,\"node_id\":50,\"instance\":0,\"minimum\":153,\"maximum\":500,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"K\",\"step_value\":1,\"editable\":1,\"type\":42,\"state\":1,\"last_changed\":12345555,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\"},{\"id\":53,\"node_id\":50,\"instance\":0,\"minimum\":0,\"maximum\":16777215,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"\",\"step_value\":1,\"editable\":1,\"type\":23,\"state\":1,\"last_changed\":12345555,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"7001020%3B16419669%3B12026363%3B16525995\"}]","x":230,"y":640,"wires":[["d18e0ee9.3f1b2"]]},{"id":"40fda84c.d1e11","type":"hue-light","z":"9794c480.ea90d8","name":"Sofalampe","bridge":"7206028e.714fdc","lightid":"3","colornamer":true,"x":610,"y":500,"wires":[["16dc427d.cf48e6"]]},{"id":"34666423.1e6014","type":"function","z":"9794c480.ea90d8","name":"RGB Funktion","func":"if (msg.payload.attributeId === 43){\nvar zahl= msg.payload.targetValue;\nvar ausgabe =\"\";\nrest(i = zahl%16);\nzahl6 = ausgabe;\nzahl = Math.floor(zahl/16);\nrest(i = zahl%16);\nzahl5 = ausgabe;\nzahl = Math.floor(zahl/16);\nrest(i = zahl%16);\nzahl4 = ausgabe;\nzahl = Math.floor(zahl/16);\nrest(i = zahl%16);\nzahl3 = ausgabe;\nzahl = Math.floor(zahl/16);\nrest(i = zahl%16);\nzahl2 = ausgabe;\nzahl = Math.floor(zahl/16);\nrest(i = zahl);\nzahl1 = ausgabe;\n\nausgabe2 = zahl1+zahl2+zahl3+zahl4+zahl5+zahl6;\n node.send({payload:{\"hex\":ausgabe2}});\n}\n\nfunction rest(){\n switch(i)\n\t\t{\n\t\t \n\t\tcase 1: ausgabe =\"1\";break;\n\t\tcase 2: ausgabe =\"2\";break;\n\t\tcase 3: ausgabe = \"3\";break;\n\t\tcase 4: ausgabe= \"4\";break;\n\t\tcase 5: ausgabe= \"5\";break;\n\t\tcase 6: ausgabe = \"6\";break;\n\t\tcase 7: ausgabe =\"7\";break; \n\t\tcase 8: ausgabe = \"8\";break;\n\t\tcase 9: ausgabe = \"9\";break;\n\t\tcase 10: ausgabe =\"A\"; break;\n\t\tcase 11: ausgabe = \"B\"; break;\n\t\tcase 12: ausgabe = \"C\"; break;\n\t\tcase 13: ausgabe =\"D\"; break;\n\t\tcase 14: ausgabe =\"E\"; break;\n\t\tcase 15: ausgabe =\"F\"; break;\n}}\n\nif (msg.payload.attributeId === 40){node.send({payload:{\"on\":msg.payload.targetValue}})}\nif (msg.payload.attributeId === 41){node.send({payload:{\"brightness\":msg.payload.targetValue}})}\nif (msg.payload.attributeId === 42){node.send({payload:{\"colorTemp\":msg.payload.targetValue}})}\n","outputs":1,"noerr":0,"x":400,"y":500,"wires":[["40fda84c.d1e11"]]},{"id":"16dc427d.cf48e6","type":"function","z":"9794c480.ea90d8","name":"Rückkanal on off","func":"if (msg.payload.on === true ){msg.payload.on =1}else msg.payload.on=0; \nnode.send({payload:{\"id\":40,\"value\":msg.payload.on}}),\nnode.send({payload:{\"id\":41,\"value\":msg.payload.brightness}})\n//node.send({payload:{\"id\":42,\"value\":msg.payload.colorTemp}})","outputs":1,"noerr":0,"x":830,"y":500,"wires":[["f0814f37.fff96","61be40a.56d8a4"]]},{"id":"61be40a.56d8a4","type":"debug","z":"9794c480.ea90d8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1050,"y":500,"wires":[]},{"id":"c26c73fe.b179a8","type":"hue-light","z":"9794c480.ea90d8","name":"Kugellampe","bridge":"7206028e.714fdc","lightid":"6","colornamer":true,"x":630,"y":640,"wires":[["eb009b6.1647ce8"]]},{"id":"d18e0ee9.3f1b2","type":"function","z":"9794c480.ea90d8","name":"RGB Funktion","func":"if (msg.payload.attributeId === 53){\nvar zahl= msg.payload.targetValue;\nvar ausgabe =\"\";\nrest(i = zahl%16);\nzahl6 = ausgabe;\nzahl = Math.floor(zahl/16);\nrest(i = zahl%16);\nzahl5 = ausgabe;\nzahl = Math.floor(zahl/16);\nrest(i = zahl%16);\nzahl4 = ausgabe;\nzahl = Math.floor(zahl/16);\nrest(i = zahl%16);\nzahl3 = ausgabe;\nzahl = Math.floor(zahl/16);\nrest(i = zahl%16);\nzahl2 = ausgabe;\nzahl = Math.floor(zahl/16);\nrest(i = zahl);\nzahl1 = ausgabe;\n\nausgabe2 = zahl1+zahl2+zahl3+zahl4+zahl5+zahl6;\n node.send({payload:{\"hex\":ausgabe2}});\n}\n\nfunction rest(){\n switch(i)\n\t\t{\n\t\t \n\t\tcase 1: ausgabe =\"1\";break;\n\t\tcase 2: ausgabe =\"2\";break;\n\t\tcase 3: ausgabe = \"3\";break;\n\t\tcase 4: ausgabe= \"4\";break;\n\t\tcase 5: ausgabe= \"5\";break;\n\t\tcase 6: ausgabe = \"6\";break;\n\t\tcase 7: ausgabe =\"7\";break; \n\t\tcase 8: ausgabe = \"8\";break;\n\t\tcase 9: ausgabe = \"9\";break;\n\t\tcase 10: ausgabe =\"A\"; break;\n\t\tcase 11: ausgabe = \"B\"; break;\n\t\tcase 12: ausgabe = \"C\"; break;\n\t\tcase 13: ausgabe =\"D\"; break;\n\t\tcase 14: ausgabe =\"E\"; break;\n\t\tcase 15: ausgabe =\"F\"; break;\n}}\n\nif (msg.payload.attributeId === 50){node.send({payload:{\"on\":msg.payload.targetValue}})}\nif (msg.payload.attributeId === 51){node.send({payload:{\"brightness\":msg.payload.targetValue}})}\nif (msg.payload.attributeId === 52){node.send({payload:{\"colorTemp\":msg.payload.targetValue}})}\n","outputs":1,"noerr":0,"x":420,"y":640,"wires":[["c26c73fe.b179a8"]]},{"id":"eb009b6.1647ce8","type":"function","z":"9794c480.ea90d8","name":"Rückkanal on off","func":"if (msg.payload.on === true ){msg.payload.on =1}else msg.payload.on=0; \nnode.send({payload:{\"id\":50,\"value\":msg.payload.on}}),\nnode.send({payload:{\"id\":51,\"value\":msg.payload.brightness}})\n//node.send({payload:{\"id\":42,\"value\":msg.payload.colorTemp}})","outputs":1,"noerr":0,"x":850,"y":640,"wires":[["e6fceb06.45376","94f1b736.187b6"]]},{"id":"94f1b736.187b6","type":"debug","z":"9794c480.ea90d8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1070,"y":600,"wires":[]},{"id":"5201b159.38cd38","type":"homeeDevice","z":"9794c480.ea90d8","homee-sim":"c7073da5.2d1028","name":"HueGo Pfanze","nodeId":"60","profile":"1002","attributes":"[{\"id\":60,\"node_id\":60,\"instance\":0,\"minimum\":0,\"maximum\":1,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"\",\"step_value\":1,\"editable\":1,\"type\":1,\"state\":1,\"last_changed\":12345555,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\"},{\"id\":61,\"node_id\":60,\"instance\":0,\"minimum\":0,\"maximum\":100,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"%25\",\"step_value\":1,\"editable\":1,\"type\":2,\"state\":1,\"last_changed\":12345555,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\"},{\"id\":62,\"node_id\":60,\"instance\":0,\"minimum\":153,\"maximum\":500,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"K\",\"step_value\":1,\"editable\":1,\"type\":42,\"state\":1,\"last_changed\":12345555,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\"},{\"id\":63,\"node_id\":60,\"instance\":0,\"minimum\":0,\"maximum\":16777215,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"\",\"step_value\":1,\"editable\":1,\"type\":23,\"state\":1,\"last_changed\":12345555,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"7001020%3B16419669%3B12026363%3B16525995\"}]","x":240,"y":760,"wires":[["b8d5561d.a93b78"]]},{"id":"1c8ca28f.a634ed","type":"function","z":"9794c480.ea90d8","name":"Rückkanal on off","func":"if (msg.payload.on === true ){msg.payload.on =1}else msg.payload.on=0; \nnode.send({payload:{\"id\":60,\"value\":msg.payload.on}}),\nnode.send({payload:{\"id\":61,\"value\":msg.payload.brightness}})\n//node.send({payload:{\"id\":42,\"value\":msg.payload.colorTemp}})","outputs":1,"noerr":0,"x":850,"y":760,"wires":[["5201b159.38cd38","3dd96b27.bac9bc"]]},{"id":"3dd96b27.bac9bc","type":"debug","z":"9794c480.ea90d8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1070,"y":720,"wires":[]},{"id":"b8d5561d.a93b78","type":"function","z":"9794c480.ea90d8","name":"RGB Funktion","func":"if (msg.payload.attributeId === 63){\nvar zahl= msg.payload.targetValue;\nvar ausgabe =\"\";\nrest(i = zahl%16);\nzahl6 = ausgabe;\nzahl = Math.floor(zahl/16);\nrest(i = zahl%16);\nzahl5 = ausgabe;\nzahl = Math.floor(zahl/16);\nrest(i = zahl%16);\nzahl4 = ausgabe;\nzahl = Math.floor(zahl/16);\nrest(i = zahl%16);\nzahl3 = ausgabe;\nzahl = Math.floor(zahl/16);\nrest(i = zahl%16);\nzahl2 = ausgabe;\nzahl = Math.floor(zahl/16);\nrest(i = zahl);\nzahl1 = ausgabe;\n\nausgabe2 = zahl1+zahl2+zahl3+zahl4+zahl5+zahl6;\n node.send({payload:{\"hex\":ausgabe2}});\n}\n\nfunction rest(){\n switch(i)\n\t\t{\n\t\t \n\t\tcase 1: ausgabe =\"1\";break;\n\t\tcase 2: ausgabe =\"2\";break;\n\t\tcase 3: ausgabe = \"3\";break;\n\t\tcase 4: ausgabe= \"4\";break;\n\t\tcase 5: ausgabe= \"5\";break;\n\t\tcase 6: ausgabe = \"6\";break;\n\t\tcase 7: ausgabe =\"7\";break; \n\t\tcase 8: ausgabe = \"8\";break;\n\t\tcase 9: ausgabe = \"9\";break;\n\t\tcase 10: ausgabe =\"A\"; break;\n\t\tcase 11: ausgabe = \"B\"; break;\n\t\tcase 12: ausgabe = \"C\"; break;\n\t\tcase 13: ausgabe =\"D\"; break;\n\t\tcase 14: ausgabe =\"E\"; break;\n\t\tcase 15: ausgabe =\"F\"; break;\n}}\n\nif (msg.payload.attributeId === 60){node.send({payload:{\"on\":msg.payload.targetValue}})}\nif (msg.payload.attributeId === 61){node.send({payload:{\"brightness\":msg.payload.targetValue}})}\nif (msg.payload.attributeId === 62){node.send({payload:{\"colorTemp\":msg.payload.targetValue}})}\n","outputs":1,"noerr":0,"x":440,"y":760,"wires":[["ee920c63.33d078"]]},{"id":"6dd18a3.4a6a0f4","type":"homeeDevice","z":"9794c480.ea90d8","homee-sim":"c7073da5.2d1028","name":"HueGo TV","nodeId":"70","profile":"1002","attributes":"[{\"id\":70,\"node_id\":70,\"instance\":0,\"minimum\":0,\"maximum\":1,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"\",\"step_value\":1,\"editable\":1,\"type\":1,\"state\":1,\"last_changed\":12345555,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\"},{\"id\":71,\"node_id\":70,\"instance\":0,\"minimum\":0,\"maximum\":100,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"%25\",\"step_value\":1,\"editable\":1,\"type\":2,\"state\":1,\"last_changed\":12345555,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\"},{\"id\":72,\"node_id\":70,\"instance\":0,\"minimum\":153,\"maximum\":500,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"K\",\"step_value\":1,\"editable\":1,\"type\":42,\"state\":1,\"last_changed\":12345555,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\"},{\"id\":73,\"node_id\":70,\"instance\":0,\"minimum\":0,\"maximum\":16777215,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"\",\"step_value\":1,\"editable\":1,\"type\":23,\"state\":1,\"last_changed\":12345555,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"7001020%3B16419669%3B12026363%3B16525995\"}]","x":250,"y":860,"wires":[["57bf900f.57a508"]]},{"id":"1d8b2045.0810c","type":"hue-light","z":"9794c480.ea90d8","name":"HueGo TV","bridge":"7206028e.714fdc","lightid":"11","colornamer":true,"x":650,"y":860,"wires":[["78969f4b.74f2d"]]},{"id":"78969f4b.74f2d","type":"function","z":"9794c480.ea90d8","name":"Rückkanal on off","func":"if (msg.payload.on === true ){msg.payload.on =1}else msg.payload.on=0; \nnode.send({payload:{\"id\":70,\"value\":msg.payload.on}}),\nnode.send({payload:{\"id\":71,\"value\":msg.payload.brightness}})\n//node.send({payload:{\"id\":42,\"value\":msg.payload.colorTemp}})","outputs":1,"noerr":0,"x":870,"y":860,"wires":[["6dd18a3.4a6a0f4","37973b7f.90e564"]]},{"id":"37973b7f.90e564","type":"debug","z":"9794c480.ea90d8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1090,"y":820,"wires":[]},{"id":"57bf900f.57a508","type":"function","z":"9794c480.ea90d8","name":"RGB Funktion","func":"if (msg.payload.attributeId === 73){\nvar zahl= msg.payload.targetValue;\nvar ausgabe =\"\";\nrest(i = zahl%16);\nzahl6 = ausgabe;\nzahl = Math.floor(zahl/16);\nrest(i = zahl%16);\nzahl5 = ausgabe;\nzahl = Math.floor(zahl/16);\nrest(i = zahl%16);\nzahl4 = ausgabe;\nzahl = Math.floor(zahl/16);\nrest(i = zahl%16);\nzahl3 = ausgabe;\nzahl = Math.floor(zahl/16);\nrest(i = zahl%16);\nzahl2 = ausgabe;\nzahl = Math.floor(zahl/16);\nrest(i = zahl);\nzahl1 = ausgabe;\n\nausgabe2 = zahl1+zahl2+zahl3+zahl4+zahl5+zahl6;\n node.send({payload:{\"hex\":ausgabe2}});\n}\n\nfunction rest(){\n switch(i)\n\t\t{\n\t\t \n\t\tcase 1: ausgabe =\"1\";break;\n\t\tcase 2: ausgabe =\"2\";break;\n\t\tcase 3: ausgabe = \"3\";break;\n\t\tcase 4: ausgabe= \"4\";break;\n\t\tcase 5: ausgabe= \"5\";break;\n\t\tcase 6: ausgabe = \"6\";break;\n\t\tcase 7: ausgabe =\"7\";break; \n\t\tcase 8: ausgabe = \"8\";break;\n\t\tcase 9: ausgabe = \"9\";break;\n\t\tcase 10: ausgabe =\"A\"; break;\n\t\tcase 11: ausgabe = \"B\"; break;\n\t\tcase 12: ausgabe = \"C\"; break;\n\t\tcase 13: ausgabe =\"D\"; break;\n\t\tcase 14: ausgabe =\"E\"; break;\n\t\tcase 15: ausgabe =\"F\"; break;\n}}\n\nif (msg.payload.attributeId === 70){node.send({payload:{\"on\":msg.payload.targetValue}})}\nif (msg.payload.attributeId === 71){node.send({payload:{\"brightness\":msg.payload.targetValue}})}\nif (msg.payload.attributeId === 72){node.send({payload:{\"colorTemp\":msg.payload.targetValue}})}\n","outputs":1,"noerr":0,"x":460,"y":860,"wires":[["1d8b2045.0810c"]]},{"id":"ee920c63.33d078","type":"hue-light","z":"9794c480.ea90d8","name":"HueGo Pfanze","bridge":"7206028e.714fdc","lightid":"10","colornamer":true,"x":640,"y":760,"wires":[["1c8ca28f.a634ed"]]},{"id":"c7073da5.2d1028","type":"virtualHomee","z":"","name":"5ABC"},{"id":"7206028e.714fdc","type":"hue-bridge","z":"","name":"Philips hue","bridge":"192.168.178.102","key":"ceMSOh1lIrucnl49y22L0Fih-NlwIHr93Mv8HfFp","interval":"3000"}]
Habe mal mehrer Lampen angehangen…ich erhöhe bei jeder Lampe den Wert um id und node id ums 10…