Hi,
I’m kind of new with esphome and have hard time to understand how to get the leds working on my wifi plug. Could some one help with this?
There are two GPIOs, I think that is in used for the leds(red light and green light). Found some information from a Russian webpage:
GPIO4 is green led
GPIO5 is red led
With my yaml even the red does not work at all, button and relay works fine.
Would like to have it like this:
- When plug is ON green led would be on.
- When plug if OFF red led would be on.
Here is my yaml file:
esphome:
name: indoor_wifi_plug_2
platform: ESP8266
board: esp8285
wifi:
ssid: ""
password: ""
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: ""
password: ""
captive_portal:
# Enable logging
logger:
# Enable Web Server (optional)
web_server:
port: 80
# Enable Home Assistant API
api:
ota:
# Text sensors with general information
text_sensor:
- platform: version
name: indoor_wifi_plug_2_version
- platform: wifi_info
ip_address:
name: indoor_wifi_plug_2_ip
ssid:
name: indoor_wifi_plug_2_ssid
bssid:
name: indoor_wifi_plug_2_bssid
binary_sensor:
- platform: gpio
pin:
number: GPIO13
mode: INPUT_PULLUP
inverted: true
name: “indoor_wifi_plug_2 Power Button"
on_press:
- switch.toggle: relay
- platform: status
name: “indoor_wifi_plug_2 Status"
switch:
- platform: gpio
id: red_led
pin:
number: GPIO4
inverted: true
#restore_mode: ALWAYS_OFF
- platform: gpio
name: “indoor_wifi_plug_2"
pin: GPIO12
id: relay
sensor:
# Uptime sensor
- platform: uptime
name: indoor_wifi_plug_2_uptime
# WiFi Signal sensor
- platform: wifi_signal
name: indoor_wifi_plug_2_wifi_signal
update_interval: 10s
time:
- platform: homeassistant
id: homeassistant_time