ESPHome and simple LED

Hello everyone!

I would like to integrate a simple monochromatic LED (like this: https://www.amazon.com/eBoot-Pieces-Emitting-Diodes-Assorted/dp/B06XPV4CSH – of course attached with a 200 ohm resistor) in my ESPHome to show the status (via MQTT?) of the alarm in homeassistant (actually is just the status of an automation!)… any idea of what can I do?
Thanks

Any suggestions?

seems simple enough… You dont need MQTT because esphome already has a native integration with HA. Using a esp8266 and something like this as the code (see the docs how to use the wizard, then add the led specific configuration):

output:
- platform: esp8266_pwm
  id: my_led
  pin: GPIO13

light: 
- platform: monochromatic
  name: "Alarm led"
  output: my_led
1 Like

It works!!
Thanks a lot

1 Like

Hi
How you do it?
I have esp8266 and simple led on the bord pin D7.
What the code you used in Arduino burn device?

is there a way to do this on esp32?

I think so. But instead of using the esp8266_pwm platform you should use ledc platform. Check this:

1 Like

This worked for me

output:
  - platform: ledc
    pin: GPIO32
    id: gpio_32

light:
  - platform: monochromatic
    output: gpio_32
    id: LED1
    name: "LED"
1 Like