Anybody got a config for "LVWIT" RGBW bulb?

I’ve bought these bulbs from amazon:

They use the tuya smart app so I hoped they would flash ok without me having to open them up. Downloaded tuya-convert onto my pi4 and flashed them with esphome no problem. Trouble is the example config I used is for a mirabello bulb that I hoped was similar and now although I can turn the bulb on and off and dim it via esphome\home assistant I cannot control the colour at all, which was working fine through the tuya app.

When I did my first flash with tuya-convert it had the following info:

Getting Info from IoT-device
VTRUST-FLASH 1.5
(c) VTRUST GMBH https://www.vtrust.de/35c3/
READ FLASH: http://10.42.42.42/backup
ChipID: 64e234
MAC: EC:FA:BC:64:E2:**
BootVersion: 7
BootMode: normal
FlashMode: 1M QIO @ 40MHz
FlashChipId: 1540c8
FlashChipRealSize: 2048K
Active Userspace: user2 0x81000

My current config that doesn’t work with RGB is:

output:
  - platform: esp8266_pwm
    id: output_red
    pin: GPIO4
  - platform: esp8266_pwm
    id: output_green
    pin: GPIO12
  - platform: esp8266_pwm
    id: output_blue
    pin: GPIO14
  - platform: esp8266_pwm
    id: output_white
    pin: GPIO5

light:
  - platform: rgbw
    name: "rgbw_01"
    id: light1
    red: output_red
    green: output_green
    blue: output_blue
    white: output_white

Has anybody got a working esphome config for these bulbs or could advise me on how to make my own?

There are 2 LVWIT bulbs on blakadder. Both use a PWM setup.

However some smart bulbs use a subsidiary chip. See https://esphome.io/components/output/my9231.html

Have you opened it? Often the top just pops off, with some not so gentle persuasion.

What’s blakadder?

No I haven’t opened it yet, I was hoping to avoid that, hence buying the bulbs that said they used the tuya app.

I may have found more info. I used the other bulb from the pack, copied the stock firmware off it, and then ran the .bin file through strings on linux and then grepped for anything that looked like config. Came up with this very useful bit of JSON:

{"light":{
  "rstnum":{"value":3},
  "Jsonver":{"value":"1.0.2"},
  "iic":{"iicc":{"value":3},
  "iicg":{"value":1},
  "iicw":{"value":4},
  "ctrl":{"value":16},
  "iicscl":{"value":4},
  "iicsda":{"value":14},
  "iicr":{"value":0},
  "iicb":{"value":2}},
  "ktime":{"value":5},
  "color":{
    "r":{"pin":{"value":4},"lv":{"value":true}},
    "g":{"pin":{"value":12},"lv":{"value":true}},
    "b":{"pin":{"value":14},"lv":{"value":true}},
    "c":{"pin":{"value":5},"lv":{"value":true}},
    "w":{"pin":{"value":13},"lv":{"value":true}}
    
  },
    "white":{
      "wg":{"value":70},
      "wr":{"value":100},
      "wb":{"value":75}
      
    },
      "coefficient":{
        "gg":{"value":60},
        "gr":{"value":80},
        "gb":{"value":60}
        
      },
        "ProdFunc":{
          "brightmin":{"value":5},
          "colormax":{"value":100},
          "module":{"value":"E3S-E3L-WE5P"},
          "wfcfg":{"value":"spcl"},
          "colormin":{"value":10},
          "pmemory":{"value":true},
          "cwmaxp":{"value":100},
          "dmod":{"value":false},
          "cmod":{"value":"rgbwc"},
          "brightmax":{"value":100},
          "onoffmode":{"value":true},
          "pwmhz":{"value":1000},
          "cwtype":{"value":false}},
          "connection":{
            "rstcor":{"value":"c"},
            "deftemp":{"value":100},
            "defcolor":{"value":"c"},
            "rstbr":{"value":100},
            "defbright":{"value":100},
            "rstmode":{"value":2}
            
          }
}}

