Hallo zusammen,
ich nutze Node-BLUE um meine Hue-Lampen zu schalten und zu dimmen. Je Schalter habe ich folgende Logik implementiert, die ziemlich okay funktioniert:
Problematisch wird es, wenn ich die Lampen mit etwas anderem außer Homegear ansteuere, z.B. die Hue-App oder Alexa - dann wird nämlich der aktuelle Dimm-Status der Lampe nicht in Homegear aktualisiert:
Das führt dazu, dass ich Schalter, wenn ich Sie zuvor z.B. mit der App geschaltet habe, zweimal betätigen muss, damit etwas passiert.
Frage: Kennt ihr eine Möglichkeit, mit der ich den Status der Lampe z.B. vor Ausführung des Flows prüfe, damit ich nicht zweimal drücken muss oder gibt es z.B. eine zeitgesteuerte Schleife, mit der ich alle 10 Sekunden den Status innerhalb von Node-BLUE aktualisieren kann?
Hier ist mein aktueller Flow mit allen Tastern:
[{"id":"c6606f30.6a6c8","type":"tab","namespace":"tab","label":"Flow 1"},{"id":"944e0a88.ed0e28","type":"variable-in","namespace":"variable","z":"c6606f30.6a6c8","variabletype":"device","family":"0","peername":null,"peerid":"23","channel":"1","variable":"PRESS_SHORT","eventsource":"device","refractoryperiod":"0","outputonstartup":false,"changes-only":false,"loopprevention":false,"looppreventiongroup":"3813710f.9b426e","name":"","x":130,"y":160,"wires":[[{"id":"ad6b0fdf.eadfb","port":0}]]},{"id":"633cb213.4fd61c","type":"light","namespace":"light","z":"c6606f30.6a6c8","variabletype":"device","family":"5","peername":"Decke WZ (g)","peerid":"17","channel":"1","variable":"BRIGHTNESS","lighttype":"dimmerstate","offvalue":"0","onvalue":"250","offvalue2":"0","minvalue":"15","maxvalue":"100","step":"1","factor":"0.03","interval":"100","twoinputs":true,"inputs":2,"name":"","x":725,"y":290,"wires":[]},{"id":"ad6b0fdf.eadfb","type":"variable-switch","namespace":"basic-logic","z":"c6606f30.6a6c8","name":"","variabletype":"device","family":"5","peername":"Decke WZ (g)","peerid":"17","channel":"1","variable":"BRIGHTNESS","changes-only":true,"output-true":true,"output-false":false,"rules":[{"t":"gt","v":"0","vt":"int"},{"t":"eq","v":"0","vt":"int"}],"checkall":"true","inputs":1,"outputs":2,"x":425,"y":290,"wires":[[{"id":"633cb213.4fd61c","port":1}],[{"id":"633cb213.4fd61c","port":0}]]},{"id":"2d3aacdb.d3e564","type":"variable-in","namespace":"variable","z":"c6606f30.6a6c8","variabletype":"device","family":"0","peername":null,"peerid":"23","channel":"1","variable":"PRESS_LONG","eventsource":"device","refractoryperiod":"0","outputonstartup":false,"changes-only":false,"loopprevention":false,"looppreventiongroup":"3813710f.9b426e","name":"","x":125,"y":80,"wires":[[{"id":"f04482d8.08ab5","port":0}]]},{"id":"8d4cfb4d.ba4f38","type":"variable-in","namespace":"variable","z":"c6606f30.6a6c8","variabletype":"device","family":"0","peername":null,"peerid":"23","channel":"1","variable":"PRESS_LONG_RELEASE","eventsource":"device","refractoryperiod":"0","outputonstartup":false,"changes-only":false,"loopprevention":false,"looppreventiongroup":"3813710f.9b426e","name":"","x":155,"y":120,"wires":[[{"id":"7de91e04.4ff2f","port":0}]]},{"id":"cf6ca86b.4493c8","type":"light","namespace":"light","z":"c6606f30.6a6c8","variabletype":"device","family":"5","peername":"Decke WZ (g)","peerid":"17","channel":"1","variable":"BRIGHTNESS","lighttype":"dimmer","offvalue":"0","onvalue":"100","offvalue2":"0","minvalue":"0","maxvalue":"250","step":"50","factor":"0","interval":"1000","twoinputs":false,"inputs":3,"name":"","x":720,"y":150,"wires":[]},{"id":"7de91e04.4ff2f","type":"change","namespace":"basic-logic","z":"c6606f30.6a6c8","name":"","rules":[{"p":"payload","pt":"message","t":"set","to":"false","tot":"bool"}],"x":350,"y":190,"wires":[[{"id":"cf6ca86b.4493c8","port":1},{"id":"cf6ca86b.4493c8","port":2}]]},{"id":"f04482d8.08ab5","type":"variable-switch","namespace":"basic-logic","z":"c6606f30.6a6c8","name":"","variabletype":"device","family":"5","peername":"Decke WZ (g)","peerid":"17","channel":"1","variable":"BRIGHTNESS","changes-only":false,"output-true":true,"output-false":false,"rules":[{"t":"gt","v":"0","vt":"int"},{"t":"eq","v":"0","vt":"int"}],"checkall":"true","inputs":1,"outputs":2,"x":425,"y":80,"wires":[[{"id":"cf6ca86b.4493c8","port":2}],[{"id":"cf6ca86b.4493c8","port":1}]]},{"id":"9083c31a.8a33b","type":"comment","namespace":"comment","z":"c6606f30.6a6c8","name":"Lichtschalter Decke WZ (g)","info":"","x":140,"y":40,"wires":[]},{"id":"2fa5bd8c.a15b92","type":"variable-in","namespace":"variable","z":"c6606f30.6a6c8","variabletype":"device","family":"0","peername":null,"peerid":"22","channel":"1","variable":"PRESS_SHORT","eventsource":"device","refractoryperiod":"0","outputonstartup":false,"changes-only":false,"loopprevention":false,"looppreventiongroup":"3813710f.9b426e","name":"","x":130,"y":480,"wires":[[{"id":"4db339a4.edaba8","port":0}]]},{"id":"b00b64a6.23e0c8","type":"light","namespace":"light","z":"c6606f30.6a6c8","variabletype":"device","family":"5","peername":"Decke BZ","peerid":"3","channel":"1","variable":"BRIGHTNESS","lighttype":"dimmerstate","offvalue":"0","onvalue":"254","offvalue2":"0","minvalue":"15","maxvalue":"100","step":"1","factor":"0.03","interval":"100","twoinputs":true,"inputs":2,"name":"","x":715,"y":610,"wires":[]},{"id":"4db339a4.edaba8","type":"variable-switch","namespace":"basic-logic","z":"c6606f30.6a6c8","name":"","variabletype":"device","family":"5","peername":"Decke BZ","peerid":"3","channel":"1","variable":"BRIGHTNESS","changes-only":true,"output-true":true,"output-false":false,"rules":[{"t":"gt","v":"0","vt":"int"},{"t":"eq","v":"0","vt":"int"}],"checkall":"true","inputs":1,"outputs":2,"x":415,"y":610,"wires":[[{"id":"b00b64a6.23e0c8","port":1}],[{"id":"b00b64a6.23e0c8","port":0}]]},{"id":"e438ae33.1ce34","type":"variable-in","namespace":"variable","z":"c6606f30.6a6c8","variabletype":"device","family":"0","peername":null,"peerid":"22","channel":"1","variable":"PRESS_LONG","eventsource":"device","refractoryperiod":"0","outputonstartup":false,"changes-only":false,"loopprevention":false,"looppreventiongroup":"3813710f.9b426e","name":"","x":125,"y":400,"wires":[[{"id":"a5615668.fb68f8","port":0}]]},{"id":"c3982ed4.64434","type":"variable-in","namespace":"variable","z":"c6606f30.6a6c8","variabletype":"device","family":"0","peername":null,"peerid":"22","channel":"1","variable":"PRESS_LONG_RELEASE","eventsource":"device","refractoryperiod":"0","outputonstartup":false,"changes-only":false,"loopprevention":false,"looppreventiongroup":"3813710f.9b426e","name":"","x":155,"y":440,"wires":[[{"id":"80d4ca6.4ae3a38","port":0}]]},{"id":"993c377d.a00cb8","type":"light","namespace":"light","z":"c6606f30.6a6c8","variabletype":"device","family":"5","peername":"Decke BZ","peerid":"3","channel":"1","variable":"BRIGHTNESS","lighttype":"dimmer","offvalue":"0","onvalue":"100","offvalue2":"0","minvalue":"0","maxvalue":"254","step":"50","factor":"0","interval":"1000","twoinputs":false,"inputs":3,"name":"","x":715,"y":470,"wires":[]},{"id":"80d4ca6.4ae3a38","type":"change","namespace":"basic-logic","z":"c6606f30.6a6c8","name":"","rules":[{"p":"payload","pt":"message","t":"set","to":"false","tot":"bool"}],"x":350,"y":510,"wires":[[{"id":"993c377d.a00cb8","port":1},{"id":"993c377d.a00cb8","port":2}]]},{"id":"a5615668.fb68f8","type":"variable-switch","namespace":"basic-logic","z":"c6606f30.6a6c8","name":"","variabletype":"device","family":"5","peername":"Decke BZ","peerid":"3","channel":"1","variable":"BRIGHTNESS","changes-only":false,"output-true":true,"output-false":false,"rules":[{"t":"gt","v":"0","vt":"int"},{"t":"eq","v":"0","vt":"int"}],"checkall":"true","inputs":1,"outputs":2,"x":415,"y":400,"wires":[[{"id":"993c377d.a00cb8","port":2}],[{"id":"993c377d.a00cb8","port":1}]]},{"id":"1a0cef6f.a73981","type":"comment","namespace":"comment","z":"c6606f30.6a6c8","name":"Lichtschalter Decke BZ","info":"","x":130,"y":360,"wires":[]},{"id":"d1c9a39b.1f94e","type":"variable-in","namespace":"variable","z":"c6606f30.6a6c8","variabletype":"device","family":"0","peername":null,"peerid":"24","channel":"1","variable":"PRESS_SHORT","eventsource":"device","refractoryperiod":"0","outputonstartup":false,"changes-only":false,"loopprevention":false,"looppreventiongroup":"3813710f.9b426e","name":"","x":130,"y":800,"wires":[[{"id":"e5440f66.e8d25","port":0}]]},{"id":"87ea8cfa.d0592","type":"light","namespace":"light","z":"c6606f30.6a6c8","variabletype":"device","family":"5","peername":"Decke DL klein (g)","peerid":"18","channel":"1","variable":"BRIGHTNESS","lighttype":"dimmerstate","offvalue":"0","onvalue":"254","offvalue2":"0","minvalue":"15","maxvalue":"100","step":"1","factor":"0.03","interval":"100","twoinputs":true,"inputs":2,"name":"","x":740,"y":930,"wires":[]},{"id":"e5440f66.e8d25","type":"variable-switch","namespace":"basic-logic","z":"c6606f30.6a6c8","name":"","variabletype":"device","family":"5","peername":"Decke DL klein (g)","peerid":"18","channel":"1","variable":"BRIGHTNESS","changes-only":true,"output-true":true,"output-false":false,"rules":[{"t":"gt","v":"0","vt":"int"},{"t":"eq","v":"0","vt":"int"}],"checkall":"true","inputs":1,"outputs":2,"x":440,"y":930,"wires":[[{"id":"87ea8cfa.d0592","port":1}],[{"id":"87ea8cfa.d0592","port":0}]]},{"id":"c9566558.2858d8","type":"variable-in","namespace":"variable","z":"c6606f30.6a6c8","variabletype":"device","family":"0","peername":null,"peerid":"24","channel":"1","variable":"PRESS_LONG","eventsource":"device","refractoryperiod":"0","outputonstartup":false,"changes-only":false,"loopprevention":false,"looppreventiongroup":"3813710f.9b426e","name":"","x":125,"y":720,"wires":[[{"id":"5024e7b0.958248","port":0}]]},{"id":"7f7beea7.53a96","type":"variable-in","namespace":"variable","z":"c6606f30.6a6c8","variabletype":"device","family":"0","peername":null,"peerid":"24","channel":"1","variable":"PRESS_LONG_RELEASE","eventsource":"device","refractoryperiod":"0","outputonstartup":false,"changes-only":false,"loopprevention":false,"looppreventiongroup":"3813710f.9b426e","name":"","x":155,"y":760,"wires":[[{"id":"21e961f2.3a028e","port":0}]]},{"id":"a63f1620.7f4e98","type":"light","namespace":"light","z":"c6606f30.6a6c8","variabletype":"device","family":"5","peername":"Decke DL klein (g)","peerid":"18","channel":"1","variable":"BRIGHTNESS","lighttype":"dimmer","offvalue":"0","onvalue":"100","offvalue2":"0","minvalue":"0","maxvalue":"254","step":"50","factor":"0","interval":"1000","twoinputs":false,"inputs":3,"name":"","x":740,"y":790,"wires":[]},{"id":"21e961f2.3a028e","type":"change","namespace":"basic-logic","z":"c6606f30.6a6c8","name":"","rules":[{"p":"payload","pt":"message","t":"set","to":"false","tot":"bool"}],"x":350,"y":830,"wires":[[{"id":"a63f1620.7f4e98","port":1},{"id":"a63f1620.7f4e98","port":2}]]},{"id":"5024e7b0.958248","type":"variable-switch","namespace":"basic-logic","z":"c6606f30.6a6c8","name":"","variabletype":"device","family":"5","peername":"Decke DL klein (g)","peerid":"18","channel":"1","variable":"BRIGHTNESS","changes-only":false,"output-true":true,"output-false":false,"rules":[{"t":"gt","v":"0","vt":"int"},{"t":"eq","v":"0","vt":"int"}],"checkall":"true","inputs":1,"outputs":2,"x":440,"y":720,"wires":[[{"id":"a63f1620.7f4e98","port":2}],[{"id":"a63f1620.7f4e98","port":1}]]},{"id":"e0ca2f22.2e58e","type":"comment","namespace":"comment","z":"c6606f30.6a6c8","name":"Lichtschalter Decke DL klein (g)","info":"","x":150,"y":680,"wires":[]},{"id":"8a8336dd.0fddf8","type":"variable-in","namespace":"variable","z":"c6606f30.6a6c8","variabletype":"device","family":"0","peername":null,"peerid":"28","channel":"1","variable":"PRESS_SHORT","eventsource":"device","refractoryperiod":"0","outputonstartup":false,"changes-only":false,"loopprevention":false,"looppreventiongroup":"3813710f.9b426e","name":"","x":1040,"y":70,"wires":[[{"id":"ad6b0fdf.eadfb","port":0}]]},{"id":"aeeac50d.3d0288","type":"variable-in","namespace":"variable","z":"c6606f30.6a6c8","variabletype":"device","family":"0","peername":null,"peerid":"28","channel":"2","variable":"PRESS_SHORT","eventsource":"device","refractoryperiod":"0","outputonstartup":false,"changes-only":false,"loopprevention":false,"looppreventiongroup":"3813710f.9b426e","name":"","x":1040,"y":110,"wires":[[{"id":"ad6b0fdf.eadfb","port":0}]]},{"id":"17b7f75b.fd7f49","type":"comment","namespace":"comment","z":"c6606f30.6a6c8","name":"temporär","info":"","x":1010,"y":30,"wires":[]},{"id":"bcf7187d.3b3948","type":"variable-in","namespace":"variable","z":"c6606f30.6a6c8","variabletype":"device","family":"0","peername":null,"peerid":"34","channel":"1","variable":"PRESS_SHORT","eventsource":"device","refractoryperiod":"0","outputonstartup":false,"changes-only":false,"loopprevention":false,"looppreventiongroup":"3813710f.9b426e","name":"","x":130,"y":1120,"wires":[[{"id":"44596f3.25fb39","port":0}]]},{"id":"c1a7907d.73b0c","type":"light","namespace":"light","z":"c6606f30.6a6c8","variabletype":"device","family":"5","peername":"Decke AZ (g)","peerid":"33","channel":"1","variable":"BRIGHTNESS","lighttype":"dimmerstate","offvalue":"0","onvalue":"250","offvalue2":"0","minvalue":"15","maxvalue":"100","step":"1","factor":"0.03","interval":"100","twoinputs":true,"inputs":2,"name":"","x":725,"y":1250,"wires":[]},{"id":"44596f3.25fb39","type":"variable-switch","namespace":"basic-logic","z":"c6606f30.6a6c8","name":"","variabletype":"device","family":"5","peername":"Decke AZ (g)","peerid":"33","channel":"1","variable":"BRIGHTNESS","changes-only":true,"output-true":true,"output-false":false,"rules":[{"t":"gt","v":"0","vt":"int"},{"t":"eq","v":"0","vt":"int"}],"checkall":"true","inputs":1,"outputs":2,"x":425,"y":1250,"wires":[[{"id":"c1a7907d.73b0c","port":1}],[{"id":"c1a7907d.73b0c","port":0}]]},{"id":"53c9852d.03f91c","type":"variable-in","namespace":"variable","z":"c6606f30.6a6c8","variabletype":"device","family":"0","peername":null,"peerid":"34","channel":"1","variable":"PRESS_LONG","eventsource":"device","refractoryperiod":"0","outputonstartup":false,"changes-only":false,"loopprevention":false,"looppreventiongroup":"3813710f.9b426e","name":"","x":125,"y":1040,"wires":[[{"id":"7b147043.355c6","port":0}]]},{"id":"d230ab6.5142658","type":"variable-in","namespace":"variable","z":"c6606f30.6a6c8","variabletype":"device","family":"0","peername":null,"peerid":"34","channel":"1","variable":"PRESS_LONG_RELEASE","eventsource":"device","refractoryperiod":"0","outputonstartup":false,"changes-only":false,"loopprevention":false,"looppreventiongroup":"3813710f.9b426e","name":"","x":155,"y":1080,"wires":[[{"id":"cf0accaf.0f3c6","port":0}]]},{"id":"9546a997.c2cc48","type":"light","namespace":"light","z":"c6606f30.6a6c8","variabletype":"device","family":"5","peername":"Decke AZ (g)","peerid":"33","channel":"1","variable":"BRIGHTNESS","lighttype":"dimmer","offvalue":"0","onvalue":"100","offvalue2":"0","minvalue":"0","maxvalue":"250","step":"50","factor":"0","interval":"1000","twoinputs":false,"inputs":3,"name":"","x":720,"y":1110,"wires":[]},{"id":"cf0accaf.0f3c6","type":"change","namespace":"basic-logic","z":"c6606f30.6a6c8","name":"","rules":[{"p":"payload","pt":"message","t":"set","to":"false","tot":"bool"}],"x":350,"y":1150,"wires":[[{"id":"9546a997.c2cc48","port":1},{"id":"9546a997.c2cc48","port":2}]]},{"id":"7b147043.355c6","type":"variable-switch","namespace":"basic-logic","z":"c6606f30.6a6c8","name":"","variabletype":"device","family":"5","peername":"Decke AZ (g)","peerid":"33","channel":"1","variable":"BRIGHTNESS","changes-only":false,"output-true":true,"output-false":false,"rules":[{"t":"gt","v":"0","vt":"int"},{"t":"eq","v":"0","vt":"int"}],"checkall":"true","inputs":1,"outputs":2,"x":425,"y":1040,"wires":[[{"id":"9546a997.c2cc48","port":2}],[{"id":"9546a997.c2cc48","port":1}]]},{"id":"8f040c76.a6d1","type":"comment","namespace":"comment","z":"c6606f30.6a6c8","name":"Lichtschalter Decke AZ (g)","info":"","x":140,"y":1000,"wires":[]},{"id":"3813710f.9b426e","type":"variable-loop-prevention-group","namespace":"variable","z":"","uniqueid":"1","refractoryperiod":"1000"}]