BRUH Led strip config

I used this sketch, and modified it so it connects to my WiFi, and mqtt server.
Also i replaced this line of the code:

#define NUM_LEDS    160
#define DATA_PIN    5
//#define CLOCK_PIN 5
#define CHIPSET     WS2812B
#define COLOR_ORDER BRG

Here is my whole sketc C/P

Ok, so just replace:

#define COLOR_ORDER BRG

with:

#define COLOR_ORDER BGR

and it will solve your color problem :slight_smile:

As for the flickering, add the capacitor and it should solve your problem.

If it doesn’t, you can also feed the power and ground at the other end of your strip (but not data!). Especially if you notice that the led at the end of your strip have a flickering problem.

I tried this already, seems like i get few colors alright now… I will have to take a look after i get 470ohm ressistor today.
Also about the powering of the strip… Do I have to cut the strip in pieces to power it again, or I just take +and- from power to the end of the strip?
So the connection would go like this:
+and- from power to the beginning and the same +and- to the end of the strip? So the strip would be powerd on both sides? Data pin goes from the beginning only.

Also wich capacitor to use? I found some 1000 uF 16V?

That capacitor should be fine. Personally I’ve always used the color order: GRB for ws2812b (neopixels.) Yes you can just reapply the power to the leads on the back end of the strip and the data to the first pin.

On my way home I bought resistor and capatitor, but when I connected all of that, only few leds lighted up (only first 10 or so). So i removed ressistor, and whole strip lighted up, but flickerd like hell! I removed capatitor, and left power on both ends of the strip. Strip works but with the same old gliches. Also when I try to reduce brightnes, it changes colors instead of brightnes :joy:.
This is realy starting to stress me out!

I filmed so you can see this nastiness yourself…
Be warned, if you suffer from epilepsy, don’t watch this! :stuck_out_tongue_winking_eye:

Did you make other modification to the code? Did you try changing the effect speed? Maybe try to see if home-assistant is not sending too much command (check the log).
Really weird problem. Maybe the clock speed of your node mcu is off? Which would explain the weird communication on the data line (timing is important for those strip as they don’t have any clock line)

Finaly managed to get some better results.
I still get flickering, but not so much. I had bunch of ressistors at home so I tryed them on data pin, and with one of those (don’t know the ressistance of it) seems to work better. When i installed 470ohm resistor, only few leds lighted up… And finaly i managed to sort out color order (it is GRB). Also brightness started to work out as it should, no longer changes color when i adjust brightnes.
So, i have some promising results, but still get flickering. I did install the capatitor too, but only one capatitor for both ends of the strip. Meybe I should connect seperate capatitor for both ends of the strip?
I have separate outputs on the power supply, meybe I shuld use both of them? Its 5V 12A power supply with 2+ and 2- output on it. Curently I have all connected on 1 output.

I got rid of the flickering on my setup by adding to the top of the arduino sketch:

#define FASTLED_INTERRUPT_RETRY_COUNT 0
#define FASTLED_ALLOW_INTERRUPTS 0

I also changed random8 to random16 since I am using more than 256 leds and that was breaking some of the effects. Hopefully this helps.

Gonna try it out, thank’s

I was just about to post this, but just the #define FASTLED_INTERRUPT_RETRY_COUNT 0 as the other one casued me reboot issues.

I have had all sorts of issues with my kitchen ones, because there was so much space between 2 sets of LEDS the data signal dropped that much I had huge flickering. So I split them, with 2 nodeMCUs, 1 each side of the kitchen cupboards.

I still had to remove the 3.3v to 5v converter as that also caused issues on 1 part of the LEDs, drove me crazy trying to sort it.

1 Like

That finaly worked out, but as @MarkR said, I got some restart issue, so ill try it without

#define FASTLED_ALLOW_INTERRUPTS 0

Ill make some video later today, when I’m back home from work.

Thank you all for helping me out, I will put my config and sketch on github and link it here for future use, meybe it will help others with similar project.

Edit: here is the video of new sketch.
Sry about the quality, just couldn’t wait to get home so I had this filmed with lower quality phone…

Is it possible to add temperature sensor to the same nodemcu?

Possible: yes, recommended: not so sure.

You might have problem with the precise timing needed to control those led with the addition of a temperature sensor.

Honestly you’d better spend 4,70$ and buy a Wemos D1 + a SHT30 shield, that will give you a precise temperature sensor (with humidity as a bonus) and you won’t be messing with your current installation :slight_smile:

Will order those too!
My xiaomi gateway should come this week, so meybe i won’t be needing another temp sensor.
The lights finaly work as they should, it would be awsome to sync them to music…Is there a way to do it?
The music would come from kodi box (PI 3) already added to HA (HA has dedicated PI3 box).

Anyone know how to add brightness slider outside, just like animation speed?

everything works here,and i understand.
what i dont understand and doesnt work is this :
service: mqtt.publish
data_template:
topic: “bruh/porch/set”
payload: ‘{“transition”:{{ trigger.to_state.state | int }}}’

i try to publish in mqtt,i try to publish in services in hass…nothing happens

any idea how to use this command?? and is this for random loop effects?

Never seen a way to do that. Not through HA at least. Maybe Kodi could control a light through mqtt, but you’ll have to see with the Kodi team.

You can add an input number inside your RGB traka group (define the input_number somewhere and then add - input_number.strip_brightness as entity in the RGB traka group)

input_number:
  strip_brightness:
    name: Brightness
    icon: mdi:brightness-7
    initial: 100
    min: 5
    max: 255
    step: 1

And an automation that react when you change the value of the slider:

automation:
  - alias: "brightness_has_changed"
    trigger:
      platform: state
      entity_id: input_number.strip_brightness
    action:
      - service: light.turn_on
        data_template:
          entity_id: light.my_super_lamp
          brightness: '{{ states.input_slider.strip_brightness.state | int }}'

I didn’t test it myself, so they might be some adjustment needed ^^ don’t forget to replace the entity_id in the automation with the name of your lamp.

I’m doing something wrong probobly…
Here is my code (package) for the strip

light:

  • platform: mqtt_json
    name: “RGB traka”
    state_topic: “rgb/abovetv”
    command_topic: “rgb/abovetv/set”
    effect: true
    effect_list:
    • bpm
    • candy cane
    • animations
    • template
    • blendwave
    • beatwave
    • blur
    • confetti
    • confetti 2
    • confetti pal
    • dotbeat
    • easing
    • every n example
    • fill grad
    • inoise8 mover
    • inoise8 pal
    • noise 16 1
    • noise 16 2
    • noise 16 3
    • one sine pal
    • palette cross fade
    • rainbow march
    • rainbow beat
    • ripple pal
    • sinelon
    • 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_number:
animation_speed:
name: Animation Speed
initial: 150
min: 1
max: 150
step: 1

input_number:
strip_brightness:
name: Brightness
icon: mdi:brightness-7
initial: 100
min: 5
max: 255
step: 1

automation:

  • alias: “RGB traka Animation Speed”
    initial_state: True
    hide_entity: False
    trigger:

    • platform: state
      entity_id: input_number.animation_speed
      action:
    • service: mqtt.publish
      data_template:
      topic: “rgb/abovetv/set”
      payload: ‘{“transition”:{{ trigger.to_state.state | int }}}’
  • alias: “brightness_has_changed”
    trigger:
    platform: state
    entity_id: input_number.strip_brightness
    action:

    • service: light.turn_on
      data_template:
      entity_id: light.rgb_traka
      brightness: ‘{{ states.input_slider.strip_brightness.state | int }}’

Change input_slider to input_number in the automation action (I took some part of older post, sorry :relaxed: )