I’ve a question about my Gosund SP111 flashed with ESPHome.
This is my current configuration:
substitutions:
plug_name: Waschmaschine
# Higher value gives lower watt readout
current_res: "0.00260"
# Lower value gives lower voltage readout
voltage_div: "940"
esphome:
name: waschmaschine
platform: ESP8266
board: esp8285
wifi:
ssid: "Le_SSID"
password: "Le_PW"
manual_ip:
# Set this to the IP of the ESP
static_ip: Le_IP
# Set this to the IP address of the router. Often ends with .1
gateway: Le_GW
# The subnet of the network. 255.255.255.0 works for most home networks.
subnet: 255.255.255.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "${plug_name} Hotspot"
password: "Le_PW"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
password: "Le_API"
ota:
password: "Le_OTA"
# Enable Web server
web_server:
port: 80
time:
- platform: homeassistant
id: homeassistant_time
sensor:
- platform: wifi_signal
name: "${plug_name} - WiFi Signal"
update_interval: 6s
- platform: uptime
name: "${plug_name} - Uptime"
icon: mdi:clock-outline
update_interval: 60s
- platform: hlw8012
sel_pin:
number: GPIO12
inverted: True
cf_pin: GPIO05
cf1_pin: GPIO14
current_resistor: ${current_res}
voltage_divider: ${voltage_div}
current:
name: "${plug_name} - Ampere"
unit_of_measurement: A
accuracy_decimals: 3
icon: mdi:flash-outline
voltage:
name: "${plug_name) - Volt"
unit_of_measurement: V
accuracy_decimals: 1
icon: mdi:flash-outline
power:
name: "${plug_name} - Watt"
unit_of_measurement: W
id: "${plug_name}_Wattage"
icon: mdi:flash-outline
change_mode_every: 4
update_interval: 3s
- platform: total_daily_energy
name: "${plug_name} - Tagesverbrauch"
power_id: "${plug_name}_Wattage"
filters:
# Multiplication factor from W to kW is 0.001
- multiply: 0.001
unit_of_measurement: kWh
icon: mdi:clock-alert
text_sensor:
- platform: version
name: "${plug_name} - ESPHome Version"
status_led:
pin:
number: GPIO02
inverted: True
binary_sensor:
- platform: gpio
id: button
internal: true
pin:
number: GPIO13
on_state:
- switch.toggle: relay
output:
- platform: gpio
pin: GPIO00
inverted: true
id: led
switch:
- platform: gpio
pin: GPIO15
id: relay
name: '${plug_name} - Schalter'
icon: mdi:power-socket-eu
on_turn_on:
- output.turn_on: led
on_turn_off:
- output.turn_off: led
In HA i can see the sensors for volt, ampere and watt, but only the watt one is working for now. (Volt and Ampere are both always zero)
First question: How am i able to get them working? I don’t really know what to change in my config.
Second one: Is there a way to check, if the sensor outputs are correct? I tested the watt sensor with a Hue White and Color E27 (Internet says it needs about 9.5-10W) and i got an output with my config about 9.5W (100% brightness, cold light (the concentration scene inside the Hue App, according to some posts this one need the most power)).
I don’t have a specific answer for you - in fact, I’m surprised that both voltage and ampere sensors show zero when the power sensor is accurate. I assume you are verifying the power by looking at the entities on your developer page?
I suppose you could leave the espHome console up to the device, where you should see it spitting out numbers.
There are power measurement devices that you can use to calibrate/verify… Kill-a-watt is one of them. I check it out from my local library.
Yeah both, volt and ampere, show zero and i don’t know why.
Yep i’m looking at the entities, but also in the ESPHome logs, volt and ampere are always zero, but at least the volt sensor should be around 230V, because the plug is on, so it’s consuming a little bit of electricity, i don’t get it why that’s not working.
Ok thanks for that tip, i’ll look for a power measurement device, just to check if it the numbers are correct.
As an experiment, you could try altering your current_res and voltage_div numbers, but again, it strikes me as strange that you are able to get correct power number while those are zero.