H-bridge Light

The hbridge light platform creates a dual color brightness controlled light from two float output component.


H-bridge lights are very common for Christmas lighting and they use 2 wires for a bunch of LEDs. The pins are switched alternatively to allow two sets of lights to operate.

# Example configuration entry

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

# Create a light using the hbridge
  - platform: hbridge
    id: mainlight
    name: "Hbridge Lights"
    pin_a: pina
    pin_b: pinb

Configuration variables:

  • id (Optional, ID): Manually specify the ID used for code generation.

  • name (Required, string): The name of the light.

  • pin_a (Required, ID): The id of the first float Output Component to use for this light.

  • pin_b (Required, ID): The id of the second float Output Component to use for this light.

  • All other options from Light.


As we are switching the h-bridge in software, the light may glitch every so often when other tasks run on the MCU.

See Also