Closed tbgoose closed 11 months ago
I have created the following esphome yaml, but it's not really correct. Can anyone help figure out what I am doing wrong?
You're going to have to be more specific. What isn't correct? Is it simply that your voltage and wattage readings are incorrect? You need to adjust the current resistor and voltage divider seen here in your code:
# Higher value gives lower watt readout
current_res: "0.0009 ohm"
# Lower value gives lower voltage readout
voltage_div: "769"
According to https://upk.libretiny.eu/
for the device you specified, the current resistor should be 0.001 ohm
and usually that doesn't change, in which case you need to change the voltage divider substantially until you get closer to real values. Again, the device example shows voltage divider should be closer to 1600
.
This isn't really a LibreTiny issue, but general ESPHome component configuration. See https://esphome.io/components/sensor/hlw8012.html?highlight=voltage_divider for notes about setting the voltage divider.
Thanks for the reply - yes my power metering is incorrect. Even when I change the voltage_div: 1600, I still get wildly inaccurate voltage. To get Voltage anywhere near
# Higher value gives lower watt readout
current_res: "0.001 ohm"
# Lower value gives lower voltage readout
voltage_div: "1600"
This is with a 9.9-10W constant draw on the circuit from a dc vornado fan
Voltage is so far from where it needs to be, I will work on current/power first
13:11:27 | [D] | [hlw8012:076] | Got power=2.9W, current=8.9A
13:11:27 | [D] | [sensor:093] | 'Current': Sending state 8.86578 A with 2 decimals of accuracy
13:11:27 | [D] | [sensor:093] | 'Power': Sending state 2.94147 W with 1 decimals of accuracy
13:11:40 | [D] | [sensor:093] | 'Uptime': Sending state 837.06000 s with 0 decimals of accuracy
13:11:42 | [D] | [sensor:093] | 'Power': Sending state 3.03339 W with 1 decimals of accuracy
13:11:57 | [D] | [hlw8012:082] | Got power=2.9W, voltage=1.5V
13:11:57 | [D] | [sensor:093] | 'Voltage': Sending state 1.51040 V with 1 decimals of accuracy
13:11:57 | [D] | [sensor:093] | 'Power': Sending state 2.94147 W with 1 decimals of accuracy
13:12:12 | [D] | [hlw8012:082] | Got power=2.9W, voltage=1.5V
13:12:12 | [D] | [sensor:093] | 'Voltage': Sending state 1.51884 V with 1 decimals of accuracy
13:12:12 | [D] | [sensor:093] | 'Power': Sending state 2.94147 W with 1 decimals of accuracy
So to get 2.94147W to be 10W I would need to multiple by 3.399661. I can't really see in the esp-home docs how to figure out what to do with the current res value to get to the value I want though...
Some of these chips are just really inaccurate and you can't correct them with voltage dividers or current resistors. The generally recommendation is to measure a known load and use a calibrate_linear filter on the fields that are off.
I have several plugs by the same brand and one of them is massively off from all the others, calibrate_linear is the only way I can get usable results with it.
Ok cool, calibrating these things is a job for another day then! I'll put a pin in this one for now and read up on that process when I have the time.
Thanks!
I'll close this since it's not an issue. If you need any more help with this, feel free to reopen it whenever you like.
Hey
I have a outdoor Arlec Grid Connect plug (pc44ha). I have successfully flashed the kickstart esp home on it (it was using 1.3.5 firmware as the arlec pc191ha). This is the plug - https://www.bunnings.com.au/arlec-grid-connect-smart-ip44-heavy-duty-timer_p0273373
Using the work from #84 and some other templates etc I have found around the place I have created the following esphome yaml, but it's not really correct. Can anyone help figure out what I am doing wrong?
There is talk of the device here including tear-down and pin-out info - https://www.elektroda.com/rtvforum/topic3980140.html. Based on the talk here I think the pin selection is correct, but obviously I am missing something RE power monitoring.
EDIT: I should mention that I am mainly using this plug to monitor power use of my pool pump + filter. I very rarely use the switch. It does turn the device on and off from the web-portal and the button on the device, but the power monitoring is completely wrong as logs here show. This was compared to a kilawatt type plug on the same load (~15-18 watts). I am in Aus so voltage is ~230-250V
esphome yaml