# How to automatic controll WS2811

**URL:** <https://discourse.nodered.org/t/how-to-automatic-controll-ws2811/22280>\
**Category:** General\
**Created:** [26 February 2020 10:06 UTC](https://discourse.nodered.org/t/how-to-automatic-controll-ws2811/22280 "2020-02-26T10:06:58Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![theSushi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thesushi/32/47459_2.png) [@theSushi](https://discourse.nodered.org/u/theSushi)\
**Post date:** [26 February 2020 10:06 UTC](https://discourse.nodered.org/t/how-to-automatic-controll-ws2811/22280/1 "2020-02-26T10:06:58Z")

</div>

I'm simply trying to do a sunrise and sunset simulation for my terrarium. I have a raspbery pi esp 8266 and LED WS2811 do I need anything else?

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [26 February 2020 10:26 UTC](https://discourse.nodered.org/t/how-to-automatic-controll-ws2811/22280/2 "2020-02-26T10:26:43Z")

</div>

Hi, are the WS2811's 5V input? If they are you will need a 3.3-5V level converter to drive them as the ESP8266 and Raspberry Pi are NOT 5V tolerant.

---

<div class="post-metadata">

**Author:** ![theSushi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thesushi/32/47459_2.png) [@theSushi](https://discourse.nodered.org/u/theSushi)\
**Post date:** [26 February 2020 10:36 UTC](https://discourse.nodered.org/t/how-to-automatic-controll-ws2811/22280/3 "2020-02-26T10:36:29Z")

</div>

it is 5V can i use [this](https://www.amazon.de/gp/product/B01MR7XCYJ/ref=ppx_yo_dt_b_asin_title_o02_s00?ie=UTF8&psc=1)  
i find [this](http://resources-area.co.uk/node-red-flows/controlling_neopixels.pdf) but i dont have WeMos D1 i have nodeMCU and ESP8266 but when i put [ESPEasy](https://www.letscontrolit.com/wiki/index.php/ESPEasy) i dont have in devices NeoPixel...  
now i see i use ESP Easy but thise man have ESP Easy Mega

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [26 February 2020 11:19 UTC](https://discourse.nodered.org/t/how-to-automatic-controll-ws2811/22280/4 "2020-02-26T11:19:08Z")

</div>

1. Please go to the main tab of your ESPeasy on the nodeMCU and do a screen shot and attach it to a reply.
2. What version of ESPeasy did you install?
3. if you go to the `Devices` tab and add a device, does it shoy any `Output` devices in the dropdown list?

---

<div class="post-metadata">

**Author:** ![theSushi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thesushi/32/47459_2.png) [@theSushi](https://discourse.nodered.org/u/theSushi)\
**Post date:** [26 February 2020 11:33 UTC](https://discourse.nodered.org/t/how-to-automatic-controll-ws2811/22280/5 "2020-02-26T11:33:30Z")

</div>

now I am instal ESPEasy Mega now i have all

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/a/aaa065cdcec421521907e9acd175450190516e19.png) ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/1/010d9e96e023378ad03cf0d93ac7a582634e31b5.png)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [26 February 2020 11:44 UTC](https://discourse.nodered.org/t/how-to-automatic-controll-ws2811/22280/6 "2020-02-26T11:44:20Z")

</div>

Remember to calculate the amperage needed. If an LED is on full bright (255,255,255) it can draw 20ma and with 60 of them all on,(if my math is right) you would draw 1.2 amps so make sure your powersupply will handle that load ontop of anything else it is powering.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [26 February 2020 12:58 UTC](https://discourse.nodered.org/t/how-to-automatic-controll-ws2811/22280/7 "2020-02-26T12:58:00Z")

</div>

> [@ghayne](#):
>
> Hi, are the WS2811's 5V input? If they are you will need a 3.3-5V level converter to drive them as the ESP8266 and Raspberry Pi are NOT 5V tolerant.

Just to say, I personally, have never had any problems directly driving any WSxxxx 5V RGB Led string from an ESP or a Pi GPIO pin

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [26 February 2020 13:00 UTC](https://discourse.nodered.org/t/how-to-automatic-controll-ws2811/22280/8 "2020-02-26T13:00:13Z")

</div>

Good to know Simon. Thanks!

---

<div class="post-metadata">

**Author:** ![theSushi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thesushi/32/47459_2.png) [@theSushi](https://discourse.nodered.org/u/theSushi)\
**Post date:** [26 February 2020 13:00 UTC](https://discourse.nodered.org/t/how-to-automatic-controll-ws2811/22280/9 "2020-02-26T13:00:44Z")

</div>

i know but teoretic i can run 1 led just for connection controll. but for me dont work i dc what is problem mqtt or setup

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/f/2f4a729af9f3dd443e421200757acb39d75ca271.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/6/26f8802d4bdceaf4cacdf4d6323e8e3fcef02e95.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/0/d026844ae5bbb5d53892fb1952320e4598654388.png)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [26 February 2020 13:49 UTC](https://discourse.nodered.org/t/how-to-automatic-controll-ws2811/22280/10 "2020-02-26T13:49:57Z")

</div>

It looks like (hard to see the image, too small) that you have defined the **topic** in the `mqtt-out` node as `/nodeMCU/cmd` but you are subscribing to `%sysname%/#` and since %sysname% equates to `nodeMCU` you are subscribing to `nodeMCU/#` or all msgs that have `nodeMCU` as the first part of the topic.

BUT, in NR you use a `/` as the first part of the topic so the msgs NR is publishing will never be sent to ESPEasy.

Change the `mqtt-in` topic to `nodeMCU/cmd` and you should see some results.

You should spend some time reading the `MQTT Essentials` blog posts [http://hivemq.com](http://hivemq.com) and this one in particular: [https://www.hivemq.com/blog/mqtt-essentials-part-5-mqtt-topics-best-practices/](https://www.hivemq.com/blog/mqtt-essentials-part-5-mqtt-topics-best-practices/)

---

<div class="post-metadata">

**Author:** ![theSushi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thesushi/32/47459_2.png) [@theSushi](https://discourse.nodered.org/u/theSushi)\
**Post date:** [26 February 2020 15:41 UTC](https://discourse.nodered.org/t/how-to-automatic-controll-ws2811/22280/11 "2020-02-26T15:41:28Z")

</div>

ok ty! now i have a communication i still need to resolve to switch off and on automatically but slowly eg 25% 50% 75% 100%

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [26 February 2020 17:48 UTC](https://discourse.nodered.org/t/how-to-automatic-controll-ws2811/22280/12 "2020-02-26T17:48:02Z")

</div>

You might want to use rules in espeasy (You need to turn them - go to Tools-Advanced and there is a check box there)

But this is way off of Node-RED.

---

<div class="post-metadata">

**Author:** ![theSushi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thesushi/32/47459_2.png) [@theSushi](https://discourse.nodered.org/u/theSushi)\
**Post date:** [29 February 2020 19:16 UTC](https://discourse.nodered.org/t/how-to-automatic-controll-ws2811/22280/13 "2020-02-29T19:16:51Z")

</div>

how i can turn 5 led in same color with one inject node and function

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [29 February 2020 21:27 UTC](https://discourse.nodered.org/t/how-to-automatic-controll-ws2811/22280/14 "2020-02-29T21:27:38Z")

</div>

As long as the 5 leds are the same ones in the string all the time, you could do it in a rule in ESPEasy. But if you want to turn on led 1,3,5,7,9 one time and 2,4,6,8,10 another time and then 1,2,3,4,5 another time you will have to do a bit of coding.

There is no easy solution (that I can think of) for this or pre-packaged answer and due to the limitation of memory the ESPEasy uses in the rules, you will probably have to send multiple mqtt messages to espeasy to get this done.

---

<div class="post-metadata">

**Author:** ![theSushi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thesushi/32/47459_2.png) [@theSushi](https://discourse.nodered.org/u/theSushi)\
**Post date:** [29 February 2020 22:29 UTC](https://discourse.nodered.org/t/how-to-automatic-controll-ws2811/22280/15 "2020-02-29T22:29:24Z")

</div>

i want all time turn on all time same 5 led (1,2,3,4,5) in same color

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [29 February 2020 23:03 UTC](https://discourse.nodered.org/t/how-to-automatic-controll-ws2811/22280/16 "2020-02-29T23:03:34Z")

</div>

So send a mqtt message to espeasy and have a ruleset that has five NeoPixel statements with the number of the neopixel in the five different commands, one statement per neopixel you want to control. You will probably want another set to shutoff the neopixels so you will need another ruleset for that.

---

<div class="post-metadata">

**Author:** ![theSushi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thesushi/32/47459_2.png) [@theSushi](https://discourse.nodered.org/u/theSushi)\
**Post date:** [29 February 2020 23:11 UTC](https://discourse.nodered.org/t/how-to-automatic-controll-ws2811/22280/17 "2020-02-29T23:11:28Z")

</div>

```auto
[{"id":"7e1945ad.8d0ddc","type":"mqtt out","z":"b58a1974.f4e868","name":"","topic":"nodeMCU/cmd","qos":"","retain":"","broker":"19efa301.6c402d","x":640,"y":260,"wires":[]},{"id":"19efa301.6c402d","type":"mqtt-broker","z":"","name":"","broker":"192.168.178.35","port":"1883","tls":"","clientid":"","usetls":false,"compatmode":true,"keepalive":"15","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]

```

yes yes i want turn on and off

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [29 February 2020 23:58 UTC](https://discourse.nodered.org/t/how-to-automatic-controll-ws2811/22280/18 "2020-02-29T23:58:57Z")

</div>

Why did you post an mqtt-out node? What do you expect anyone to do with that?

---

<div class="post-metadata">

**Author:** ![theSushi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thesushi/32/47459_2.png) [@theSushi](https://discourse.nodered.org/u/theSushi)\
**Post date:** [1 March 2020 06:08 UTC](https://discourse.nodered.org/t/how-to-automatic-controll-ws2811/22280/19 "2020-03-01T06:08:05Z")

</div>

you ask me " send a mqtt message to espeasy" bc of thaht i send you mqtt-out node. Probably if i send wrong i am idiot or i don't understand you.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [1 March 2020 10:29 UTC](https://discourse.nodered.org/t/how-to-automatic-controll-ws2811/22280/20 "2020-03-01T10:29:43Z")

</div>

Have you been sucessful at sending a msg from Nodered to ESPeasy and been able to turn on a single neopixel yet?

[Next page](https://discourse.nodered.org/t/how-to-automatic-controll-ws2811/22280.md?page=2)
