Flux_led Light works on a switch, but can't program?

I’ve got a run of inexpensive (<$30) LED strip lights around my TV. I chose the no-name Chinese brand I did based on some quick research on these forums. The consensus seemed to be that if it was controlled by the Magic Home phone app, I’d have good luck.

Well, I have partial luck.

I can put the strip in as a toggle switch, click the name, and get the color & brightness wheel. But I can’t figure out how to send settings from my own code.

In configuration.yaml, I’ve got:

  light:
  - platform: flux_led
  devices:
  192.168.1.6:
    name: tv_lights
    mode: "rgbw"

In my entities card where I’ve got a bunch of other lights, it’s listed as

- entity: light.tv_lights
  name: TV Lights
  icon: mdi:television-classic

Operating it from here works perfectly.

But I want to set up some scenes/scenarios, so I tried an entity-button.

- type: entity-button
  icon: mdi:television-classic
  tap_action: call-service
  entity: script.led_lightblue

It’s in a script because I eventually planned to call a bunch of other things in sequence.

The script is:

led_lightblue:
  sequence:
  - service: light.turn_on
    data:
      entity: light.tv_lights
      rgb_color: 49,98,176
      brightness: 200

This seemed to be the best combination of commands I could cobble together from a bunch of sparse documentation and forum posts. When I press the entity button, I get nothing - not even an error.

Can anyone help me debug this setup?

Hi,

I think you are bumping into a problem that I was bumping into – you are passing a string into the Entity with rbg_color. Try putting [49,98,176] to pass as an array.

Here is my work-around for my scenario - I wanted specific colors based on weather sensor:

  • service: homeassistant.turn_on
    entity_id:
    • switch.mbr__bryan_light
  • service: homeassistant.turn_on
    data_template:
    entity_id: light.b2mbrled
    brightness: 255
    color_name: >-
    {% if is_state(“sensor.dark_sky_icon”, “snow”) %}
    orange
    {% elif is_state(“sensor.dark_sky_icon”, “partly-cloud-day”) %}
    yellow
    {% elif is_state(“sensor.dark_sky_icon”, “rain”) %}
    blue
    {% else %}
    white
    {% endif %}

Thanks, that partially worked. The lights turn on now.

However, no matter what color is sent from the script, they turn on with the last color used. Running the script a second time changes it to the color in the script.

I wonder if I need a delay or something… any guesses?

Just following up… I got this working, probably to the best I’ll be able to, for a $27 strip of LEDs.

led_lightblue:
  sequence:
  - service: light.turn_on
    data:
      entity_id: light.tv_lights
      brightness: 128
  - delay: "00:00:01"       <------- this is the key
  - service: light.turn_on
    data:
      entity_id: light.tv_lights
      color_name: "blue"
      brightness: 128

What you end up with is a momentary glimpse of the previous color (the first light.turn_on block), a teensy pause, and then your chosen color kicks in.

Here’s a brief video…