H-bridge Light with brightness and white value stopped working after ha core update 2021.8

Hello everyone,

I have a h-bridge light set up on a esp8266 with esphome (according to H-bridge Light — ESPHome). It was working nicely until the update of homeassistant core to 2021.08.0 (and newer).
Since the update I only have the ability to switch the light on and off. The sliders for brightness and white value are not available in the light card any more.

Does anyone know what happened?
Really would like to dim my light again.

Here is my esphome config:

esphome:
  name: schlafzimmer_himmel
  platform: ESP8266
  board: esp01_1m

 
# Ensure the light turns on by default if the physical switch is actuated.
  on_boot:
    priority: 600.0
    then:
      - light.turn_on:
          id: schlafzimmerhimmel
          brightness: 100%
          white: 50%


wifi:
  ssid: "my_wifi_ssid"
  password: "xxx"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Schlafzimmer Himmel"
    password: "xxx"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

web_server:
  port: 80
  
# Specify the two pins of the h-bridge as PWM pins
output:
  - platform: esp8266_pwm
    id: pina
    pin: GPIO12
  - platform: esp8266_pwm
    id: pinb
    pin: GPIO14

# Create a light using the hbridge
light:
  - platform: hbridge
    id: schlafzimmerhimmel
    name: "schlafzimmer himmel"
    pin_a: pina
    pin_b: pinb
            

I noticed this last night also.
I will look into it

There have been changes to light integrations lately. 2021.5 2021.5: Stability, performance, triggers, color modes!

I am not sure if this change has affected the h-bridge esphome light integration.

The esphome source for hbridge was updated 18 days ago for “color mode implementation” - perhaps if you update esphome? History for esphome/components/hbridge/hbridge_light_output.h - esphome/esphome · GitHub

Also there were esphome light changes in 2021.0 - see 2021.8.0: Feel the energy ⚡️ - Home Assistant

Yes, happen to my yeelight too, work ok in HA but when HA pass the light externally it become just an on / off light. the last working version for me is 2021.6.6

Fixed and made a pull request

Thank you very much!!!

Is this fix already implemented? I still see only a on/off switch. I purchased some Christmas lights which I would like to control with a h-bridge. Can’t get it to work. No output voltage on the h-bridge.

Hey, it’s implemented and works for me. Currently I’m running ESPHome v2021.11.4. Make sure you have an up to date version (check Supervisor-> Add-On Store).Screenshot 2021-12-05 212700

Thanks for the schreenshot, I do have the same screen. So that fine now.

But now I am not sure if this is the correct module for what I want. Where do you use this for? And how can I messure the correct output?

I have 2 wire christmas lights. Just white, no color. There is this czjutai v31 adapter which goes to demo mode each time I power them on. This adapter also switches +/- quickly to create effects or make them static. I want to print a box where I can screw my lights in and control them in HA.

Any advise? Using a L298N h-Bridge with a D1 Mini

Edit: Connected the string of lights and it worked. Now I have to find a decent power supply to power multiple strings, because a benchsupply next to the tree look strange. :grin:

Great that it works for you :slight_smile: I’m using it with some cheap warm white fairylight (https://smile.amazon.de/gp/product/B07JX7W35T/ ) as a dimable ceiling light in the bedroom. Also have some additonal ws2182 fairy light running with wled up there but mostly I just use the warm white once.Pretty happy with this solution

Hi, I’m using @DotNetDann’s component for dual-colour christmas lights (warm-white/coloured) but the PWM behaviour isn’t ideal. The duty cycle is always half what it should be, and the lights have a visible flicker.

I’ve taken a photo of my (very basic) oscilloscope. It only has one channel. Here it is showing the pin driving the warm-white strand. The light component is set to max brightness at 100% warm white. We should expect the duty cycle to be 100% high. Instead it is 50%.

From looking at the code, it seems the component spends half the time driving the forward strand and half the time driving the reverse strand… even if the reverse strand is on 0%.

My workaround at the moment is to use “h-bridge fan” component, which allows the PWM to go up to 100%. Are there better solutions?

Hello there. Would you please post your code and a picture or diagram of your wiring? I want to control a string of the cheap white fairy lights. Thanks!

Hi laca75tn, the esphome code is posted in the first post. I have the setup in a place which is difficult to access therefore the snapshot is not the best.

There is 5V and GND connected to the H-Bridge (at the 3 port screw terminal). From there I also power the esp 8266, if you check the heat shrink you can see two smaler cable going to the esp. The esp has GPIO12 and GPIO14 connected to the H-Bridge (the jumper cable). The fairy lights are connected to one of the 2 port screw terminals.

Hope this helps.

BR


1 Like

Thanks! This is what I needed.

Dude, have you had any success using the fan component? I connected my LED strip to the L298N, using the h-bridge light component but the lights keep “flickering”. It seems to me that it makes sense with what you mention in the photo of your oscilloscope.

The ESP is doing a software H-bridge which is not ideal. Because of this, if there are other process that are not very quick then a ‘flicker’ occurs. It is annoying however I have not found another way around it as other processes still need to occur, and it is not running on its own thread/cpu. For me it only appears when you send changes to the light.