BRUH Led strip config

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: )

where did you get the code for the extra effects? can you post the ardunio code please?

There you go :slight_smile:

This is the code I use :wink:

@touliloup, thank’s man, you did it - AGAIN!
But now I have brightness, but lost animation speed. Any idea why?

Try to just have one input_number block instead of 2:

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

It works! Thank you, you compiled a nice piece of led strip remotley! :wink:

Here is the config file that works awsome thank’s to @touliloup

add this to your main configuration.yaml

homeassistant:
  name: Home
  latitude: secret latitude
  longitude: secret longitude
  elevation: 110
  unit_system: metric
  time_zone: Europe/Zagreb
  customize: !include customize.yaml
  packages: !include_dir_named packages

Create folder named PACKAGES and create confguration file in that folder for led strip (for example: rgb_tape.yaml)

Here is the complete config file:

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  
      - 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
  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_number.strip_brightness.state | int }}'

And here is the link for the sketch I used for NodeMCU.

6 Likes

Cool, glad that you got it working and nice of you for posting the complete code and the arduino sketch. I’m sure it will be useful to many people :slight_smile:

Another situation using the strip…
I have automation setup when I start kodi, lights turn off, and when I stop Kodi lights turn on.

- alias: kodi stop
  trigger:
    - platform: state
      entity_id: media_player.kodi
      from: 'playing'
      to: 'idle'
  condition:
    - condition: state
      entity_id: sun.sun
      state: 'below_horizon'
  action:
      service: light.turn_on
      entity_id: light.rgb_traka

- alias: kodi play
  trigger:
    - platform: state
      entity_id: media_player.kodi
      to: 'playing'
      from: 'idle'
  condition:
    - condition: state
      entity_id: sun.sun
      state: 'below_horizon'
  action:
      service: light.turn_off
      entity_id: light.rgb_traka

For now it only works with start/stop, I would love to have it work with pause/resume too - anyone knows how to achieve this?
Also, The light I’m turning on/off is this RGB strip from the post, how can I add transition effect, and set some type of brightness when the light is on (don’t want it at full brightness)?
Iv tryed adding transition: 2, but that brakes my automation…

You want to turn it on when paused and off again when resumed?
You can simply add a second trigger in each automation. But I’m not sure such a state exist, media player should go in idle when paused.

And you can remove the condition in your stop script (if it stop a stopped light, it’s not a problem), just to keep your code simpler.

You could try that for transition/brightness:

Did you try with this syntax?

action:
  service: light.turn_on
  entity_id:
    - light.rgb_traka
  data:
    brightness: 150
    transition: 2

Source:

This is what I did, and it isn’t working as expected.

- alias: kodi stop
  trigger:
    - platform: state
      entity_id: media_player.kodi
      from: 'playing'
      to: 'idle'
  condition:
    - condition: state
      entity_id: sun.sun
      state: 'below_horizon'
  action:
      service: light.turn_on
      entity_id: light.rgb_traka
      data:
       brightness: 150
       transition: 2

- alias: kodi play
  trigger:
    - platform: state
      entity_id: media_player.kodi
      to: 'playing'
      from: 'idle'
  condition:
    - condition: state
      entity_id: sun.sun
      state: 'below_horizon'
  action:
      service: light.turn_off
      entity_id: light.rgb_traka
      data:
       transition: 2

The light flickers and turns off, and when turning on, color changes… O.o

my strip colours are “odd”, if I set them as “white” “ivory” etc there are basically blue. Is this normal or have I missed some thing please?

      data:
        effect: solid
        brightness: 255
        color_name: ivory

How do you select colors? Witch sketch do you use?

same one that @1337hium posted above.

I wanted white lights when I walk into the kitchen so added this to my kitchen automation, but they are very blue :frowning:

      data:
        effect: solid
        brightness: 255
        color_name: White

Even if I use rgb_color: [255,255,255] still blue not white

Anyone have the same?

I guess it’s simply that your strip use a very cold white or maybe have an imbalance in the RGB balance, your can always use another value to have something closer to white.

Try playing with the color wheel in HA until it’s the color you’d like and then check the RGB value you just set (check in the states tab of HA: <> under Developer Tools)

yeah cheers I use the Colour “wheel” and it never has anything close to white… which is very frustrating.

Yep, that’s why there is some RGBW stip or RGBWW strip (RGB + White or RGB + Warm White) to resolve this issue.
It’s hard to achieve a “real” white with an RGB strip.

cannot find RGBWW in WS2811 however I have tested with a new similar set that I have and they have a lovely white but are only 30/m. I guess I must have a bad batch as this is blue, not even cold white and the new ones are white. Grrr means I need to swap them all out now :frowning:

Did you put 470ohm ressistor on data pin between nodemcu and led strip? I noticed there is difereent color order with ressistor and without one… Also I had 160 led setup until today, and everything worked like it should, but today when I added rest of the leds (total of 300 leds) things started to be wierd again… I have flickering again, but I think I should add Logic level shifter (3.3 on 5v bidirectional) on data pin as well as the ressistor?
Meybe you ahve the same issue…