Philips hue dimmer deconz node red double click?

hi
is it somehow possible to make a double click working in node red for deconz?
i made this with another usb stick with zigbe2mqtt but the stick was not stable.

would be great if someone has an idea/hint?

Give this a try


I have never used it specifically with a remote from deCONZ but I do use it to detect various multi-click inputs from wifi switches and it works great for them.

Thank you josh :slight_smile: i had that idea too, but just found this one


for x devices

I think with your suggestion it should work :smiley: I’ll give you an update and post the code afterwards, thanks :hugs:

thank you very munch @mjoshd its working like a charm!!! :slight_smile:

[{"id":"33a219a8.cf1596","type":"tab","label":"Esszimmer","disabled":false,"info":""},{"id":"d4e1815c.875ef","type":"function","z":"33a219a8.cf1596","name":"Flow variables","func":"//node.warn(msg)\nvar time = new Date();\nvar displaytime = time.toLocaleTimeString();\nvar hour = time.getHours();\n\nif ( msg.payload == \"below_horizon\" ) { //night\n    if (hour <= 1 ){\n        flow.set('brightness_pct_common', 20);\n    }else if (hour > 1 && hour <=6 ){\n        flow.set('brightness_pct_common', 0);\n    }else if (hour >= 22 ){\n        flow.set('brightness_pct_common', 60);\n    }else if (hour >= 23 ){\n        flow.set('brightness_pct_common', 40);\n    }else{\n        flow.set('brightness_pct_common', 100);\n    }\n}else {//if (msg.payload == \"above_horizon\"){//over day\n    flow.set('brightness_pct_common', 20);\n}\nglobal.set('EsszimmerschalterPressed', 0);\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":260,"y":60,"wires":[[]]},{"id":"7890ee1c.65c9c","type":"switch","z":"33a219a8.cf1596","name":"","property":"payload.buttonevent","propertyType":"msg","rules":[{"t":"eq","v":"1002","vt":"num"},{"t":"eq","v":"2002","vt":"num"},{"t":"eq","v":"3002","vt":"num"},{"t":"eq","v":"4002","vt":"num"}],"checkall":"true","repair":false,"outputs":4,"x":350,"y":300,"wires":[["9f6b4a07.c08478","ced592f5.e6a4e"],["9f6b4a07.c08478","3f544b51.372ee4"],["9f6b4a07.c08478","4d41e7db.fd7c68"],["1ed6ed96.b4a262","92259b6a.545548"]]},{"id":"1c5fbbc9.270734","type":"comment","z":"33a219a8.cf1596","name":"When a button is pressed on a Hue Dimmer","info":"","x":170,"y":120,"wires":[]},{"id":"d7908296.6c4ae","type":"comment","z":"33a219a8.cf1596","name":"Flow variables","info":"","x":70,"y":20,"wires":[]},{"id":"4b547101.eb06a","type":"server-state-changed","z":"33a219a8.cf1596","name":"Sun state","server":"5d852d6b.2bde94","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sun.sun","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":80,"y":60,"wires":[["d4e1815c.875ef"]]},{"id":"9f6b4a07.c08478","type":"change","z":"33a219a8.cf1596","name":"EsszimmerschalterPressed 1","rules":[{"t":"set","p":"EsszimmerschalterPressed","pt":"global","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":160,"y":220,"wires":[[]]},{"id":"1ed6ed96.b4a262","type":"change","z":"33a219a8.cf1596","name":"EsszimmerschalterPressed 0","rules":[{"t":"set","p":"EsszimmerschalterPressed","pt":"global","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":160,"y":360,"wires":[[]]},{"id":"5507dc.bee17824","type":"switch","z":"33a219a8.cf1596","name":"EsszimmerschalterPressed?","property":"EsszimmerschalterPressed","propertyType":"global","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":360,"y":580,"wires":[[],["41cbcf44.6b58f"]]},{"id":"2e97dcdd.00e344","type":"switch","z":"33a219a8.cf1596","name":"on / off","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"},{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":610,"y":620,"wires":[["1795ca73.967666"],["d9b7d644.d55ec8","1795ca73.967666","725421cd.d2601"]]},{"id":"1795ca73.967666","type":"trigger","z":"33a219a8.cf1596","name":"5 min","op1":"","op2":"off","op1type":"nul","op2type":"str","duration":"5","extend":false,"units":"min","reset":"on","bytopic":"all","topic":"topic","outputs":1,"x":770,"y":600,"wires":[["3b48276.695c2d8"]]},{"id":"3b48276.695c2d8","type":"api-current-state","z":"33a219a8.cf1596","name":"info sensor","server":"5d852d6b.2bde94","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"group.sensoren_esszimmer","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":950,"y":600,"wires":[[],["b493ae3f.2b85","16452f83.16273"]]},{"id":"e92e19fa.3589b8","type":"comment","z":"33a219a8.cf1596","name":"Motion detection","info":"","x":80,"y":540,"wires":[]},{"id":"d9b9c066.6ca37","type":"server-state-changed","z":"33a219a8.cf1596","name":"Sensoren Esszimmer","server":"5d852d6b.2bde94","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"group.sensoren_esszimmer","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":120,"y":600,"wires":[["5507dc.bee17824"]]},{"id":"fe4764c5.d074a8","type":"api-call-service","z":"33a219a8.cf1596","name":"Esstisch an","server":"5d852d6b.2bde94","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.esstisch_esstisch","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":990,"y":180,"wires":[[]]},{"id":"692825a5.84280c","type":"api-call-service","z":"33a219a8.cf1596","name":"Luster an","server":"5d852d6b.2bde94","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.luster_luster","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":980,"y":240,"wires":[[]]},{"id":"3f544b51.372ee4","type":"api-call-service","z":"33a219a8.cf1596","name":"Gruppe Esszimmer an","server":"5d852d6b.2bde94","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"group.esszimmer_licht_aktor","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":740,"y":260,"wires":[[]]},{"id":"16452f83.16273","type":"api-call-service","z":"33a219a8.cf1596","name":"Esstisch aus","server":"5d852d6b.2bde94","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.esstisch_esstisch","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":990,"y":380,"wires":[[]]},{"id":"b6a1c72b.b4b6d8","type":"api-call-service","z":"33a219a8.cf1596","name":"Luster aus","server":"5d852d6b.2bde94","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.luster_luster","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":990,"y":440,"wires":[[]]},{"id":"4d41e7db.fd7c68","type":"api-call-service","z":"33a219a8.cf1596","name":"Gruppe Esszimmer aus","server":"5d852d6b.2bde94","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"group.esszimmer_licht_aktor","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":750,"y":320,"wires":[[]]},{"id":"d9b7d644.d55ec8","type":"api-call-service","z":"33a219a8.cf1596","name":"Esstisch an","server":"5d852d6b.2bde94","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.esstisch_esstisch","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":790,"y":660,"wires":[[]]},{"id":"725421cd.d2601","type":"change","z":"33a219a8.cf1596","name":"EsszimmerMotion 1","rules":[{"t":"set","p":"EsszimmerMotion","pt":"global","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":740,"wires":[[]]},{"id":"b493ae3f.2b85","type":"change","z":"33a219a8.cf1596","name":"EsszimmerMotion 0","rules":[{"t":"set","p":"EsszimmerMotion","pt":"global","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1170,"y":580,"wires":[[]]},{"id":"f8d66797.d09de8","type":"deconz-input","z":"33a219a8.cf1596","name":"","server":"9780c254.ab1d9","device":"00:17:88:01:06:35:bd:3f-02-fc00","device_name":"Esszimmerschalter : ZHASwitch","topic":"","state":"0","output":"always","outputAtStartup":false,"x":130,"y":280,"wires":[["7890ee1c.65c9c"],[]]},{"id":"ced592f5.e6a4e","type":"timed-counter","z":"33a219a8.cf1596","name":"click counter","timelimit":"800","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":530,"y":200,"wires":[["4e6e87dc.4626e8"]]},{"id":"4e6e87dc.4626e8","type":"switch","z":"33a219a8.cf1596","name":"clicks","property":"count","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"gte","v":"2","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":690,"y":200,"wires":[["fe4764c5.d074a8"],["692825a5.84280c"]]},{"id":"92259b6a.545548","type":"timed-counter","z":"33a219a8.cf1596","name":"click counter","timelimit":"800","timeunit":"1","withhold":true,"fixedtimeout":false,"pertopic":false,"x":530,"y":380,"wires":[["18ffcb9c.4c0a34"]]},{"id":"18ffcb9c.4c0a34","type":"switch","z":"33a219a8.cf1596","name":"clicks","property":"count","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"gte","v":"2","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":690,"y":380,"wires":[["16452f83.16273"],["b6a1c72b.b4b6d8"]]},{"id":"41cbcf44.6b58f","type":"time-range-switch","z":"33a219a8.cf1596","name":"","lat":"48.139970","lon":"11.671600","startTime":"01:00","endTime":"06:00","startOffset":0,"endOffset":0,"x":410,"y":640,"wires":[[],["2e97dcdd.00e344"]]},{"id":"5d852d6b.2bde94","type":"server","z":"","name":"Home Assistant Adem","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true},{"id":"9780c254.ab1d9","type":"deconz-server","z":"","name":"conbee2","ip":"192.168.2.49","port":"40850","apikey":"57815C6C64","ws_port":"8081","secure":false,"polling":"15"}]
2 Likes