# Zigbee led strip dimmer

**URL:** <https://discourse.nodered.org/t/zigbee-led-strip-dimmer/59752>\
**Category:** General\
**Tags:** home-assistant\
**Created:** [12 March 2022 11:57 UTC](https://discourse.nodered.org/t/zigbee-led-strip-dimmer/59752 "2022-03-12T11:57:24Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![pilou8830](https://avatars.discourse-cdn.com/v4/letter/p/b4bc9f/32.png) [@pilou8830](https://discourse.nodered.org/u/pilou8830)\
**Post date:** [12 March 2022 11:57 UTC](https://discourse.nodered.org/t/zigbee-led-strip-dimmer/59752/1 "2022-03-12T11:57:24Z")

</div>

I am under home assistant supervisor.  
I would like to use an ikea control to operate a led strip (cold white and warm white).  
here is the equipment I have:  
the 2 materials work in zigbee 3.0  
 ![Capture103](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/b/1b0b6f409ea582363834bb506dc1d1b6829cf70f.jpeg)  
 ![Capture101](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/6/06791800c2da6433d54bc6b7a47f34f8fb2c636a.jpeg)  
it works well on lovelace to order the led strip

 ![100](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/0/d0e4652d07af33ea885bfd6607051073aa0def39.jpeg)  
Now I would like to use the command via node red  
but i'm stuck  
 ![Capture102](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/1/610b3c0db70b3d2f157eedb19157dcce72d84132.jpeg)  
I can turn the LEDs off and on but not use the dimmer function  
can you guide me?  
here is my flow file

```auto
[{"id":"fa18978a796eb012","type":"tab","label":"Ruban_Led_1","disabled":false,"info":"","env":[]},{"id":"73ba28cd20957381","type":"server-state-changed","z":"fa18978a796eb012","name":"Dim_1","server":"d260f8f066987915","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.dim_1_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":"","valueType":"triggerId"}],"x":110,"y":160,"wires":[["70ad3e454b743922"]]},{"id":"43bcdb20a7a18fa3","type":"debug","z":"fa18978a796eb012","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":630,"y":120,"wires":[]},{"id":"7485a879c6921ea3","type":"api-call-service","z":"fa18978a796eb012","name":"on","server":"2b29bbf7.71aad4","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.led_1"],"data":"{\"color_temp\": 153}\t{\"brightness\": 100}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":430,"y":120,"wires":[["43bcdb20a7a18fa3"]]},{"id":"70ad3e454b743922","type":"switch","z":"fa18978a796eb012","name":"","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"},{"t":"else"}],"checkall":"true","repair":false,"outputs":6,"x":250,"y":160,"wires":[["7485a879c6921ea3"],["dd05bff15b222955"],["51f2ba519ed45c09"],["bd9844d0010aa172"],["e976d9c1fdd518c4"],["69df96857317bedd"]]},{"id":"dd05bff15b222955","type":"api-call-service","z":"fa18978a796eb012","name":"off","server":"2b29bbf7.71aad4","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.led_1"],"data":"{\"color_temp\": 500}\t{\"brightness\": 0}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":430,"y":180,"wires":[["e928a96108d1bbe9"]]},{"id":"c5ebbb1d14e3ac89","type":"api-call-service","z":"fa18978a796eb012","name":"move-up","server":"2b29bbf7.71aad4","version":5,"debugenabled":true,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.led_1"],"data":"{\"brightness\" : \"msg.payload\"}\t{\"color_temp\": 153}\t","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":840,"y":240,"wires":[["253195375ea2e1d5"]]},{"id":"bd9844d0010aa172","type":"api-call-service","z":"fa18978a796eb012","name":"move-down","server":"2b29bbf7.71aad4","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.led_1"],"data":"{\"color_temp\": 500}\t{\"brightness\": 15}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":450,"y":300,"wires":[["43e5d3c785b19266"]]},{"id":"e928a96108d1bbe9","type":"debug","z":"fa18978a796eb012","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":630,"y":180,"wires":[]},{"id":"253195375ea2e1d5","type":"debug","z":"fa18978a796eb012","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":990,"y":240,"wires":[]},{"id":"43e5d3c785b19266","type":"debug","z":"fa18978a796eb012","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":630,"y":300,"wires":[]},{"id":"7fee78b76ff957c4","type":"debug","z":"fa18978a796eb012","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":630,"y":360,"wires":[]},{"id":"91311549f03d05fe","type":"api-call-service","z":"fa18978a796eb012","name":"brightness_stop","server":"2b29bbf7.71aad4","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.led_1"],"data":"{\"color_temp\": 500}\t","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":460,"y":360,"wires":[["7fee78b76ff957c4"]]},{"id":"69df96857317bedd","type":"debug","z":"fa18978a796eb012","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":430,"y":480,"wires":[]},{"id":"e976d9c1fdd518c4","type":"debug","z":"fa18978a796eb012","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":430,"y":420,"wires":[]},{"id":"2a812656c8949358","type":"function","z":"fa18978a796eb012","name":"","func":"var brightness = msg.payload;\nbrightness = parseInt(brightness);\nif (brightness < 229) {brightness = brightnees + 25}\nelse {brightnees = 254}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":700,"y":240,"wires":[["c5ebbb1d14e3ac89"]]},{"id":"51f2ba519ed45c09","type":"api-current-state","z":"fa18978a796eb012","name":"state Led_1","server":"d260f8f066987915","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.led_1","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":470,"y":240,"wires":[["2a812656c8949358","f76d0a2f4f87bed2"]]},{"id":"f76d0a2f4f87bed2","type":"debug","z":"fa18978a796eb012","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":890,"y":300,"wires":[]},{"id":"d260f8f066987915","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"},{"id":"2b29bbf7.71aad4","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}]

```

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [12 March 2022 12:02 UTC](https://discourse.nodered.org/t/zigbee-led-strip-dimmer/59752/2 "2022-03-12T12:02:24Z")

</div>

Sorry, can't help via Home Assistant as I don't use it. I control my LED's via MQTT using Node-RED and Zigbee2MQTT.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/8/e83c25cb70c6eb7ff69a4bf91a697d78fda47eb8.png)

Oops, sorry that's a Shelly which is controlled directly via MQTT.

No colour setting on this but rather dimming:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/c/ec10b71b6f07c61a6c6f522f4cf059fd0051bc17.png)

---

<div class="post-metadata">

**Author:** ![pilou8830](https://avatars.discourse-cdn.com/v4/letter/p/b4bc9f/32.png) [@pilou8830](https://discourse.nodered.org/u/pilou8830)\
**Post date:** [12 March 2022 12:54 UTC](https://discourse.nodered.org/t/zigbee-led-strip-dimmer/59752/3 "2022-03-12T12:54:46Z")

</div>

ok, thanks, i'll see if it works with mqtt.

---

<div class="post-metadata">

**Author:** ![pilou8830](https://avatars.discourse-cdn.com/v4/letter/p/b4bc9f/32.png) [@pilou8830](https://discourse.nodered.org/u/pilou8830)\
**Post date:** [12 March 2022 13:39 UTC](https://discourse.nodered.org/t/zigbee-led-strip-dimmer/59752/4 "2022-03-12T13:39:50Z")

</div>

Without more details, I'm still stuck. 🥴  
if I had an example flow file for dimmer working in zigbee 3.0 it would be easier. 😟

---

<div class="post-metadata">

**Author:** ![pilou8830](https://avatars.discourse-cdn.com/v4/letter/p/b4bc9f/32.png) [@pilou8830](https://discourse.nodered.org/u/pilou8830)\
**Post date:** [12 March 2022 13:57 UTC](https://discourse.nodered.org/t/zigbee-led-strip-dimmer/59752/5 "2022-03-12T13:57:58Z")

</div>

I achieve this with the zigbee2mqtt.  
But then what do I do?

 ![Capture200](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/c/ccf5dc38b8915ccdaca849728ec6acb9f2446795.jpeg)  
so far it only accepts this:  
{"color\_temp": 153}{"brightness": 254} for "on"  
{"color\_temp": 500}{"brightness": 0} for "off"  
{"color\_temp": X}{"brightness": Y} for X (153\>500) Y(0\>254)

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [12 March 2022 15:36 UTC](https://discourse.nodered.org/t/zigbee-led-strip-dimmer/59752/6 "2022-03-12T15:36:07Z")

</div>

I send from Node-RED -\> MQTT directly using the MQTT-out node. Look on the Zigbee2MQTT website for the commands that are allowed for each Zigbee device.

Simple example with an Ikea Bulb:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/c/0c00d1cfeb70b0c298e2936144af8772a70a7dd2.png)

You can change the brightness by changing the payload to something like: `{"brightness": 100}`.

---

<div class="post-metadata">

**Author:** ![pilou8830](https://avatars.discourse-cdn.com/v4/letter/p/b4bc9f/32.png) [@pilou8830](https://discourse.nodered.org/u/pilou8830)\
**Post date:** [12 March 2022 16:08 UTC](https://discourse.nodered.org/t/zigbee-led-strip-dimmer/59752/7 "2022-03-12T16:08:15Z")

</div>

ok i'm testing this now.  
Thank you

---

<div class="post-metadata">

**Author:** ![pilou8830](https://avatars.discourse-cdn.com/v4/letter/p/b4bc9f/32.png) [@pilou8830](https://discourse.nodered.org/u/pilou8830)\
**Post date:** [12 March 2022 16:34 UTC](https://discourse.nodered.org/t/zigbee-led-strip-dimmer/59752/8 "2022-03-12T16:34:03Z")

</div>

mqtt-out. that's it?  
 ![203](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/3/736b72c6a80608bd06cb91dcbc7215a4dfd6d3c3.jpeg)  
I don't see the msg.payload and msg.topic boxes 🙄

 ![200](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/9/e9c3e1ee1262ea2bcf58ca0e3bb4c6e8c3eb907e.jpeg)

Or is it further, in server then the message tab??

 ![201](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/f/ff31c865aecb8a56c6a6bfc4ce995cb8ef2e9b53.jpeg)  
 ![202](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/8/38ffef1d2cbc2002532d3408b65fe2c17b71e2ab.jpeg)

that's how it is, because it doesn't look like yours. 😮

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [12 March 2022 17:18 UTC](https://discourse.nodered.org/t/zigbee-led-strip-dimmer/59752/9 "2022-03-12T17:18:19Z")

</div>

I showed you an example from an inject node. That is what you send to the mqtt node.

I think you may find it helpful to take an hour to go through one of the many Node-RED from scratch tutorials/videos so that you get the hang of how data is originated, processed and output and how the different core nodes work along side each other.

---

<div class="post-metadata">

**Author:** ![pilou8830](https://avatars.discourse-cdn.com/v4/letter/p/b4bc9f/32.png) [@pilou8830](https://discourse.nodered.org/u/pilou8830)\
**Post date:** [12 March 2022 17:46 UTC](https://discourse.nodered.org/t/zigbee-led-strip-dimmer/59752/10 "2022-03-12T17:46:36Z")

</div>

> [@TotallyInformation](#):
>
> inject node

ok  
I have misunderstood. You must therefore first create an injection node and transmit it to the mqtt-out.  
thank you. and I will follow your advice.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [11 May 2022 17:47 UTC](https://discourse.nodered.org/t/zigbee-led-strip-dimmer/59752/11 "2022-05-11T17:47:29Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
