I bought some Gosund SP1 plugs and quite happy with how simple they are to get running with ESPHome. I followed Calibrating an ESPHome flashed power plug » Frenck.dev to get them calibrated. Also figured out that with the new Engergy Dashboard an additional energy
entry is needed for the sensor.
But what I am really struggling is the power
sensor. Frenck does calibrate them in addition to the current and voltage, but I do not understand why. The power is a simple calculation of current multiplied with the voltage. Now I have calibrated my current and voltage and the outcome is a power which is way off.
Why is this, does the sensor itself calculate the values and not ESPHome using the calibration I did?
If this is the case, I want to get rid of the power from the sensor and get the power calculated from current and voltage. Those are easy to calibrate and the rest is just math.
Can someone help me what in understanding this ?
First I want to understand what is calculating the values, the sensor itself or esphome, if the sensor delivers the values I would understand why they are off and need calibration
Can I create my own power by the calibrate current and voltage valures in esphome?
And how is the energy sensor being generated? Is this just the Watts per time? Because then it would be once again way off and I would like to let it calculate using the calibrated current and voltage.
This is my yaml
sensor:
# Power sensor
- platform: hlw8012
sel_pin:
number: GPIO12
inverted: true
cf_pin: GPIO04
cf1_pin: GPIO05
change_mode_every: 3
update_interval: 3s
# Current sensor
current:
name: "${upper_devicename} Current"
unit_of_measurement: A
accuracy_decimals: 2
filters:
# Map from sensor -> measured value
- calibrate_linear:
- 0.0 -> 0.0
# Heizkörper
- 0.21 -> 0.13
- 5.21 -> 4.10
- 10.05 -> 7.92
# Glühbirne 60W
- 0.33 -> 0.24
# Voltage sensor
voltage:
name: "${upper_devicename} Voltage"
unit_of_measurement: V
accuracy_decimals: 0
filters:
# Map from sensor -> measured value
- calibrate_linear:
- 0.0 -> 0.0
# Heikörper Vollast
- 586 -> 227
# Glühbirne 60W
- 597 -> 230
# Leerlauf
- 596 -> 231
# Power sensor
power:
id: power
name: "${upper_devicename} Power"
unit_of_measurement: W
accuracy_decimals: 0
energy:
id: energy
name: "${upper_devicename} Energy"
unit_of_measurement: Wh
accuracy_decimals: 0
Thanks for your help also if this was already asked and answered - I search but could not find what I was looking for.