MQTT, LED, NodeMCU Issue

you need a logic level shifter. yes you can make the strip 240 leds but i am not sure which one you are using. mine has 3 leds which count as 1. shouldn’t matter which pin as long as your code matches

Direccionable WS2811 5050 SMD RGB Tira 30/48/60 leds/m Led Píxeles Externa 1 ic de control 3 Leds 5 m/roll DC12V 16.5ft

Nombre de la marca:BTF-LIGHTINGTipo de artículo:TiraFuente de energía:DCCertificación:CE,ROHS,CCCNúmero de LEDs / M:60 pcs/mModelo del Chip LED:SMD5050Tipo de Gaza:SMDVida Media (hrs):50000Número de modelo:WS2811-12vMarca del Chip LED:EpistarOcasión:Sala de estarTensión:12VImpermeable:SíEspecificaciones (bolas de luz / m):60

Bi-Direccional de $ number canales Desplazador de Nivel Lógico Convertidor 3.3 V 5 V para Arduino TE291

i conected Nodemcu to Pc and with he is conect to wifi and mqtt.
and the led strip is conect to source 12V and i connect PinD5 of nodemcu with data pin of led
when i start from HA Led Strip in Serial Monitor i see Set Power:On
but the ledstrip is off

i dont believe that is dont work.

i have one question: in your automation
- alias: “Living Room TV Animation Speed”
initial_state: True
hide_entity: True
trigger:
- platform: state
entity_id: input_slider.tv_animation_speed
action:
- service: mqtt.publish
data_template:
topic: “home/livingroom/tvleds/setanimationspeed”
payload: ‘{{ trigger.to_state.state | int }}’

you have entity_id : input_slider.tv_animation_speed_
and in my HA i have
entity_id: input_select.living_room_led_effect

i supose that i leave my entity_id and i dont change it like you???

and in serial port when i change color o Brightness i have this:
Set Power: OFF
Set Power: ON
Set Color: 188,164,255
Set Power: ON
Set Color: 6,0,193
Set Power: ON
Set Color: 0,12,198
Set Power: ON
Set Brightness: 131
Set Power: ON
Set Effect: Star Wars

dont know how dindt work

right now the ledstrip (300leds) is connect to source 12V…10Amp and data pin is connect to NOdeMCu which is connect to pc with usb cable

why didnt work? i have to put one source with more amperios? like 12V…30Amp?

Sounds like the wiring is off somehow. The nodemcu sounds like it is getting the info from homeassistant ok. Check your wiring

then the config yaml its ok??

only the wiring is the problem??

but now i have connect the Nodemcu with usb cable to pc and Pin5 of NodeMcu to led (cable green)
The source power 12V…10A to led. (cable red + and cable white -)
this wiring is ok??

finally almost done.
its on but i cant change the color. now have a lot of color. i cant put only one color.
effect its work
Brightness dont work
i have to calibrate???

When I turn off the led from HA the color of led goes off but the led does not turn off it stays white with a lot of brightness and the last 12leds are red

I don’t know but it sounds like your strip may be bad. I had some trouble when i hooked mine up and I think I wired it wrong or something an burned out a strip or part of a strip. I may be that the connector wasn’t connected tighly on the led strip for me too. Shouldn’t have to calibrate brightness. It sounds like you are close though.

and the source power i have 12V…30A

Did you think that is the problem???

Which one do you have?can you send me a page web?

Sounds like communication on the strip

Have a look at the adafruit wiring suggestions. Try from https://learn.adafruit.com/adafruit-neopixel-uberguide/basic-connections?view=all#ws2811-driver-ic

You may need a resistor in the data line - also note their suggestion to add a capacitor across the power supply and the suggestion of adding power to the far end also to account for voltage drop across the strip.

I have used 5m 5v WS2812 strips … sometimes they do have the odd pixel that gets the wrong message and mis-behaves until it gets its next instruction.

Should be solveable.

Good luck

hy
i have 3 nights to work for that and dont work.
i buy one transistor 470ohm and one 270Ohm. i will intent with that.

but you have right with the led. i have 8211 and you have 8212. (is much better…NeoPixel)
and now i have to cut first 3 leds because if not dont work.
i will try with the transistor and if dont work i will use them for
Christmas tree. :joy::joy:The worst thing of all is that I bought 3 strip led for my kitchen.

