Using Hue Dimmer to brighten and dim light with Node-Red (via Zigbee2mqtt)

Hi @flecmart, thank you for sharing this. I am really new to Home Assistant and this has been really helpful. I had a couple of questions if that’s ok. Can I assume that the brightness is a variable being stored on the Hue dimmer itself? If I was to change the brightness using my Google Home or in Home Assistant, then shouldn’t shouldn’t the variable on the switch be updated to match?

Hi @Disco,

I’m happy to hear my shared code helped out someone! The switch entity in home assistant has a brightness attribute that changes when you hit the two middle buttons:

These attributes are passed in the msg.data.new_state object (you can see the message output with a debug node):

My code just extracts the brightness from msg.data.new_state.attributes.brightness and passes it directly as brightness data to the target bulb. This might not be obvious because when calling light.turn_on the brightness from the payloads data object is set implicitly.

I just tried if the attribute updates when you change the lights’ brightness via home assistant and it does not for me. It seems the switch entity persists its own state. If this is a problem for you, you could just extract the brightness attribute from the bulb and then add or sub a fixed delta to change the brightness (like in some other posts I think). Or you could update the attribute explicitly with another automation :smiley:

1 Like

Thank you @flecmart , I have added a state node which activates when the brightness changes and feeds it back to the dimmer attributes.brightness using the Home Assistant API. Possibly not the most elegant code but it does seem to work.

1 Like

@nikipore sorry to necro this, but would you be able to share the complete flow’s JSON?

Sure, although I thought I already had. The flow has changed somewhat in the meantime, because we moved to a new place, but the core logic remains the same.

