MQTT, LED, NodeMCU Issue

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.

right now its only connect to pc whitout logig level and transformador 12v…5v.
if you want i can connect logic level and i send you one foto o video.??

but how do you say i think the problem is data and the stripled. but one think i dont understant : if wire data dont work why can i send the effect data??? and transition data?

when i send effec i have:
Message arrived [bruh/porch/set] {“state”: “ON”, “effect”: “police all”}
police all
Message arrived [bruh/porch/set] {“state”: “ON”, “color”: {“r”: 20, “b”: 239, “g”: 0}}
0, “b”: 239, “g”: 0}}
Message arrived [bruh/porch/set] {“state”: “ON”, “brightness”: 132}
ess
Message arrived [bruh/porch/set] {“state”: “ON”, “effect”: “police one”}
police one
Message arrived [bruh/porch/set] {“state”: “OFF”}

i have automacion

  • alias: “Porch Animation Speed”
    initial_state: True
    hide_entity: False
    trigger:
    • platform: state
      entity_id: input_slider.porch_animation_speed
      action:
    • service: mqtt.publish
      data_template:
      topic: “bruh/porch/set”
      payload: ‘{“transition”:{{ trigger.to_state.state | int }}}’

lights:
platform: mqtt_json
name: “Porch Strip”
state_topic: “bruh/porch”
command_topic: “bruh/porch/set”
effect: true
effect_list:

  • bpm
  • candy cane
  • confetti
  • cyclon rainbow
  • dots
  • fire
  • glitter
  • juggle
  • lightning
  • noise
  • police all
  • police one
  • rainbow
  • rainbow with glitter
  • ripple
  • sinelon
  • solid
  • twinkle
    brightness: true
    flash: true
    rgb: true
    optimistic: false
    qos: 0

input slider:
porch_animation_speed:
name: Porch Animation Speed
initial: 150
min: 1
max: 150
step: 10

and code for nodemcu

FastLED.h:17:21: note: #pragma message: FastLED version 3.001.003

pragma message “FastLED version 3.001.003”

arduino-1.8.3\portable\sketchbook\libraries\FastLED/FastLED.h:65:0,

Downloads\Compressed\ESP-MQTT-JSON-Digital-LEDs-master_2\ESP-MQTT-JSON-Digital-LEDs-master\ESP_MQTT_Digital_LEDs\ESP_MQTT_Digital_LEDs.ino:26:

Desktop\arduino-1.8.3\portable\sketchbook\libraries\FastLED/fastspi.h:110:23: note: #pragma message: No hardware SPI pins defined. All SPI access will default to bitbanged output

pragma message "No hardware SPI pins defined. All SPI access will default to bitbanged output

and i have this error when i upload the code

so what is in your nodemcu?

These need to match what is in the NodeMCU. I posted this above. My NodeMCU code and HA files match so you should just have to copy and paste. If you change it in one location you need to change it in the other.

only i change the number led. 45 chip x 3 leds …135leds. almost 2,5m led

can i change the code for D1 or D4? like did you say.

Hy Grangemd

i used another Nodemcu and i was upload code of Bruth and now work both. right now i use of the bruth. i just change all config yaml like i send here . your config.yaml its safe an another director and i useit with another nodemcu.
i was intent all way to see if i can make it. now i will wainting for transistor 470 and 220ohm.

@danielaradu2016 it sounds like you are trying to change 10 different things and solve all the issues at once. you need to do what @phileep told you to do and prove the nodeMCU out then move onto the HASS world. Personally I think your nodeMCU code does not match your HASS information but everytime you post something I get more confused about what you are doing or what you are asking. You asked me to post my code so I did but it seems like you aren’t using it. If you ask me to help and post my code but then avoid using it then don’t waste my time.

hy Grangemd

Please forgive me first, because I have disturbed you so much. I was desperate and for this I tried both. With yours also worked but the effect of led could not stop it and when I have seen that with bruth I can stop it only left blank then I decided to rezolve this problem to turn it off and then return to your codico which I have saved.
Again please forgive me and thank you very much for everything

my mqtt work well. i have all this in my serial monitor.
thx a lot again. i will try with the transistor when he arrive.
Setting LEDs:
r: 0, g: 51, b: 70
Message arrived [bruh/porch/set] {“state”: “ON”, “color”: {“r”: 0, “b”: 147, “g”: 27}}
, “b”: 147, “g”: 27}}
Setting LEDs:
r: 0, g: 25, b: 137
Message arrived [bruh/porch/set] {“state”: “ON”, “color”: {“r”: 0, “b”: 249, “g”: 71}}
, “b”: 249, “g”: 71}}
Setting LEDs:
r: 0, g: 66, b: 233
Message arrived [bruh/porch/set] {“state”: “ON”, “color”: {“r”: 24, “b”: 255, “g”: 171}}
4, “b”: 255, “g”: 171}}
Setting LEDs:
r: 22, g: 160, b: 239
Message arrived [bruh/porch/set] {“state”: “ON”, “color”: {“r”: 169, “b”: 190, “g”: 0}}
69, “b”: 190, “g”: 0}}
Setting LEDs:
r: 158, g: 0, b: 178
Message arrived [bruh/porch/set] {“state”: “ON”, “effect”: “sinelon”}
sinelon
Message arrived [bruh/porch/set] {“state”: “ON”, “brightness”: 105}
ess
Message arrived [bruh/porch/set] {“transition”:51}
transition
Message arrived [bruh/porch/set] {“transition”:21}
transition
all effect and transition work very very well.

Did you get it working?
I had the exact same problems as you described and did not get it to work.

Have you guys tried posting in Ben’s forum? BRUH Automation forum he keeps an eye on there and others that have used and troubleshooted the MQTT LED setup are on there.

Will

Hello all, I am trying to setup the digital led strip with the NodeMCU v2. Using ESPlorer, I can see that it successfully connected to my wifi and to my mqtt server and when I send the command to turn on the lights it shows the NodeMCU receiving the command and setting the lights to r:255 g:255 b:255 so they should turn on all white but nothing happens. I’ve measured and at the end of the strip I have 5V (same input voltage) so that isn’t a problem. The program is supposed to output to pin D5, what kind of voltage/amps should I expect when the command is sent to see if the pin is actually outputting anything? Thanks!

I have really been struggling to get consistent results with the Bruh video, so I went all the way back to square one and copied a simple ‘blink’ sketch from fastled github.

I figured out I didnt have the nodemcu grounded to the power supply and once that was connected i got it working simple sketches. Maybe start there and see if you can get the led to do a couple sketches before trying to copy over all of the wifi/mqtt stuff and getting it to work with HA.