In all the bad at least the led effect works and he can use it as a Christmas decoration. Just need to install a sonoff swich to interrupt the LED power supply.:joy::joy::joy::joy:

TThank you very much to everyone and when I’m going to work I’ll tell you.
thx a lot again

Hy phileep

Before i buy it i want to ask you if with this led will i have the same problem?
and with power source 5v…20A for 3 x5m 60led/m IP65.
and 3.3v to 5v Logic Level Shifter

Thx a lot. And now i will buy only one for see if work. and the another 2, if work. because then i have too much led for Christmas tree.:joy::joy::joy::joy::joy::joy::joy::joy::joy::joy:

And after 2 hours i just remember that i buy this led because in code of Bruth we have:
#define NUM_LEDS 186
#define DATA_PIN 5
//#define CLOCK_PIN 5
#define CHIPSET WS2811
#define COLOR_ORDER BRG

The strips you link to look like my 5v ones I have used in similar sketches. The WS2812B’s are 3.3v tolerant, so I used but later removes the logic level shifter for my project. Just connected my data pin on the nodeMCU via a resistor to the data in of the LED strip.

But I think you should be able to also get your 12v strip working using a resistor in line with the data line and perhaps terminating the data line to ground at the far end of the strip. And add a capacitor across the 12v power +/- of the strip to handle voltage drops when drawing high power.

Also, try and minimise the distance form the nodeMCU to the first led.

i just buy the transistor 470 and 220 but you have right and i will buy tht capacidor right now because i want to build wiring like this.

and then i dont buy Logic Level Shifter .
i think that capacitor 470ohm is enough for 5m led strip. dont know if i need for another capacitor for source. but the led ws2812B is 5v and i buy one source 5v…20A for this 5m led.normaly i need only 7-8A.

what do you think about this capacitor 1000uF / 16V? will i need him?
thx a lot for you help me.
and if you say me that you dont have problem with this stripled ws2812B i will buy 3 pcsx5m.
right now i have nodemcu amica v3 conect to pc and one wire from d5 to data of led strip. source power 12V…30A and conect with led ( red to 12V and white to GND). the most important is that the led dont shutdown when i disconnect wire cable from d5.(or i shut down from HA). Effect led work very well with transision same but the color is white-blue and the half of stripled 5-6 led with color red.i cant change the color or Brightness.

  • when i shut down the led i have in serial monitor
    Message arrived [bruh/porch/set] {“state”: “OFF”}
    state
    Setting LEDs:
    r: 0, g: 0, b: 0
    and then effect led stop and color is white.but the led is not shutdown. only if i disconnect powersource.

is the any probality that the code is wrong o config.yaml is wrong?? o its sure that the electrical wiring and the led is bad?

thx a lot
my NodeMcu is 5cm far of ledstrip.
can you send an example with your resistor?

With your current setup - you are getting no colour change or reaction at all when you send data?

If so, sounds like your strip is not “hearing” your data line.

Have you tried a different pin? D1 I have used before - I seem to recall D5 or D6 are linked to the LED on my nodeMCU’s - so they are doing multiple things!

What data logic level does the 12v strip accept? will it take 3.3v direct, or does it have to be 5v or 12v?

i have logic level :

https://es.aliexpress.com/item/5PCS-IIC-I2C-Logic-Level-Converter-Bi-Directional-Module-5V-to-3-3V-TE291/32493172165.html?spm=a219c.10010108.1000016.1.wl1tjo&isOrigTitle=true

5v or 12v:

NodeMcu:

https://es.aliexpress.com/item/NodeMcu-Lua-WIFI-Internet-Development-Board-Based-on-ESP8266-CH340G-Board-TE390/32620941471.html?spm=a219c.10010108.1000016.1.JvLtf3&isOrigTitle=true

To me it sounds like your topics don’t match. I copied and posted my code on here for you to use but it your post it looks like you are using Bruh’s code still.

Make sure the MQTT topics match your NodeMCU or things won’t change when you try to change things in HA.

and now i will sending you my wiring.

the logic level had H…5v and GND
L… 3v and GND

and 3 pins H right bidirecional
3 pins L left bidireccional
and i connect one wire to D5 and L (last pin to end the board)
one wire H to data of ledstrip

Have you proven your wiring with a test script from the fastled or adafruit examples?

That would help to prove the nodeMCU can control the strip before stepping into the HASS world.

Like @grangemd suggested - it may just be HASS config. Prove the wiring first, then you are in to config on HASS.