[{"id":"7552153.4e951ec","type":"counter","z":"9bf7fb6e.7aac88","name":"Counter","init":"-2","step":"1","lower":null,"upper":null,"mode":"increment","outputs":"1","x":600,"y":620,"wires":[["c7844871.e15cf8"]]},{"id":"d2b81a0c.fa4bd8","type":"switch","z":"9bf7fb6e.7aac88","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on-press","vt":"str"},{"t":"eq","v":"off-press","vt":"str"},{"t":"regex","v":"(on|off)-hold.*","vt":"str","case":false},{"t":"regex","v":"(up|down)-.*","vt":"str","case":false}],"checkall":"true","repair":false,"outputs":4,"x":530,"y":740,"wires":[["7552153.4e951ec","f6acd4d6f608e575"],["4513a2f6.285aec"],["d82fe7f7.84eb18"],["e956b082.c755c"]]},{"id":"e40533f0.26caf","type":"change","z":"9bf7fb6e.7aac88","name":"Reset","rules":[{"t":"set","p":"reset","pt":"msg","to":"-2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":620,"wires":[["7552153.4e951ec"]]},{"id":"c7844871.e15cf8","type":"switch","z":"9bf7fb6e.7aac88","name":"ON?","property":"count","propertyType":"msg","rules":[{"t":"gte","v":"-1","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":730,"y":620,"wires":[["ed1d1058.9f5aa"]]},{"id":"ce73a8c4.9f65a8","type":"mqtt in","z":"9bf7fb6e.7aac88","name":"schlafzimmer-dimmer-2","topic":"zigbee2mqtt/schlafzimmer-dimmer-2/action","qos":"2","datatype":"auto","broker":"8932bf10.56a6b","nl":false,"rap":false,"inputs":0,"x":300,"y":780,"wires":[["d2b81a0c.fa4bd8"]]},{"id":"e1275ee5.1664d","type":"mqtt in","z":"9bf7fb6e.7aac88","name":"schlafzimmer-dimmer-1","topic":"zigbee2mqtt/schlafzimmer-dimmer-1/action","qos":"2","datatype":"auto","broker":"8932bf10.56a6b","nl":false,"rap":false,"inputs":0,"x":300,"y":720,"wires":[["d2b81a0c.fa4bd8"]]},{"id":"f6acd4d6f608e575","type":"api-call-service","z":"9bf7fb6e.7aac88","name":"Lichtschalter Schlafzimmer","server":"a0992e23.0acf8","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.licht_schlafzimmer","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":760,"y":700,"wires":[[]]},{"id":"4513a2f6.285aec","type":"function","z":"9bf7fb6e.7aac88","name":"off-press","func":"return {payload: {state: \"OFF\", transition: 0.5}};","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1000,"y":740,"wires":[["e91cbd9c.8a503"]]},{"id":"d82fe7f7.84eb18","type":"function","z":"9bf7fb6e.7aac88","name":"(on|off)-hold.*","func":"payload = {\n    \"on-hold\": {color_temp_move: 60},\n    \"off-hold\": {color_temp_move: -60},\n    \"on-hold-release\": {color_temp_move: \"stop\"},\n    \"off-hold-release\": {color_temp_move: \"stop\"}\n}[msg.payload];\n\nreturn {payload: payload};\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1020,"y":780,"wires":[["e91cbd9c.8a503"]]},{"id":"e956b082.c755c","type":"function","z":"9bf7fb6e.7aac88","name":"(up|down)-.*","func":"payload = {\n    \"up-press\": {brightness_step: 40, transition: 0.5},\n    \"down-press\": {brightness_step: -40, transition: 0.5},\n    \"up-hold\": {brightness_move: 80},\n    \"down-hold\": {brightness_move: -80},\n    \"up-hold-release\": {brightness_move: 0},\n    \"down-hold-release\": {brightness_move: 0}\n}[msg.payload];\n\nreturn {payload: payload};\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1010,"y":820,"wires":[["e91cbd9c.8a503"]]},{"id":"1b5574b7.ab40fb","type":"switch","z":"9bf7fb6e.7aac88","name":"OFF?","property":"payload.state","propertyType":"msg","rules":[{"t":"eq","v":"OFF","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":330,"y":620,"wires":[["e40533f0.26caf"]]},{"id":"ed1d1058.9f5aa","type":"function","z":"9bf7fb6e.7aac88","name":"on-press","func":"const startup_scene = {brightness: 254, color_temp: 370};\nconst additional_scenes = [\n    {brightness: 254, color: {x: 0.314951744809611, y: 0.325010746064094}, color_temp: 346}, // activate\n    {brightness: 254, color: {x: 0.314951744809611, y: 0.325010746064094}, color_temp: 156}, // reading\n    {brightness: 213, color: {x:0.435684, y: 0.281409}, color_temp: 416}, // spring flowers\n    {brightness: 77, color :{x: 0.458227749642249, y: 0.410224893445347}, color_temp: 367} // dimmed\n] || []; // && to exclude, || to include additional scenes\n\nconst scenes = [\n    startup_scene\n    , ...additional_scenes\n];\n\nvar payload = {state: \"ON\", transition: 0.5};\nif (msg.count > -1) {\n    Object.assign(\n        payload,\n        scenes[msg.count % scenes.length] // round robin\n    );\n}\n\nreturn {payload: payload};\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1000,"y":700,"wires":[["e91cbd9c.8a503"]]},{"id":"e91cbd9c.8a503","type":"mqtt out","z":"9bf7fb6e.7aac88","name":"group-schlafzimmer","topic":"zigbee2mqtt/group-schlafzimmer/set","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"8932bf10.56a6b","x":1300,"y":760,"wires":[]},{"id":"47633ec0.d10ce","type":"mqtt in","z":"9bf7fb6e.7aac88","name":"schlafzimmer-1","topic":"zigbee2mqtt/schlafzimmer-1","qos":"2","datatype":"json","broker":"8932bf10.56a6b","nl":false,"rap":false,"inputs":0,"x":120,"y":620,"wires":[["1b5574b7.ab40fb"]]},{"id":"8932bf10.56a6b","type":"mqtt-broker","name":"","broker":"core-mosquitto","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"a0992e23.0acf8","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]

If you have bulbs which support move or step such as hue or tradfri and use mqtt you can call the function direct, this provides a smooth dimmer

https://www.zigbee2mqtt.io/devices/9290012573A.html#philips-9290012573a

The input sets the mqtt topic to the light or light group as required

Hue Button

[{"id":"3bd4aff4eb43e407","type":"server-state-changed","z":"57de1c107950bd0e","name":"Button","server":"c3ff098b2bd1c58b","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.hue_button_office_pendant_action","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"zigbee2mqtt/Office Pendant/set","valueType":"str"}],"x":250,"y":180,"wires":[["e0f31b9b6a063632"]]},{"id":"e0f31b9b6a063632","type":"switch","z":"57de1c107950bd0e","name":"Button Action","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"},{"t":"eq","v":"skip_forward","vt":"str"},{"t":"eq","v":"skip_backward","vt":"str"},{"t":"eq","v":"release","vt":"str"}],"checkall":"false","repair":false,"outputs":5,"x":450,"y":180,"wires":[["84b14356933b913b"],["84b14356933b913b"],["30bf8cc1d99b46c2"],["b0d185a3cc7a94c4"],["433aca65efe45f00","08e94fa2558cc7c2"]]},{"id":"84b14356933b913b","type":"mqtt out","z":"57de1c107950bd0e","name":"","topic":"","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"217472f.ad9218e","x":910,"y":160,"wires":[]},{"id":"db676fc3e7dde401","type":"change","z":"57de1c107950bd0e","name":"move up","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"brightness_move\": 40}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":920,"y":220,"wires":[["84b14356933b913b"]]},{"id":"08e94fa2558cc7c2","type":"change","z":"57de1c107950bd0e","name":"stop","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"brightness_move\": 0}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":910,"y":300,"wires":[["84b14356933b913b"]]},{"id":"4ce90364f69e2bce","type":"change","z":"57de1c107950bd0e","name":"move down","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"brightness_move\": -40}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":930,"y":260,"wires":[["84b14356933b913b"]]},{"id":"30bf8cc1d99b46c2","type":"trigger","z":"57de1c107950bd0e","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"0","extend":false,"overrideDelay":false,"units":"ms","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":740,"y":220,"wires":[["db676fc3e7dde401"]]},{"id":"b0d185a3cc7a94c4","type":"trigger","z":"57de1c107950bd0e","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"0","extend":false,"overrideDelay":false,"units":"ms","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":740,"y":260,"wires":[["4ce90364f69e2bce"]]},{"id":"433aca65efe45f00","type":"change","z":"57de1c107950bd0e","name":"reset","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":280,"wires":[["b0d185a3cc7a94c4","30bf8cc1d99b46c2"]]},{"id":"c3ff098b2bd1c58b","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30"},{"id":"217472f.ad9218e","type":"mqtt-broker","name":"","broker":"localhost","port":"1883","clientid":"","autoConnect":true,"usetls":false,"compatmode":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willRetain":"false","willPayload":"","willMsg":{},"sessionExpiry":""}]

Hue Remote

[{"id":"e058bc594eb976be","type":"switch","z":"c9050df8947b405a","name":"Remote Action","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on-press","vt":"str"},{"t":"eq","v":"off-press","vt":"str"},{"t":"eq","v":"up-press","vt":"str"},{"t":"eq","v":"down-press","vt":"str"},{"t":"eq","v":"up-hold","vt":"str"},{"t":"eq","v":"down-hold","vt":"str"},{"t":"eq","v":"up-hold-release","vt":"str"},{"t":"eq","v":"down-hold-release","vt":"str"}],"checkall":"false","repair":false,"outputs":8,"x":460,"y":280,"wires":[["5cc4ffff1538ab4e"],["e5c30f49bb364323"],["eb9d1af1101236cb"],["a0759c55fd117fb1"],["7d84bc64cace07a9"],["134f64c4be152f86"],["a5796460c770bce2","5977b0de8e160f2f"],["a5796460c770bce2","5977b0de8e160f2f"]]},{"id":"a5796460c770bce2","type":"change","z":"c9050df8947b405a","name":"reset","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":380,"wires":[["134f64c4be152f86","7d84bc64cace07a9"]]},{"id":"e06b791a05bc0e74","type":"server-state-changed","z":"c9050df8947b405a","name":"Remote","server":"c3ff098b2bd1c58b","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.hue_remote_office_pendant_action","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"zigbee2mqtt/Office Pendant/set","valueType":"str"}],"x":250,"y":280,"wires":[["e058bc594eb976be"]]},{"id":"15a80f62e75be8c7","type":"mqtt out","z":"c9050df8947b405a","name":"","topic":"","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"217472f.ad9218e","x":910,"y":120,"wires":[]},{"id":"7db05c462ac4c968","type":"change","z":"c9050df8947b405a","name":"move up","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"brightness_move\": 40}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":920,"y":260,"wires":[["15a80f62e75be8c7"]]},{"id":"5977b0de8e160f2f","type":"change","z":"c9050df8947b405a","name":"stop","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"brightness_move\": 0}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":910,"y":340,"wires":[["15a80f62e75be8c7"]]},{"id":"e9f63728cfea2b6b","type":"change","z":"c9050df8947b405a","name":"move down","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"brightness_move\": -40}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":930,"y":300,"wires":[["15a80f62e75be8c7"]]},{"id":"7d84bc64cace07a9","type":"trigger","z":"c9050df8947b405a","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"0","extend":false,"overrideDelay":false,"units":"ms","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":740,"y":260,"wires":[["7db05c462ac4c968"]]},{"id":"134f64c4be152f86","type":"trigger","z":"c9050df8947b405a","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"0","extend":false,"overrideDelay":false,"units":"ms","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":740,"y":300,"wires":[["e9f63728cfea2b6b"]]},{"id":"eb9d1af1101236cb","type":"change","z":"c9050df8947b405a","name":"step up","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"brightness_step\": 20}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":920,"y":180,"wires":[["15a80f62e75be8c7"]]},{"id":"a0759c55fd117fb1","type":"change","z":"c9050df8947b405a","name":"step down","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"brightness_step\": -20}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":930,"y":220,"wires":[["15a80f62e75be8c7"]]},{"id":"5cc4ffff1538ab4e","type":"change","z":"c9050df8947b405a","name":"on","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"state\":\"on\"}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":710,"y":160,"wires":[["15a80f62e75be8c7"]]},{"id":"e5c30f49bb364323","type":"change","z":"c9050df8947b405a","name":"off","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"state\":\"off\"}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":710,"y":200,"wires":[["15a80f62e75be8c7"]]},{"id":"c3ff098b2bd1c58b","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30"},{"id":"217472f.ad9218e","type":"mqtt-broker","name":"","broker":"localhost","port":"1883","clientid":"","autoConnect":true,"usetls":false,"compatmode":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willRetain":"false","willPayload":"","willMsg":{},"sessionExpiry":""}]

Ikea Remote - zigbee2mqtt group

[{"id":"7b8ac4f0fa238b69","type":"server-state-changed","z":"991971e7601e1b75","name":"Dimmer","server":"c3ff098b2bd1c58b","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.ikea_dimmer_lounge_action","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"zigbee2mqtt/lounge lights/set","valueType":"str"}],"x":250,"y":200,"wires":[["b78da51c60248898"]]},{"id":"b78da51c60248898","type":"switch","z":"991971e7601e1b75","name":"Dimmer Action","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"},{"t":"eq","v":"brightness_move_up","vt":"str"},{"t":"eq","v":"brightness_move_down","vt":"str"},{"t":"eq","v":"brightness_stop","vt":"str"}],"checkall":"false","repair":false,"outputs":5,"x":460,"y":200,"wires":[["0c989417c81f1acd"],["0c989417c81f1acd"],["a8891de998438ec5"],["14202a19345858fa"],["08c0ef04b48e83be","1a9944d4a36b0184"]]},{"id":"08c0ef04b48e83be","type":"change","z":"991971e7601e1b75","name":"reset","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":280,"wires":[["a8891de998438ec5","14202a19345858fa"]]},{"id":"0c989417c81f1acd","type":"mqtt out","z":"991971e7601e1b75","name":"","topic":"","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"217472f.ad9218e","x":910,"y":160,"wires":[]},{"id":"fb25ba66a10e49a2","type":"change","z":"991971e7601e1b75","name":"move up","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"brightness_move\": 40}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":920,"y":220,"wires":[["0c989417c81f1acd"]]},{"id":"1a9944d4a36b0184","type":"change","z":"991971e7601e1b75","name":"stop","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"brightness_move\": 0}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":910,"y":300,"wires":[["0c989417c81f1acd"]]},{"id":"02d06e67ef957ec6","type":"change","z":"991971e7601e1b75","name":"move down","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"brightness_move\": -40}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":930,"y":260,"wires":[["0c989417c81f1acd"]]},{"id":"a8891de998438ec5","type":"trigger","z":"991971e7601e1b75","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"0","extend":false,"overrideDelay":false,"units":"ms","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":740,"y":220,"wires":[["fb25ba66a10e49a2"]]},{"id":"14202a19345858fa","type":"trigger","z":"991971e7601e1b75","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"0","extend":false,"overrideDelay":false,"units":"ms","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":740,"y":260,"wires":[["02d06e67ef957ec6"]]},{"id":"c3ff098b2bd1c58b","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30"},{"id":"217472f.ad9218e","type":"mqtt-broker","name":"","broker":"localhost","port":"1883","clientid":"","autoConnect":true,"usetls":false,"compatmode":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willRetain":"false","willPayload":"","willMsg":{},"sessionExpiry":""}]
3 Likes

Hello, your method was a very good base for my case, thanks a lot for sharing.
I changed few things as you can see, the most usefull for me was the stop timer (each press restart the timer, if no press for 5s or off-press, that reset the counter) to mimic standard use of hue dimmer switch

[
    {
        "id": "2e1f6f24eb32c784",
        "type": "tab",
        "label": "Veranda",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "907ea2154cdccfb2",
        "type": "mqtt in",
        "z": "2e1f6f24eb32c784",
        "name": "HDS Veranda",
        "topic": "zigbee2mqtt/hds_veranda",
        "qos": "2",
        "datatype": "json",
        "broker": "6b372ddc34ac1784",
        "nl": false,
        "rap": true,
        "rh": 0,
        "inputs": 0,
        "x": 270,
        "y": 200,
        "wires": [
            [
                "4982c2e783b5079d"
            ]
        ]
    },
    {
        "id": "4982c2e783b5079d",
        "type": "switch",
        "z": "2e1f6f24eb32c784",
        "name": "Action",
        "property": "payload.action",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "on-press",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "up-press",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "up-hold",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "-hold-release",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "down-press",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "down-hold",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "off-press",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 7,
        "x": 430,
        "y": 200,
        "wires": [
            [
                "1ef2f857f3f516c4",
                "be1ed242a42bc7a4"
            ],
            [
                "cc396da9b1728407"
            ],
            [
                "e26aae2e21d1462b"
            ],
            [
                "937dd7db903ea8f0"
            ],
            [
                "3708ca638e4c1932"
            ],
            [
                "665e903506e8f175"
            ],
            [
                "38d6a4d363c16ee3",
                "03780314c356f8fe"
            ]
        ]
    },
    {
        "id": "1ef2f857f3f516c4",
        "type": "counter",
        "z": "2e1f6f24eb32c784",
        "name": "",
        "init": "-1",
        "step": "1",
        "lower": "",
        "upper": "",
        "mode": "increment",
        "outputs": 1,
        "x": 920,
        "y": 160,
        "wires": [
            [
                "26a5a60fcf87bff6"
            ]
        ]
    },
    {
        "id": "c4d72976460a54f6",
        "type": "mqtt out",
        "z": "2e1f6f24eb32c784",
        "name": "Hue Veranda",
        "topic": "zigbee2mqtt/hue_veranda/set",
        "qos": "",
        "retain": "",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "6b372ddc34ac1784",
        "x": 1590,
        "y": 280,
        "wires": []
    },
    {
        "id": "38d6a4d363c16ee3",
        "type": "function",
        "z": "2e1f6f24eb32c784",
        "name": "off-press",
        "func": "var payload = {state: \"OFF\", transition: 0.5};\nreturn {payload: payload};\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1200,
        "y": 400,
        "wires": [
            [
                "c4d72976460a54f6"
            ]
        ]
    },
    {
        "id": "cc396da9b1728407",
        "type": "function",
        "z": "2e1f6f24eb32c784",
        "name": "up-press",
        "func": "var payload = {\"brightness_step\": 80};\nreturn {payload: payload};\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1200,
        "y": 200,
        "wires": [
            [
                "c4d72976460a54f6"
            ]
        ]
    },
    {
        "id": "3708ca638e4c1932",
        "type": "function",
        "z": "2e1f6f24eb32c784",
        "name": "down-press",
        "func": "var payload = {\"brightness_step\": -80};\nreturn {payload: payload};\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1210,
        "y": 320,
        "wires": [
            [
                "c4d72976460a54f6"
            ]
        ]
    },
    {
        "id": "665e903506e8f175",
        "type": "function",
        "z": "2e1f6f24eb32c784",
        "name": "down-hold",
        "func": "var payload = {\"brightness_move\": -80};\nreturn {payload: payload};\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1210,
        "y": 360,
        "wires": [
            [
                "c4d72976460a54f6"
            ]
        ]
    },
    {
        "id": "e26aae2e21d1462b",
        "type": "function",
        "z": "2e1f6f24eb32c784",
        "name": "up-hold",
        "func": "var payload = {\"brightness_move\": 80};\nreturn {payload: payload};\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1200,
        "y": 240,
        "wires": [
            [
                "c4d72976460a54f6"
            ]
        ]
    },
    {
        "id": "937dd7db903ea8f0",
        "type": "function",
        "z": "2e1f6f24eb32c784",
        "name": "up|down-hold-release",
        "func": "var payload = {\"brightness_move\": 0};\nreturn {payload: payload};\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1240,
        "y": 280,
        "wires": [
            [
                "c4d72976460a54f6"
            ]
        ]
    },
    {
        "id": "7ab1c83a8f9653a7",
        "type": "function",
        "z": "2e1f6f24eb32c784",
        "name": "on-press",
        "func": "const startup_scene = {brightness: 255, color_temp: 367}; // Lumineux\nconst additional_scenes = [\n    {brightness: 145, color_temp: 447}, // Détente\n    {brightness: 77, color_temp: 366}, // Atténué\n    {brightness: 1, color_temp: 366} // energize\n] || []; // && to exclude, || to include additional scenes\n\nconst scenes = [\n    startup_scene\n    , ...additional_scenes\n];\n\nvar payload = {state: \"ON\", transition: 0.5};\nif (msg.count > -1) {\n    Object.assign(\n        payload,\n        scenes[msg.count % scenes.length] // round robin\n    );\n}\n\nreturn {payload: payload};\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1200,
        "y": 160,
        "wires": [
            [
                "c4d72976460a54f6"
            ]
        ]
    },
    {
        "id": "03780314c356f8fe",
        "type": "change",
        "z": "2e1f6f24eb32c784",
        "name": "Reset",
        "rules": [
            {
                "t": "set",
                "p": "reset",
                "pt": "msg",
                "to": "-1",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 750,
        "y": 120,
        "wires": [
            [
                "1ef2f857f3f516c4"
            ]
        ]
    },
    {
        "id": "be1ed242a42bc7a4",
        "type": "stoptimer",
        "z": "2e1f6f24eb32c784",
        "duration": "5",
        "units": "Second",
        "payloadtype": "bool",
        "payloadval": "true",
        "name": "5s Timer",
        "x": 580,
        "y": 120,
        "wires": [
            [],
            [
                "03780314c356f8fe"
            ]
        ]
    },
    {
        "id": "26a5a60fcf87bff6",
        "type": "switch",
        "z": "2e1f6f24eb32c784",
        "name": "",
        "property": "payload.action",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "on-press",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 1060,
        "y": 160,
        "wires": [
            [
                "7ab1c83a8f9653a7"
            ]
        ]
    },
    {
        "id": "6b372ddc34ac1784",
        "type": "mqtt-broker",
        "name": "CrashPS Broker",
        "broker": "192.168.1.93",
        "port": "1883",
        "clientid": "",
        "usetls": false,
        "protocolVersion": "4",
        "keepalive": "60",
        "cleansession": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "0",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willPayload": "",
        "willMsg": {},
        "sessionExpiry": ""
    }
]

Hello everyone,
I managed to adapt your sequences for a hue dimmer v2 and is working great.

[{"id":"77a2e09a87cdad03","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"fd73f993c7bf40c3","type":"function","z":"77a2e09a87cdad03","name":"Light UP","func":"var payload = {\"brightness_move\": 50};\nreturn {payload: payload};\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":760,"y":580,"wires":[["e7808d295ce5dcc3"]]},{"id":"88626ed2d06a5f34","type":"mqtt in","z":"77a2e09a87cdad03","name":"Hue Dimmer v2 Entrance","topic":"zigbee2mqtt/Intrare Hue Dimmer V2","qos":"2","datatype":"json","broker":"3752730527bae555","nl":false,"rap":false,"inputs":0,"x":330,"y":440,"wires":[["9949752d010fbf42"]]},{"id":"9949752d010fbf42","type":"switch","z":"77a2e09a87cdad03","name":"Switch","property":"payload.action","propertyType":"msg","rules":[{"t":"eq","v":"on_press","vt":"str"},{"t":"eq","v":"on_press_release","vt":"str"},{"t":"eq","v":"on_hold","vt":"str"},{"t":"eq","v":"on_hold_release","vt":"str"},{"t":"eq","v":"up_press","vt":"str"},{"t":"eq","v":"up_press_release","vt":"str"},{"t":"eq","v":"down_press","vt":"str"},{"t":"eq","v":"down_press_release","vt":"str"},{"t":"eq","v":"up_hold","vt":"str"},{"t":"eq","v":"up_hold_release","vt":"str"},{"t":"eq","v":"down_hold","vt":"str"},{"t":"eq","v":"down_hold_release","vt":"str"},{"t":"eq","v":"off_press","vt":"str"},{"t":"eq","v":"off_press_release","vt":"str"}],"checkall":"true","repair":false,"outputs":14,"x":530,"y":440,"wires":[["a2619d86bfcce8ce","ee696464a4f06a58","b720ba5e5e0a6030","ad7c66eaa5e6d40c"],[],[],[],["e1c9297441619e94"],["d6ede60379917416"],["81f6531b2efb32fd"],["f53e62f1a9676598"],["fd73f993c7bf40c3"],["680467962ddf0b30"],[],[],[],[]]},{"id":"e7808d295ce5dcc3","type":"mqtt out","z":"77a2e09a87cdad03","name":"Entrance Ikea Tradfri Spots Group","topic":"zigbee2mqtt/Intrare Ikea Tradfri Lumini Spoturi Group/set","qos":"2","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"3752730527bae555","x":1160,"y":560,"wires":[]},{"id":"a2619d86bfcce8ce","type":"thingzi-time-check","z":"77a2e09a87cdad03","name":"08:30 - 18:29","lat":"48.8607","lon":"2.3281","ontype":"tod","ontimesun":"dusk","ontimetod":"08:30:00","onoffset":"","onrandomoffset":false,"offtype":"tod","offtimesun":"dawn","offtimetod":"18:29:59","offoffset":"","offrandomoffset":false,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"sun":true,"passunchecked":false,"x":770,"y":220,"wires":[["4cbd139848d5794d"],[]]},{"id":"b720ba5e5e0a6030","type":"thingzi-time-check","z":"77a2e09a87cdad03","name":"18:30 - 20:29","lat":"48.8607","lon":"2.3281","ontype":"tod","ontimesun":"dusk","ontimetod":"18:30:00","onoffset":"","onrandomoffset":false,"offtype":"tod","offtimesun":"dawn","offtimetod":"20:29:59","offoffset":"","offrandomoffset":false,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"sun":true,"passunchecked":false,"x":770,"y":280,"wires":[["c2d10e52655f826b"],[]]},{"id":"ad7c66eaa5e6d40c","type":"thingzi-time-check","z":"77a2e09a87cdad03","name":"20:30 - 06:29","lat":"48.8607","lon":"2.3281","ontype":"tod","ontimesun":"dusk","ontimetod":"20:30:00","onoffset":"","onrandomoffset":false,"offtype":"tod","offtimesun":"dawn","offtimetod":"06:29:59","offoffset":"","offrandomoffset":false,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"sun":true,"passunchecked":false,"x":770,"y":340,"wires":[["43064f1a1b2ac254"],[]]},{"id":"ee696464a4f06a58","type":"thingzi-time-check","z":"77a2e09a87cdad03","name":"06:30 - 08:29","lat":"48.8607","lon":"2.3281","ontype":"tod","ontimesun":"dusk","ontimetod":"06:30:00","onoffset":"","onrandomoffset":false,"offtype":"tod","offtimesun":"dawn","offtimetod":"08:29:59","offoffset":"","offrandomoffset":false,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"sun":true,"passunchecked":false,"x":770,"y":160,"wires":[["329b44fb86ea9532"],[]]},{"id":"680467962ddf0b30","type":"function","z":"77a2e09a87cdad03","name":"Light Stop","func":"var payload = {\"brightness_move\": 0};\nreturn {payload: payload};\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":770,"y":620,"wires":[["e7808d295ce5dcc3"]]},{"id":"c2d10e52655f826b","type":"api-call-service","z":"77a2e09a87cdad03","name":"Evening ON/OFF","server":"f0d170ea.f39ad","version":4,"debugenabled":false,"domain":"light","service":"toggle","target":{"areaId":[],"deviceId":[],"entityId":["light.intrare_ikea_tradfri_lumini_spoturi_group"]},"data":"{\"brightness\":152,\"color_temp\":300}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1030,"y":280,"wires":[[]]},{"id":"43064f1a1b2ac254","type":"api-call-service","z":"77a2e09a87cdad03","name":"Night ON/OFF","server":"f0d170ea.f39ad","version":4,"debugenabled":false,"domain":"light","service":"toggle","target":{"areaId":[],"deviceId":[],"entityId":["light.intrare_ikea_tradfri_lumini_spoturi_group"]},"data":"{\"brightness\":101,\"color_temp\":300}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1020,"y":340,"wires":[[]]},{"id":"4cbd139848d5794d","type":"api-call-service","z":"77a2e09a87cdad03","name":"Day ON/OFF","server":"f0d170ea.f39ad","version":4,"debugenabled":false,"domain":"light","service":"toggle","target":{"areaId":[],"deviceId":[],"entityId":["light.intrare_ikea_tradfri_lumini_spoturi_group"]},"data":"{\"brightness\":203,\"color_temp\":250}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1010,"y":220,"wires":[[]]},{"id":"329b44fb86ea9532","type":"api-call-service","z":"77a2e09a87cdad03","name":"Morning ON/OFF","server":"f0d170ea.f39ad","version":4,"debugenabled":false,"domain":"light","service":"toggle","target":{"areaId":[],"deviceId":[],"entityId":["light.intrare_ikea_tradfri_lumini_spoturi_group"]},"data":"{\"brightness\":102,\"color_temp\":310}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1030,"y":160,"wires":[[]]},{"id":"81f6531b2efb32fd","type":"function","z":"77a2e09a87cdad03","name":"Temperature Down","func":"var payload = {\"color_temp_move\": -40};\nreturn {payload: payload};\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":790,"y":480,"wires":[["e7808d295ce5dcc3"]]},{"id":"e1c9297441619e94","type":"function","z":"77a2e09a87cdad03","name":"Temperature UP","func":"var payload = {\"color_temp_move\": 40};\nreturn {payload: payload};\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":780,"y":400,"wires":[["e7808d295ce5dcc3"]]},{"id":"f53e62f1a9676598","type":"function","z":"77a2e09a87cdad03","name":"Temperature Stop","func":"var payload = {\"color_temp_move\": \"stop\"};\nreturn {payload: payload};\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":790,"y":520,"wires":[["e7808d295ce5dcc3"]]},{"id":"d6ede60379917416","type":"function","z":"77a2e09a87cdad03","name":"Temperature Stop","func":"var payload = {\"color_temp_move\": \"stop\"};\nreturn {payload: payload};\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":790,"y":440,"wires":[["e7808d295ce5dcc3"]]},{"id":"3752730527bae555","type":"mqtt-broker","name":"Mqtt","broker":"http://192.168.1.25","port":"1883","clientid":"HAClient","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willRetain":"false","willPayload":"","willMsg":{},"sessionExpiry":""},{"id":"f0d170ea.f39ad","type":"server","name":"Home Assistant EMP83","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30"}]

I was wondering if there was a way to toggle between different scenes by pressing the off button to have full functionality of v2 dimmer?

Thank you all for this great thread.

Problem solved,
I installed cycle node and everything became quite simple.
Can be added as many scenes as you want.

[{"id":"f9da82cf1d7f77a5","type":"tab","label":"Flow 2","disabled":false,"info":"","env":[]},{"id":"0e3452209a6ff8d6","type":"function","z":"f9da82cf1d7f77a5","name":"Light Down","func":"var payload = {\"brightness_move\": -50};\nreturn {payload: payload};\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":670,"y":640,"wires":[["bc665e69df84b483"]]},{"id":"fc4dfaefb15c0b5f","type":"function","z":"f9da82cf1d7f77a5","name":"Light UP","func":"var payload = {\"brightness_move\": 50};\nreturn {payload: payload};\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":660,"y":560,"wires":[["bc665e69df84b483"]]},{"id":"47db77ba801a7555","type":"function","z":"f9da82cf1d7f77a5","name":"Light Stop","func":"var payload = {\"brightness_move\": 0};\nreturn {payload: payload};\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":670,"y":680,"wires":[["bc665e69df84b483"]]},{"id":"6675fd47b4f598ca","type":"mqtt in","z":"f9da82cf1d7f77a5","name":"Hue Dimmer v2 Entrance","topic":"zigbee2mqtt/Intrare Hue Dimmer V2","qos":"2","datatype":"json","broker":"3752730527bae555","nl":false,"rap":false,"inputs":0,"x":230,"y":420,"wires":[["c58f72155abd7461"]]},{"id":"c58f72155abd7461","type":"switch","z":"f9da82cf1d7f77a5","name":"Switch","property":"payload.action","propertyType":"msg","rules":[{"t":"eq","v":"on_press","vt":"str"},{"t":"eq","v":"on_press_release","vt":"str"},{"t":"eq","v":"on_hold","vt":"str"},{"t":"eq","v":"on_hold_release","vt":"str"},{"t":"eq","v":"up_press","vt":"str"},{"t":"eq","v":"up_press_release","vt":"str"},{"t":"eq","v":"down_press","vt":"str"},{"t":"eq","v":"down_press_release","vt":"str"},{"t":"eq","v":"up_hold","vt":"str"},{"t":"eq","v":"up_hold_release","vt":"str"},{"t":"eq","v":"down_hold","vt":"str"},{"t":"eq","v":"down_hold_release","vt":"str"},{"t":"eq","v":"off_press","vt":"str"},{"t":"eq","v":"off_press_release","vt":"str"}],"checkall":"true","repair":false,"outputs":14,"x":430,"y":420,"wires":[["f4740675beb996bf","4ff5f2474ecb4677","5bd5ea73f4b71860","89a0474b38602fed"],[],[],[],["28472e1769b07224"],["44e027cd4c31d7bc"],["54cf3c0b6645dd86"],["3a21c0b79d20cab6"],["fc4dfaefb15c0b5f"],["40355632529ea0ca"],["0e3452209a6ff8d6"],["47db77ba801a7555"],["377c59cdf0b97b5b"],[]]},{"id":"bc665e69df84b483","type":"mqtt out","z":"f9da82cf1d7f77a5","name":"Entrance Ikea Tradfri Spots Group","topic":"zigbee2mqtt/Intrare Ikea Tradfri Lumini Spoturi Group/set","qos":"2","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"3752730527bae555","x":1060,"y":540,"wires":[]},{"id":"f4740675beb996bf","type":"thingzi-time-check","z":"f9da82cf1d7f77a5","name":"08:30 - 18:29","lat":"48.8607","lon":"2.3281","ontype":"tod","ontimesun":"dusk","ontimetod":"08:30:00","onoffset":"","onrandomoffset":false,"offtype":"tod","offtimesun":"dawn","offtimetod":"18:29:59","offoffset":"","offrandomoffset":false,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"sun":true,"passunchecked":false,"x":670,"y":200,"wires":[["c96bdf711b271661"],[]]},{"id":"5bd5ea73f4b71860","type":"thingzi-time-check","z":"f9da82cf1d7f77a5","name":"18:30 - 20:29","lat":"48.8607","lon":"2.3281","ontype":"tod","ontimesun":"dusk","ontimetod":"18:30:00","onoffset":"","onrandomoffset":false,"offtype":"tod","offtimesun":"dawn","offtimetod":"20:29:59","offoffset":"","offrandomoffset":false,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"sun":true,"passunchecked":false,"x":670,"y":260,"wires":[["47f68564afdce5df"],[]]},{"id":"89a0474b38602fed","type":"thingzi-time-check","z":"f9da82cf1d7f77a5","name":"20:30 - 06:29","lat":"48.8607","lon":"2.3281","ontype":"tod","ontimesun":"dusk","ontimetod":"20:30:00","onoffset":"","onrandomoffset":false,"offtype":"tod","offtimesun":"dawn","offtimetod":"06:29:59","offoffset":"","offrandomoffset":false,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"sun":true,"passunchecked":false,"x":670,"y":320,"wires":[["950a269338f90bc5"],[]]},{"id":"4ff5f2474ecb4677","type":"thingzi-time-check","z":"f9da82cf1d7f77a5","name":"06:30 - 08:29","lat":"48.8607","lon":"2.3281","ontype":"tod","ontimesun":"dusk","ontimetod":"06:30:00","onoffset":"","onrandomoffset":false,"offtype":"tod","offtimesun":"dawn","offtimetod":"08:29:59","offoffset":"","offrandomoffset":false,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"sun":true,"passunchecked":false,"x":670,"y":140,"wires":[["5656242c43a73a92"],[]]},{"id":"40355632529ea0ca","type":"function","z":"f9da82cf1d7f77a5","name":"Light Stop","func":"var payload = {\"brightness_move\": 0};\nreturn {payload: payload};\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":670,"y":600,"wires":[["bc665e69df84b483"]]},{"id":"47f68564afdce5df","type":"api-call-service","z":"f9da82cf1d7f77a5","name":"Evening ON/OFF","server":"f0d170ea.f39ad","version":4,"debugenabled":false,"domain":"light","service":"toggle","target":{"areaId":[],"deviceId":[],"entityId":["light.intrare_ikea_tradfri_lumini_spoturi_group"]},"data":"{\"brightness\":152}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":930,"y":260,"wires":[[]]},{"id":"950a269338f90bc5","type":"api-call-service","z":"f9da82cf1d7f77a5","name":"Night ON/OFF","server":"f0d170ea.f39ad","version":4,"debugenabled":false,"domain":"light","service":"toggle","target":{"areaId":[],"deviceId":[],"entityId":["light.intrare_ikea_tradfri_lumini_spoturi_group"]},"data":"{\"brightness\":101}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":920,"y":320,"wires":[[]]},{"id":"c96bdf711b271661","type":"api-call-service","z":"f9da82cf1d7f77a5","name":"Day ON/OFF","server":"f0d170ea.f39ad","version":4,"debugenabled":false,"domain":"light","service":"toggle","target":{"areaId":[],"deviceId":[],"entityId":["light.intrare_ikea_tradfri_lumini_spoturi_group"]},"data":"{\"brightness\":203}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":910,"y":200,"wires":[[]]},{"id":"5656242c43a73a92","type":"api-call-service","z":"f9da82cf1d7f77a5","name":"Morning ON/OFF","server":"f0d170ea.f39ad","version":4,"debugenabled":false,"domain":"light","service":"toggle","target":{"areaId":[],"deviceId":[],"entityId":["light.intrare_ikea_tradfri_lumini_spoturi_group"]},"data":"{\"brightness\":102}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":930,"y":140,"wires":[[]]},{"id":"54cf3c0b6645dd86","type":"function","z":"f9da82cf1d7f77a5","name":"Temperature Down","func":"var payload = {\"color_temp_move\": -40};\nreturn {payload: payload};\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":460,"wires":[["bc665e69df84b483"]]},{"id":"28472e1769b07224","type":"function","z":"f9da82cf1d7f77a5","name":"Temperature UP","func":"var payload = {\"color_temp_move\": 40};\nreturn {payload: payload};\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":680,"y":380,"wires":[["bc665e69df84b483"]]},{"id":"3a21c0b79d20cab6","type":"function","z":"f9da82cf1d7f77a5","name":"Temperature Stop","func":"var payload = {\"color_temp_move\": \"stop\"};\nreturn {payload: payload};\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":500,"wires":[["bc665e69df84b483"]]},{"id":"44e027cd4c31d7bc","type":"function","z":"f9da82cf1d7f77a5","name":"Temperature Stop","func":"var payload = {\"color_temp_move\": \"stop\"};\nreturn {payload: payload};\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":420,"wires":[["bc665e69df84b483"]]},{"id":"4bd8c08deeac4851","type":"cycle","z":"f9da82cf1d7f77a5","name":"","outputs":4,"x":750,"y":760,"wires":[["c5d9dcfc88658424"],["175abc54bc70da39"],["c5ef394f5b939622"],["f1dc9c50400abd50"]]},{"id":"c5d9dcfc88658424","type":"api-call-service","z":"f9da82cf1d7f77a5","name":"Scene 1","server":"f0d170ea.f39ad","version":4,"debugenabled":true,"domain":"light","service":"turn_on","target":{"areaId":["intrare"],"deviceId":[],"entityId":[]},"data":"{\t    \"brightness\": 254,\t    \"color_temp\": 250\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":960,"y":700,"wires":[[]]},{"id":"377c59cdf0b97b5b","type":"api-current-state","z":"f9da82cf1d7f77a5","name":"Entrance Light Curent State","server":"233a9c63.e2baf4","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.intrare_ikea_tradfri_lumini_spoturi_group","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"for":0,"forType":"num","forUnits":"minutes","x":540,"y":760,"wires":[["4bd8c08deeac4851"],[]]},{"id":"175abc54bc70da39","type":"api-call-service","z":"f9da82cf1d7f77a5","name":"Scene 2","server":"f0d170ea.f39ad","version":4,"debugenabled":true,"domain":"light","service":"turn_on","target":{"areaId":["intrare"],"deviceId":[],"entityId":[]},"data":"{\t    \"brightness\": 127,\t    \"color_temp\": 250\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":960,"y":740,"wires":[[]]},{"id":"c5ef394f5b939622","type":"api-call-service","z":"f9da82cf1d7f77a5","name":"Scene 3","server":"f0d170ea.f39ad","version":4,"debugenabled":true,"domain":"light","service":"turn_on","target":{"areaId":["intrare"],"deviceId":[],"entityId":[]},"data":"{\t    \"brightness\": 254,\t    \"color_temp\": 310\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":960,"y":780,"wires":[[]]},{"id":"f1dc9c50400abd50","type":"api-call-service","z":"f9da82cf1d7f77a5","name":"Scene 4","server":"f0d170ea.f39ad","version":4,"debugenabled":true,"domain":"light","service":"turn_on","target":{"areaId":["intrare"],"deviceId":[],"entityId":[]},"data":"{\t    \"brightness\": 127,\t    \"color_temp\": 310\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":960,"y":820,"wires":[[]]},{"id":"3752730527bae555","type":"mqtt-broker","name":"Mqtt","broker":"http://192.168.1.25","port":"1883","clientid":"HAClient","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willRetain":"false","willPayload":"","willMsg":{},"sessionExpiry":""},{"id":"f0d170ea.f39ad","type":"server","name":"Home Assistant EMP83","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30"},{"id":"233a9c63.e2baf4","type":"server","name":"Home Assistant","rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]

Great didn’t know about move step. Dank!!

This is how it turned out for my HUE Dimmer and MQTT in Node-Red

Button I selects scene equel on how often is is pressed

Few remarks :

  • MQTT version 5
  • Dynamic Broker config (with start timers so i don’t get open connection errors on re-start)
  • All lights are defined in zigbee2mqtt as light groups
  • All light setting are defined in zigbee2mqtt as SceneX
  • Turning on / off lights are based on calling a scene ID (not name)
  • Light scene ID 0 is always turn off (in my home deployment)
  • All is done in : zigbee2MQTT <> Mosqitto Broker <> MQTT

My total :

[{"id":"1945f29da008cef4","type":"tab","label":"HUE Switch Blue Print","disabled":false,"info":"","env":[]},{"id":"1139a03d.d1ca","type":"change","z":"1945f29da008cef4","name":"Reset","rules":[{"t":"set","p":"reset","pt":"msg","to":"foo","tot":"str"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":260,"wires":[["fcb3cb17.693a9"]]},{"id":"900577c3.9deb4","type":"inject","z":"1945f29da008cef4","name":"Reset","repeat":"","crontab":"","once":true,"onceDelay":"0.5","topic":"","payload":"","payloadType":"date","x":870,"y":220,"wires":[["1139a03d.d1ca"]]},{"id":"820bd696.fbc028","type":"debug","z":"1945f29da008cef4","name":"Four presses","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1810,"y":360,"wires":[]},{"id":"525e3ec9.3bb6b8","type":"inject","z":"1945f29da008cef4","name":"Start","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":630,"y":200,"wires":[["fcb3cb17.693a9","ba72e20d.299b8"]]},{"id":"fcb3cb17.693a9","type":"counter","z":"1945f29da008cef4","name":"","init":"0","step":"1","lower":null,"upper":null,"mode":"increment","outputs":"1","x":1060,"y":190,"wires":[["9faf97df.4ce4a"]]},{"id":"4189a6d1.44073","type":"switch","z":"1945f29da008cef4","name":"count presses","property":"count","propertyType":"flow","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"2","vt":"num"},{"t":"eq","v":"3","vt":"num"},{"t":"eq","v":"4","vt":"num"}],"checkall":"true","repair":false,"outputs":4,"x":1230,"y":300,"wires":[["e596f82faedd9671"],["da046d5fe0c703d3"],["c52c45081ee7c299"],["0adc0231844778e9"]],"info":"Just expand the flow.count to how ever many\npresses you want/need."},{"id":"ba72e20d.299b8","type":"trigger","z":"1945f29da008cef4","name":"","op1":"","op2":"0","op1type":"nul","op2type":"str","duration":"1","extend":true,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":880,"y":300,"wires":[["62860129.ec7bd","4189a6d1.44073"]]},{"id":"9faf97df.4ce4a","type":"change","z":"1945f29da008cef4","name":"Flow set","rules":[{"t":"set","p":"count","pt":"flow","to":"count","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1210,"y":190,"wires":[["a018a094.13d14"]]},{"id":"ddd0ab58.0a3e58","type":"debug","z":"1945f29da008cef4","name":"Tripple press","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1810,"y":320,"wires":[]},{"id":"ed9739c.0628148","type":"debug","z":"1945f29da008cef4","name":"Double press","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1810,"y":280,"wires":[]},{"id":"8082f0.4ba02d1","type":"debug","z":"1945f29da008cef4","name":"Single Press","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1810,"y":240,"wires":[]},{"id":"a1783324.3f9f","type":"comment","z":"1945f29da008cef4","name":"DELAY - Readme","info":"The DELAY time has to be a bit longer than how\nlong it takes you to press the button the\nmaximum number of times.\nRead information in the SWITCH node too!","x":1260,"y":110,"wires":[]},{"id":"660d35d0.b41aa4","type":"comment","z":"1945f29da008cef4","name":"Input","info":"","x":870,"y":150,"wires":[]},{"id":"f91932b.cacfb5","type":"comment","z":"1945f29da008cef4","name":"Outputs","info":"Debug nodes are here now, but just connect\nthem to what ever you want.\nThe messages sent are in the nodes just before\nthe debug nodes.\n","x":1790,"y":200,"wires":[]},{"id":"a018a094.13d14","type":"debug","z":"1945f29da008cef4","name":"Counter Press","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"count","targetType":"msg","statusVal":"","statusType":"auto","x":1460,"y":180,"wires":[]},{"id":"62860129.ec7bd","type":"delay","z":"1945f29da008cef4","name":"Delay","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":870,"y":260,"wires":[["1139a03d.d1ca"]]},{"id":"0ba0541e858d7999","type":"switch","z":"1945f29da008cef4","name":"Remote Action","property":"payload.action","propertyType":"msg","rules":[{"t":"eq","v":"on-press","vt":"str"},{"t":"eq","v":"off-press","vt":"str"},{"t":"eq","v":"up-press","vt":"str"},{"t":"eq","v":"down-press","vt":"str"},{"t":"eq","v":"up-hold","vt":"str"},{"t":"eq","v":"down-hold","vt":"str"},{"t":"eq","v":"up-hold-release","vt":"str"},{"t":"eq","v":"down-hold-release","vt":"str"}],"checkall":"false","repair":false,"outputs":8,"x":620,"y":620,"wires":[["ba72e20d.299b8","fcb3cb17.693a9","fa007198c0b438f4"],["db1027a23458c2cd","fa007198c0b438f4"],["86ae81e36003326c"],["9706fba458641cbd"],["7fd6f673a1cabaf7"],["9040c62572b3d9f0"],["e65e78263dda89f1","64c1090c014e1895"],["e65e78263dda89f1","64c1090c014e1895"]]},{"id":"e65e78263dda89f1","type":"change","z":"1945f29da008cef4","name":"reset","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":720,"wires":[["9040c62572b3d9f0","7fd6f673a1cabaf7"]]},{"id":"229ba873878711fe","type":"mqtt out","z":"1945f29da008cef4","name":"","topic":"","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"aecfb814c6946e5e","x":2110,"y":560,"wires":[]},{"id":"24c8babce702c9f8","type":"change","z":"1945f29da008cef4","name":"move up","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"brightness_move\": 40}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1080,"y":600,"wires":[["a3f64f277373379e"]]},{"id":"64c1090c014e1895","type":"change","z":"1945f29da008cef4","name":"stop","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"brightness_move\": 0}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1070,"y":680,"wires":[["a3f64f277373379e"]]},{"id":"d082e91e40024db9","type":"change","z":"1945f29da008cef4","name":"move down","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"brightness_move\": -40}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1090,"y":640,"wires":[["a3f64f277373379e"]]},{"id":"7fd6f673a1cabaf7","type":"trigger","z":"1945f29da008cef4","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"0","extend":false,"overrideDelay":false,"units":"ms","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":900,"y":600,"wires":[["24c8babce702c9f8"]]},{"id":"9040c62572b3d9f0","type":"trigger","z":"1945f29da008cef4","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"0","extend":false,"overrideDelay":false,"units":"ms","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":900,"y":640,"wires":[["d082e91e40024db9"]]},{"id":"86ae81e36003326c","type":"change","z":"1945f29da008cef4","name":"step up","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"brightness_step\": 20}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1080,"y":520,"wires":[["a3f64f277373379e"]]},{"id":"9706fba458641cbd","type":"change","z":"1945f29da008cef4","name":"step down","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"brightness_step\": -20}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1090,"y":560,"wires":[["a3f64f277373379e"]]},{"id":"e596f82faedd9671","type":"change","z":"1945f29da008cef4","name":"Single Press","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"scene_recall\": 1}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":1450,"y":240,"wires":[["8082f0.4ba02d1","a3f64f277373379e"]]},{"id":"da046d5fe0c703d3","type":"change","z":"1945f29da008cef4","name":"Double Press","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"scene_recall\": 2}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":1460,"y":280,"wires":[["ed9739c.0628148","a3f64f277373379e"]]},{"id":"c52c45081ee7c299","type":"change","z":"1945f29da008cef4","name":"Tripple Press","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"scene_recall\": 3}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":1450,"y":320,"wires":[["ddd0ab58.0a3e58","a3f64f277373379e"]]},{"id":"0adc0231844778e9","type":"change","z":"1945f29da008cef4","name":"Four Press","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"scene_recall\": 4}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1450,"y":360,"wires":[["820bd696.fbc028","a3f64f277373379e"]]},{"id":"d9c7ce866906e41c","type":"debug","z":"1945f29da008cef4","name":"OFF press","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1810,"y":420,"wires":[]},{"id":"db1027a23458c2cd","type":"change","z":"1945f29da008cef4","name":"Off Press","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"scene_recall\": 0}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":1440,"y":420,"wires":[["d9c7ce866906e41c","a3f64f277373379e"]]},{"id":"ef11a9a6d3873d18","type":"mqtt in","z":"1945f29da008cef4","name":"","topic":"","qos":"2","datatype":"json","broker":"6487e0fd23db0623","nl":false,"rap":true,"rh":0,"inputs":1,"x":290,"y":620,"wires":[["59c801b5c9b47e94","0ba0541e858d7999"]]},{"id":"a3f64f277373379e","type":"change","z":"1945f29da008cef4","name":"Lamp Topic > Test-Lamp","rules":[{"t":"set","p":"topic","pt":"msg","to":"zigbee2mqtt/Test-Lampen-Groep/set","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1830,"y":560,"wires":[["229ba873878711fe","3e423be9bd28f10b"]]},{"id":"3e423be9bd28f10b","type":"debug","z":"1945f29da008cef4","name":"MQTT-OUT","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":2130,"y":500,"wires":[]},{"id":"f287da2597bd5171","type":"inject","z":"1945f29da008cef4","name":"Force Connect","props":[{"p":"action","v":"connect","vt":"str"},{"p":"topic","v":"{\"broker\":\"172.30.7.2\",\"port\":\"1883\",\"force\":\"true\"}","vt":"json"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","x":220,"y":480,"wires":[["ef11a9a6d3873d18"]]},{"id":"64bf1f8dce3ee7f3","type":"inject","z":"1945f29da008cef4","name":"Test-HUE-Dimmer/action","props":[{"p":"action","v":"unsubscribe","vt":"str"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"zigbee2mqtt/Test-HUE-Dimmer/action","x":150,"y":440,"wires":[["ef11a9a6d3873d18"]]},{"id":"59c801b5c9b47e94","type":"debug","z":"1945f29da008cef4","name":"MQTT-Dynamic-IN","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":550,"y":420,"wires":[]},{"id":"48d9e3a44933b0ff","type":"inject","z":"1945f29da008cef4","name":"Force disconnect","props":[{"p":"action","v":"disconnect","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"1","topic":"","x":210,"y":520,"wires":[["ef11a9a6d3873d18"]]},{"id":"fa007198c0b438f4","type":"debug","z":"1945f29da008cef4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"count","targetType":"msg","x":1010,"y":840,"wires":[]},{"id":"36e3d87cc29f55b3","type":"inject","z":"1945f29da008cef4","name":"Test-HUE-Dimmer/action","props":[{"p":"action","v":"subscribe","vt":"str"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"2","topic":"zigbee2mqtt/Test-HUE-Dimmer/action","x":150,"y":400,"wires":[["ef11a9a6d3873d18"]]},{"id":"aecfb814c6946e5e","type":"mqtt-broker","name":"Test-Node-Red2MQTT-Publisher","broker":"172.30.7.2","port":"1883","tls":"","clientid":"Test-Node-Red2MQTT-Publisher","autoConnect":true,"usetls":false,"protocolVersion":"5","keepalive":"60","cleansession":false,"birthTopic":"Test-Node-Red2MQTT-Publisher","birthQos":"0","birthPayload":"open","birthMsg":{"contentType":"text/plain"},"closeTopic":"Test-Node-Red2MQTT-Publisher","closeQos":"0","closePayload":"close","closeMsg":{"contentType":"text/plain"},"willTopic":"Test-Node-Red2MQTT-Publisher","willQos":"0","willPayload":"unexpected disconnection","willMsg":{"contentType":"text/plain"},"sessionExpiry":""},{"id":"6487e0fd23db0623","type":"mqtt-broker","name":"Test-Node-Red-Dynamic-Broker-01","broker":"172.30.7.2","port":"1883","tls":"","clientid":"Node-Red-Broker-Test-01","autoConnect":false,"usetls":false,"protocolVersion":"5","keepalive":"60","cleansession":false,"birthTopic":"Test-Node-Red-Dynamic-Broker-01","birthQos":"0","birthPayload":"open","birthMsg":{"contentType":"text/plain"},"closeTopic":"Test-Node-Red-Dynamic-Broker-01","closeQos":"0","closePayload":"close","closeMsg":{"contentType":"text/plain"},"willTopic":"Test-Node-Red-Dynamic-Broker-01","willQos":"0","willPayload":"unexpected disconnect","willMsg":{"contentType":"text/plain"},"sessionExpiry":""}]
1 Like

Where do we find node cycle?

Manage Palette - install - node-red-contrib-cycle

Although I’m using ZHA, here is my solution. It supports:

  • Multiple dimmers
  • Cycle scenes - based on a naming convention it will get all scenes for a room and handle the cycle
  • Dim and brighten only lights that are turned on (key for scenes). You have to define a group with all the relevant lights. This also manages minimum and maximum brightness.

1 Like

Hello there ,

I’m using deconz with conbee II stick how is it possible to get hue v2 dimmer inside node red ?

I dont suppose you still use this and can provide the json?

Any chance of getting the code for this?

Hi Regan, could you export this flow and share with me (or here?)
thanks!

Tried your flow but can’t get it to work.
What should be written in the first note (dimmer)
I can see that my HUE dimmer works in HA but can’t catch it
in Node-Red

Hey,

image

This is what I have in their, it listens to events from any dimmers that match the regex sensor.*_action_*.

This is all based on naming conventions I have setup for my entities so you might have to adapt the regex, the entity ids for the dimmer(s) and/or lights. And also the function nodes that parse the entity names out.

Hey
I still don’t get it but I’m also a newbie.
In the entity field I insert from the list “HUE1 Identify” when I then press the regex it writes “button.signify_netherlands_b_v_rwl022_identify”,
Do I need to write anything more?
I have tried with only Event State Node and a Debug Node
to see what comes out, but nothing comes out :frowning:
The dimmer works fine if I look in devices and services and find
HUE1 there, and look in the log file, I can see it working.