I’ve had ESPHome setup for 2 years with success using them mainly for Kogan Power Plugs to track power usage and control the switches.
During that time I’ve had 2 plugs fail (on both occasions running my 1800W kettle after 6-9 months of use). I assumed it was a power draw issue but the plug is rated to 2400W.
When the plug fails, it won’t connect to wifi, won’t manually turn on/off with the button, makes a buzzing noise, and gets warm.
Now in the last 2 weeks, I’ve had 4 plugs fail from other electrical devices (fridge, dishwasher, UPS, desk lamp). These devices were typically always on, and used merely to measure power.
Do these ESP devices have such a short lifespan? Is my config causing premature death?
My sample code for reference. Your thoughts appreciated.
substitutions:
hostname: "esp_energy_02"
staticip: "192.168.20.92"
wifissid: !secret wifi_ssid_2
password: !secret wifi_password
location: "Kitchen"
devicename: "Fridge"
esphome:
name: "${hostname}"
platform: ESP8266
board: esp8285
wifi:
ssid: ${wifissid}
password: ${password}
fast_connect: True
manual_ip:
# Set this to the IP of the ESP
static_ip: "${staticip}"
# Set this to the IP address of the router.
gateway: 192.168.20.1
# The subnet of the network. 255.255.255.0 works for most home networks.
subnet: 255.255.255.0
# Enable logging
logger:
# Enable Web server
web_server:
port: 80
# Enable Home Assistant API
api:
password: ${password}
reboot_timeout: 0s
ota:
password: ${password}
time:
- platform: homeassistant
id: homeassistant_time
text_sensor:
- platform: template
name: "${location}"
id: location
icon: mdi:map-marker
- platform: template
name: "${devicename}"
id: device_name
icon: mdi:alphabetical
binary_sensor:
- platform: gpio
pin:
number: GPIO0
inverted: True
mode: INPUT_PULLUP
name: "${hostname}_button"
internal: true
on_press:
- switch.toggle: relay
switch:
- platform: gpio
name: "${hostname}_Relay"
pin: GPIO14
restore_mode: ALWAYS_ON
id: relay
on_turn_on:
then:
- switch.toggle: greenled
on_turn_off:
then:
- switch.toggle: greenled
- platform: gpio
name: "${hostname}_LED_Green"
pin: GPIO13
inverted: True
restore_mode: ALWAYS_OFF
id: greenled
sensor:
- platform: hlw8012
sel_pin:
number: GPIO12
inverted: True
cf_pin: GPIO04
cf1_pin: GPIO05
# Higher value gives lower watt readout
current_resistor: 0.00087
# Lower value gives lower voltage readout
voltage_divider: 2030
current:
name: "${hostname}_Amperage"
unit_of_measurement: A
# Calibration of 'filters' and 'lambda'
filters:
# Map from sensor -> measured value
- calibrate_linear:
- 0.0 -> 0.01
- 0.09 -> 0.1
# Make everything below 0.01A appear as just 0A.
# Furthermore it corrects 0.01A for the power usage of the plug.
- lambda: if (x < (0.01 - 0.01)) return 0; else return (x - 0.01);
voltage:
name: "${hostname}_Voltage"
unit_of_measurement: V
# Calibration of 'filters'
filters:
# Map from sensor -> measured value
- calibrate_linear:
- 0.0 -> 0.0
- 251.9 -> 240
- 252.7 -> 241
power:
name: "${hostname}_Wattage"
unit_of_measurement: W
id: "${hostname}_Wattage"
# Calibration of 'filters' and 'lambda'
filters:
# Map from sensor -> measured value
- calibrate_linear:
- 0.0 -> 1.14
- 11.3 -> 11.0
- 13.3 -> 15.0
# Make everything below 2W appear as just 0W.
# Furthermore it corrects 1.14W for the power usage of the plug.
- lambda: if (x < (2 + 1.14)) return 0; else return (x - 1.14);
change_mode_every: 8
update_interval: 10s
- platform: total_daily_energy
name: "${hostname}_Total Daily Energy"
power_id: "${hostname}_Wattage"
filters:
# Multiplication factor from W to kW is 0.001
- multiply: 0.001
unit_of_measurement: kWh
# Extra sensor to keep track of plug uptime
- platform: uptime
name: "${hostname}_Uptime Sensor"