Ah, perhaps I’ve misunderstood how these bulbs work! Now that I’ve added the cold\warm white pins I get another slider in home assistant, once I turn the new “white value” slider all the way to zero I can now see the RGB colour I’ve set coming through. As soon as the white value is above zero, the bulb turns white and completely drowns out any RGB colour that has been set. Is this how they’re meant to work? Two bulbs in one sort of thing?

It probably is how it is supposed to work.

Sorry, was referring to https://templates.blakadder.com. it is a template repository for tasmota, but easily translatable to esphome.

Ooh that’s really useful, thanks :slight_smile:

There is also esphome-configs.io. you can post there when you have it perfected :slight_smile:

I have these too and hadnt really looked here for the config but had found a similar one on blakadder which didnt work.
I did get the following to work though

which does tie in with the 5 pins used although not what they correspond to (but may well be the same)
I am currently trying to get them to flash but it doesnt look as though they have a native flash routine.
Seem ok though

I’ve added a few effects to mine now via lambda’s. My current config is:

esphome:
  name: smartbulb4
  platform: ESP8266
  board: esp01_1m
  comment: Back bedroom lamp
  on_boot:
    then:
    - light.turn_on:
        id: light4
        color_temperature: 410 mireds
        white: 100%
        brightness: 100%
        red: 100%
        green: 100%
        blue: 100%

wifi:
  ssid: "*****"
  password: "******"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Smartbulb4 Fallback Hotspot"
    password: "*******"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

output:
  - platform: esp8266_pwm
    id: output_red
    pin: GPIO4
  - platform: esp8266_pwm
    id: output_green
    pin: GPIO12
  - platform: esp8266_pwm
    id: output_blue
    pin: GPIO14
  - platform: esp8266_pwm
    id: output_cold_white
    pin: GPIO5
  - platform: esp8266_pwm
    id: output_warm_white
    pin: GPIO13

light:
  - platform: rgbww
    name: "Back bedroom lamp"
    id: light4
    red: output_red
    green: output_green
    blue: output_blue
    cold_white: output_cold_white
    warm_white: output_warm_white
    cold_white_color_temperature: 6536 K
    warm_white_color_temperature: 2000 K
    effects:
      # Use default parameters:
      - strobe:
      - flicker:
      - lambda:
          name: "Red Green Blue Fade"
          update_interval: 4s
          lambda: |-
            static int state = 0;
            auto call = id(light4).turn_on();                                                                           
            call.set_transition_length(3000);                                                                      
            if (state == 0) {                                                                             
              call.set_rgb(1.0, 0.0, 0.0);
            } else if (state == 1) {                                                                          
              call.set_rgb(0.0, 1.0, 0.0);
            } else if (state == 2) {                               
              call.set_rgb(0.0, 0.0, 1.0);
            } else {                                                       
              call.set_rgb(1.0, 0.0, 0.0);
            }                             
            call.set_white(0.0);
            call.perform();                                                                        
            state += 1;                                                                                           
            if (state == 3)
              state = 0;
      - lambda:
          name: PulsingRed
          update_interval: 2s
          lambda: |-
            static int state = 0;
            auto call = id(light4).turn_on();                                                                           
            call.set_transition_length(1500);                                                                      
            if (state == 0) {                                                                             
              call.set_rgb(1.0, 0.0, 0.0);
              call.set_brightness(1.0);
            } else if (state == 1) {                                                                          
              call.set_rgb(1.0, 0.0, 0.0);
              call.set_brightness(0.0);
            }
            call.set_white(0.0);
            call.perform();                                                                        
            state += 1;                                                                                           
            if (state == 1)
              state = 0;
      - lambda:
          name: "Random colour fade"
          update_interval: 3s
          lambda: |-
            auto call = id(light4).turn_on();    
            call.set_red_if_supported(random_float());
            call.set_green_if_supported(random_float());
            call.set_blue_if_supported(random_float());
            call.set_white_if_supported(0.0);
            call.set_transition_length_if_supported(2000);
            call.set_publish(true);
            call.set_save(false);
            call.perform();
    # Ensure the light turns on by default if the physical switch is actuated.
    restore_mode: ALWAYS_ON

