I recently flashed a couple smart plugs with esphome:
Goklug:
I have the various parts in place to control it (relay, power button, power LED). I thought I might add a voltage usage sensor since there is nothing (that I know of) in the plug using the adc pin. However, when I add the VCC sensor, the power LED stops working. I can post my full esphome yml if needed, but here are the parts for the LED and the VCC sensor:
switch:
- platform: gpio
id: ${deviceid}_power_led
pin:
number: 0
inverted: true
- platform: gpio
name: ${devicelabel} Plug
pin:
number: 15
id: relay
restore_mode: RESTORE_DEFAULT_OFF
on_turn_on:
- switch.turn_on: ${deviceid}_power_led
on_turn_off:
- switch.turn_off: ${deviceid}_power_led
sensor:
- platform: adc
pin: VCC
name: ${devicelabel} Voltage
If I comment (or leave out) the VCC adc sensor, the power LED turns on and off when it should. However, when the VCC adc sensor is enabled the plug still function (can turn on/off with the button), but the power LED never turns on when the plug is on.
Any idea what I may be doing wrong or how I can improve it to allow the VCC sensor and keep the power LED functioning at the same time? Right now, the VCC sensor certainly isn’t crucial, so I have that commented out, but it’d be nice to have them both working togther.