It moves to 2kw when I put the kettle on 0.9kw when I put the 900w microwave on.
BUT anything less than these and it just reads 0.000
The ESP logs are showing this:
[17:14:49][D][sensor:124]: 'Measured Power': Sending state 0.00000 kW with 1 decimals of accuracy
[17:14:49][D][sensor:124]: 'Total Daily Power Usage': Sending state 1.32743 kWh with 3 decimals of accuracy
[17:14:50][D][ct_clamp:037]: 'Measured Current' - Raw AC Value: 0.000A after 1 different samples (5 SPS)
[17:14:50][D][sensor:124]: 'Measured Current': Sending state 0.00000 A with 2 decimals of accuracy
[17:14:54][D][sensor:124]: 'Measured Power': Sending state 0.00000 kW with 1 decimals of accuracy
[17:14:54][D][sensor:124]: 'Total Daily Power Usage': Sending state 1.32743 kWh with 3 decimals of accuracy
[17:14:55][D][ct_clamp:037]: 'Measured Current' - Raw AC Value: 0.000A after 1 different samples (5 SPS)
[17:14:55][D][sensor:124]: 'Measured Current': Sending state 0.00000 A with 2 decimals of accuracy
[17:14:59][D][sensor:124]: 'Measured Power': Sending state 0.00000 kW with 1 decimals of accuracy
[17:14:59][D][sensor:124]: 'Total Daily Power Usage': Sending state 1.32743 kWh with 3 decimals of accuracy
So I can see its totting up my high usage devices but when lights (and my PC) are on its not getting any readings. Not sure where to go with this.
I did remove the 0.00 - > 0 calibrate linear line.
My calibration filter looks like this:
sensor:
platform: ct_clamp
sensor: adc_sensor
name: “Measured Current”
update_interval: 5s #You may change this value (in seconds)
id: measured_current #Measured in ampere (I)
filters:
calibrate_linear:
0.00719 → 7.87
0.01438 → 15.74
0.02876 → 31.48
0.05752 → 62.96
Do I need to get it to pull more decimal places? if so how is that possible?
My yaml file is as follows
sensor:
- platform: ct_clamp
sensor: adc_sensor
name: "Measured Current"
update_interval: 5s #You may change this value (in seconds)
id: measured_current #Measured in ampere (I)
filters:
- calibrate_linear:
- 0.00719 -> 7.87
- 0.01438 -> 15.74
- 0.02876 -> 31.48
- 0.05752 -> 62.96
# Example source sensor
- platform: adc
pin: A0
id: adc_sensor
- platform: total_daily_energy
name: "Total Daily Power Usage"
power_id: my_power
- platform: template
id: my_power
name: "Measured Power"
lambda: return id(measured_current).state * 230 / 1000; #Power = V*I/1000. So change 230V to whatever your mains voltage is)
unit_of_measurement: 'kW'
update_interval: 5s #You may change this value (in seconds)
time:
- platform: sntp
id: my_time
What you actually building is a current meter and than make a (too) simple assumption to make a guess of your energy.
That could theoretically even work when you only have resistive loads (like the good old incandescent light bulbs ) but it will be close to impossible to get anything accurate calculated for a normal house hold use were lot’s of power supplies and various power factors come together
The problem is not only that it’s very unlikely that your voltage is always 230V (it could be for example also 220V or 240V at times) but your setup doesn’t take the power factor into account at all.
I’m anyways still baffled that people still “take time” tinkering with current clamps for AC when something like a pzem004t is available for just a couple of dollars more and that device actually is able to measure current, voltage, real power, real energy, power factor and even the frequency. Not only that but it is (for the price) very accurate and doesn’t need any calibration.
And about your problem - you might get some more (lower) outputs if you add 0.00 - > 0 again to your calibrate_linear list
Indeed this looks like a (very) sophisticated solution - but at the same time it looks very pricey
Just the board (no coils/clamps, no esp) for split phase (atm90e32) costs already $40. For that price you easily get two pzem004t’s+esp and probably still have money left. The difference is only that the latter is already a complete setup to monitor the whole hose hold consumption while the “CircuitSetup ATM90E32 Split Single Phase Energy Meter” still lacks the most essential parts (clamps/coils + esp) to work
From a esphome perspective both solutions a covered with first class support
There is one nice feature the pzem004t has (and by the looks of it the ATM90E32 doesn’t provide) which is a internal eeprom to autonomously save the (total) energy.
In addition, the board having the EEPROM from Atmel(now microchip) 24C02C which is a 2K bit Serial Electrically Erasable PROM with a voltage range of 4.5V to 5.5V. with More than 1 Million Erase/Write Cycles and 200+ Years Data Retention
That means in case ha is not available (restarting for a update maybe) or the wifi is (temporary) not available or the esp is fried the pzem004t will still keep track of the energy consumption. The moment things are back to “normal” again (even after a esp hardware change) the “correct”/real total energy consumption is reported back to ha.
I’m not aware of any other solution out there which provides such a “fail safe” feature. Normally if ha/wifi/esp is down one can never recover the “correct”/real total energy automagically again.
In the end it proved not to be very accurate, I signed up to Bright app and used the Hildebrand add in to get my actual 30 minute energy readings which has been usefl till e.on decided my gas meter was going to stop communicating LOL
Very true @orange-assistant however I have now decided to repurpose it. I have smart meters which link in with HA now so I’m going to use the current meter to monitor current from the solar energy to the house supply so I can set up an alert when I go **On Grid ** since current at that point will go to “0”