What am I missing here? [scenes, LED effects]

Hi,
I’m stuck at the last part of my latest project: https://imgur.com/gallery/8B8pMMk

I am trying to recreate this project since the original poster didn’t make a tutorial. Short version of where I’m at:
I placed a LED strip in the lamp, connected a Wemos D1 mini to it and configured that using ESPhome. So far so good, I can control the LED strip with HA using MQTT, set effects and so on.
I have added a weather sensor which gives me the necessary data to know whether it will be rainy, snowy, sunny, cloudy etc.
I have also created scenes and automations.

The problem:
When I trigger a scene, nothing happens to the LED strip.

The scene code that I currently have:

  - name: rain
    entities:
      light.led_cloud:
        state: on
        effect: Rain
        brightness: 255
        hs_color: 210.118,100
        rgb_color: 0,126,255
        xy_color: 0.14,0.135
        white_value: 59

The values (like ‘brightness’, ‘hs_color’, ‘rgb_color’ and so on) I copy-pasted from the states menu in HA after tweaking the values untill I got the desired effect. Did I do this correct or am I not supposed to copy-paste these values like this in a scene?

The automation code:

  - alias: "Cloudlamp Rain" 
    initial_state: true
    trigger:
      platform: numeric_state
      entity_id: sensor.br_rainchance_1d
      above: 50
    action:
      - service: scene.turn_on
        entity_id: scene.rain

Manually triggering the scene doesn’t do anyhting, as in: the LED strip doesn’t change it’s effect or color or whatsoever.

Doesn’t having each hs_color rgb_color and xy_color override each other ?

What happens when you only set one ?

I tried each of those separately but still no result :frowning_face:

I found a solution! Instead of using scenes, I specify the necessary information in the automation itself. Example for rain effect:

  - alias: "Cloudlamp Rain" 
    initial_state: true
    trigger:
      platform: numeric_state
      entity_id: sensor.br_rainchance_1d
      above: 50
    action:
      - service: light.turn_on
        data:
          entity_id: light.led_cloud
          transition: 1
          rgb_color: [0,126,255]
          brightness: 255
          white_value: 59
          effect: Rain

@ cooljimy84
Like you suggested I only specified one line of colour information. That’s enough for it to work :slight_smile:

would you mind posting your ESPhome code? I’m interested in how you did the effects

ofcourse
note: I’m using the SK6812 LED strip, that has a 4th white LED. In the automation code that I posted I think that’s what the ‘white_value’ is for, so for a RGB strip that piece should be left out.

esphome:
  name: weathercloud
  platform: ESP8266
  board: d1_mini

wifi:
  ssid: "---"
  password: "---"

mqtt:
  broker: '192.168.1.132'
  username: '---'
  password: '---'  

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

light:
    - platform: neopixelbus
      pin: GPIO3
      num_leds: 20
      name: "cloud"
      variant: SK6812
      type: GRBW
      method: ESP8266_DMA
      effects:
        - random
        - strobe
        - flicker
        - addressable_rainbow
        - addressable_color_wipe
        - addressable_scan
        - addressable_twinkle
        - addressable_random_twinkle
        - addressable_fireworks:
            name: Lightning
            update_interval: 32ms
            spark_probability: 7%
            use_random_color: false
            fade_out_rate: 120      
        - addressable_flicker:
            name: Rain
            update_interval: 30ms
            intensity: 20%
        - addressable_flicker:
            name: Snow
            update_interval: 350ms
            intensity: 50%  
1 Like

Great work. Will this work with a NodeMCU ?

How easy are the shows to make for example I want to do some orange/red eyes moving along the line and fading in and out in various places and then some stuff for xmas.

Do you have a screen shot of this in HA too ?

Thanks

Martyn

I don’t see why it shouldn’t work with nodeMCU.
Regarding the effects: on ESPHome there’s a bunch of pre-made effects that I customised a bit to get the desired effects. The effects list isn’t very long but there’s also a way to create effects from scratch.

Hi

I will try, thanks.

What code did you put in Home Assistant to control it ?

Ive seen some code where it looks like each colour needs a pin…is that true or can all this run on 1 pin ie D1 ?

Thanks

Martyn