Good work with that, you have built that into the esphome flashed onto the device then ?
I am using tasmota and have recently compiled some code for a nodemcu so will look at something similar for the lvwit too.

Hello, I have 4 GU10 LVWIT and I finally get them working using the sm2135 driver
My final config is:

substitutions:
  name: 'lvwit rgb'
  device: 'lvwit_rgb'

esphome:
  name: ${device}
  platform: ESP8266
  board: esp01_1m
  #on_boot:
  #  then:
  #  - light.turn_on:
  #      id: ${device}
  #      color_temperature: 410 mireds
  #      white: 100%
  #      brightness: 100%
  #      red: 100%
  #      green: 100%
  #      blue: 100%

wifi:
  ssid: "****"
  password: "****"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Lvwit Rgb Fallback Hotspot"
    password: "****"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: "****"

ota:
  password: "****"

sm2135:
  data_pin: GPIO12
  clock_pin: GPIO14

output:
  - platform: sm2135
    id: output_red
    channel: 2
  - platform: sm2135
    id: output_green
    channel: 0
  - platform: sm2135
    id: output_blue
    channel: 1
  - platform: sm2135
    id: output_cold_white
    channel: 3
  - platform: sm2135
    id: output_warm_white
    channel: 4

light:
  - platform: rgbww
    name: ${name}
    id: ${device}
    default_transition_length: 0s
    red: output_red
    green: output_green
    blue: output_blue
    cold_white: output_cold_white
    warm_white: output_warm_white
    cold_white_color_temperature: 6200 K
    warm_white_color_temperature: 2800 K
    effects:
      # Use default parameters:
      - strobe:
      - flicker:
      - lambda:
          name: "Red Green Blue Fade"
          update_interval: 4s
          lambda: |-
            static int state = 0;
            auto call = id(${device}).turn_on();                                                                           
            call.set_transition_length(3000);                                                                      
            if (state == 0) {                                                                             
              call.set_rgb(1.0, 0.0, 0.0);
            } else if (state == 1) {                                                                          
              call.set_rgb(0.0, 1.0, 0.0);
            } else if (state == 2) {                               
              call.set_rgb(0.0, 0.0, 1.0);
            } else {                                                       
              call.set_rgb(1.0, 0.0, 0.0);
            }                             
            call.set_white(0.0);
            call.perform();                                                                        
            state += 1;                                                                                           
            if (state == 3)
              state = 0;
      - lambda:
          name: PulsingRed
          update_interval: 2s
          lambda: |-
            static int state = 0;
            auto call = id(${device}).turn_on();                                                                           
            call.set_transition_length(1500);                                                                      
            if (state == 0) {                                                                             
              call.set_rgb(1.0, 0.0, 0.0);
              call.set_brightness(1.0);
            } else if (state == 1) {                                                                          
              call.set_rgb(1.0, 0.0, 0.0);
              call.set_brightness(0.0);
            }
            call.set_white(0.0);
            call.perform();                                                                        
            state += 1;                                                                                           
            if (state == 1)
              state = 0;
      - lambda:
          name: "Random colour fade"
          update_interval: 3s
          lambda: |-
            auto call = id(${device}).turn_on();    
            call.set_red_if_supported(random_float());
            call.set_green_if_supported(random_float());
            call.set_blue_if_supported(random_float());
            call.set_white_if_supported(0.0);
            call.set_transition_length_if_supported(2000);
            call.set_publish(true);
            call.set_save(false);
            call.perform();
    # Ensure the light turns on by default if the physical switch is actuated.
    restore_mode: ALWAYS_ON
1 Like