My supplier (ActewAGL in Aus) provides in the downloadable quarterly data that has ‘Usage in m³’, ‘Average Heating Value’ and ‘Pressure Factor’.
The value of the ‘Average Heating Value’ and ‘Pressure Factor’ are different for each billing period but are very close, for example for the last to bills I get this:
Average Heating Value: 38.06 and Pressure Factor: 0.9612
Average Heating Value: 37.63 and Pressure Factor: 0.9951
These items multiplied give a ‘Consumption’ in Mj and as I am charged per Mj I have no need to convert to kWh.
My meter has a rotating disk with a white line that I am detecting and that I assumed is the same as the least significant digit of the meter so I am dividing by 1000. I probably need to confirm that.
Yep that’s probably all you need to do. In the end you can set the sensor up to report in whatever units are most meaningful (would be kW for me as that’s how gas is billed in the UK, sounds like MJ might be best for you).
Hi, can someone share their wiring?I have this electricity meter which has built-in pulse counter terminal.
Previously I was using raspberry pi with custom made python script and 10k resistor, but that does not seem to work with esp32/esphome neither with pulse_counter nor with pulse_meter.
how do I tell? Tried swapping, did not seem to help. The problem that i managed to tear the wiring going to RPI, which was done 5 years ago so I cannot remember how it was connected to RPI - if it was between ground and pin or +5v and pin …
Try searching from the manual. The pins have + and - symbols so made me wondering.
If it is a relay, point is not to leave input pin floating. So use a resistor to tie it to ground. Then connect the voltage through the relay. Check also that the relay is potential free.
Alternatively you can use pull high resistor to 3.3v and switch ground through your meter to the esp input pin.
Here is some random article with the principal explained.
Most esp boards can tolerate 5v even the logic level is 3.3v. Not sure if raspberry does.
If someone comes across this thread, I thought I would put an update about what I came to realize regarding the false counts and random spikes - It’s your AC power lines - or at least it was for me.
The issue is that the counter is susceptible to false counts as an effect of other electrical devices kicking in, in your house, and causing some effect on the ESP power supply.
I’ve tested 4 different 5V power supplies, all connected to the same socket in my kitchen, then to another socket also in the kitchen. Checked 3 different ESP-WROOM-32 boards as well. The external reed switch was disconnected, but when my oven, dishwasher pump or kettle was switched on, the counter would increment a few times.
When I switched to a power bank for the 5V, the issue went away completely and after 48h my gas usage was exactly correct down to 0.001m3. Ergo, the power supply is to blame for all the issue I and probably at least some of you are having. This said, it can’t be just a faulty power supply I have since I tested this many, from different brands from 1$ adapters to 60$ 120W laptop grade chargers.
Not sure how it’s happening, how to fix it for AC powered setups, but since I am moving to a solar array for this one, I am not investing more time, which I already did an insane amount to get it resolved.
I would like to limit the amount of data that my 2 power meters write to the HA database (and as a result of that, to InfluxDB). This is what I use at the moment:
So I have started by adding the - delta: 0.1 filter to the total sensor (kWh), and this is a good start. But what about the W sensor, can I add a throttle or something similar without affecting the totals? I would like to limit to something like once every 5 seconds or so.
Is there something similar to pulse_meter in home-assistant? I have a HVAC that only reports 0.1kWh increments in energy consumption, and power must be derived. However all my attempts using filters, templates, and sensors fail to result in any useful information.
My ESP32 photoresistor pulse_counter / pulse_meter measurements are all over the place. Adjusting the resistor seems to only adjust the multitude of the error. I get anything between 50MW and 0kW, and I can’t find the accurate position to give correct measurements. What could be the cause? I’m using a wroom-32U board. I’ve tried with two different boards and photoresistor-boards.
thanks for the idea. Now, a few months later, you still feel/believe it’s the power supply causing the issue?
Just wondering, as I also see spikes on all my 3 pulse_meters (water, gas and electricity). I’ll attach it to a powerbank too, just to verify.
Anybody else tried the powerbank method in the meantime?
@stevebaxter great improvement on the pulse counter!
Quite a basic setup here: 1000 imp/kWh, comsumption around 6 kWh. This generates a lot of traffic, which is reduced by using the ‘throttle’ parameter. It is, however, quite addictive to see the actual whole house realtime power consumption.
So my question: can the ‘throttle’ parameter use a variable (e.g. a binary sensor value) from the HAOS in such a way that the realtime sending of data is used only whenever needed. Normally the values would be sent e.g. once a minute, in ‘realtime’ mode continuously.
Possibly, but that’s not really part of the sensor, it’s part of what ESPHome can do. One question though, why do you care? We use about 10kWh a day with a similar setup, been running for over a year and no problems with the amount of data.
I mean 6 kW in an hour, so much more per day (and more traffic). Might not be that critical, but noticed the CPU temp to rise around 10 %, and processor use roughly from 2 % → 5 %.
Anyway, using ‘pulse_meter’ is so much more accurate than pulse_counter, enjoying it a lot!
Hi,
i need a very accurate pulse_meter. What do i have to do to remove the conversion in ms in .cpp and just show the raw microseconds for the pulse ?
I would need it for measuring the tick of a mechanical clock. Therefor accuracy has to be in us-range.
I run ESPhome on a Raspi 4
regards, Peter
[11:42:58][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
[11:42:58][D][sensor:125]: 'Pulse Meter': Sending state 3000.00000 pulses/min with 2 decimals of accuracy
[11:42:58][D][sensor:125]: 'Pulse Meter': Sending state 8571.42871 pulses/min with 2 decimals of accuracy
[11:42:58][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
[11:42:58][D][sensor:125]: 'Pulse Meter': Sending state 3000.00000 pulses/min with 2 decimals of accuracy
[11:42:58][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
[11:42:58][D][sensor:125]: 'Pulse Meter': Sending state 0.00000 pulses/min with 2 decimals of accuracy
[11:42:58][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
[11:42:58][D][sensor:125]: 'Pulse Meter': Sending state 0.00000 pulses/min with 2 decimals of accuracy
[11:42:58][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
[11:42:58][D][sensor:125]: 'Pulse Meter': Sending state 0.00000 pulses/min with 2 decimals of accuracy
[11:42:58][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
[11:42:58][D][sensor:125]: 'Pulse Meter': Sending state 5000.00000 pulses/min with 2 decimals of accuracy
[11:42:58][D][sensor:125]: 'Pulse Meter': Sending state 0.00000 pulses/min with 2 decimals of accuracy
[11:42:58][D][sensor:125]: 'Pulse Meter': Sending state 3000.00000 pulses/min with 2 decimals of accuracy
[11:42:58][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
[11:42:58][D][sensor:125]: 'Pulse Meter': Sending state 3000.00000 pulses/min with 2 decimals of accuracy
[11:42:58][D][sensor:125]: 'Pulse Meter': Sending state 0.00000 pulses/min with 2 decimals of accuracy
[11:42:58][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
[11:42:58][D][sensor:125]: 'Pulse Meter': Sending state 3000.00000 pulses/min with 2 decimals of accuracy
[11:42:58][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
[11:42:58][D][sensor:125]: 'Pulse Meter': Sending state 8571.42871 pulses/min with 2 decimals of accuracy
[11:42:58][D][sensor:125]: 'Pulse Meter': Sending state 0.00000 pulses/min with 2 decimals of accuracy
[11:42:58][D][sensor:125]: 'Pulse Meter': Sending state 8571.42871 pulses/min with 2 decimals of accuracy
[11:42:58][D][sensor:125]: 'Pulse Meter': Sending state 3000.00000 pulses/min with 2 decimals of accuracy
[11:42:58][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
[11:42:58][D][sensor:125]: 'Pulse Meter': Sending state 3000.00000 pulses/min with 2 decimals of accuracy
[11:42:58][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
[11:42:58][D][sensor:125]: 'Pulse Meter': Sending state 3000.00000 pulses/min with 2 decimals of accuracy
[11:42:58][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 0.00000 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 0.00000 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 0.00000 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 8571.42871 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 3000.00000 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 3000.00000 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 0.00000 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 3000.00000 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 3000.00000 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 0.00000 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 8571.42871 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 0.00000 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 3000.00000 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 0.00000 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 8571.42871 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 8571.42871 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 8571.42871 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 0.00000 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 0.00000 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 5000.00000 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 8571.42871 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 0.00000 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 3000.00000 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 0.00000 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 3000.00000 pulses/min with 2 decimals of accuracy
[11:42:59][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
[11:43:00][D][sensor:125]: 'Pulse Meter': Sending state 3000.00000 pulses/min with 2 decimals of accuracy
[11:43:00][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
[11:43:00][D][sensor:125]: 'Pulse Meter': Sending state 3000.00000 pulses/min with 2 decimals of accuracy
[11:43:00][D][sensor:125]: 'Pulse Meter': Sending state 0.00000 pulses/min with 2 decimals of accuracy
[11:43:00][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
[11:43:00][D][sensor:125]: 'Pulse Meter': Sending state 3000.00000 pulses/min with 2 decimals of accuracy
[11:43:00][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
[11:43:00][D][sensor:125]: 'Pulse Meter': Sending state 0.00000 pulses/min with 2 decimals of accuracy
[11:43:00][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
[11:43:00][D][sensor:125]: 'Pulse Meter': Sending state 3000.00000 pulses/min with 2 decimals of accuracy
[11:43:00][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
[11:43:00][D][sensor:125]: 'Pulse Meter': Sending state 8571.42871 pulses/min with 2 decimals of accuracy
[11:43:00][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
[11:43:00][D][sensor:125]: 'Pulse Meter': Sending state 8571.42871 pulses/min with 2 decimals of accuracy
[11:43:00][D][sensor:125]: 'Pulse Meter': Sending state 3000.00000 pulses/min with 2 decimals of accuracy
[11:43:00][D][sensor:125]: 'Pulse Meter': Sending state 0.00000 pulses/min with 2 decimals of accuracy
[11:43:00][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
[11:43:00][D][sensor:125]: 'Pulse Meter': Sending state 0.00000 pulses/min with 2 decimals of accuracy
[11:43:00][D][sensor:125]: 'Pulse Meter': Sending state 8571.42871 pulses/min with 2 decimals of accuracy
[11:43:00][D][sensor:125]: 'Pulse Meter': Sending state 0.00000 pulses/min with 2 decimals of accuracy
[11:43:00][D][sensor:125]: 'Pulse Meter': Sending state 8571.42871 pulses/min with 2 decimals of accuracy
[11:43:00][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
[11:43:00][D][sensor:125]: 'Pulse Meter': Sending state 8571.42871 pulses/min with 2 decimals of accuracy
[11:43:00][D][sensor:125]: 'Pulse Meter': Sending state 0.00000 pulses/min with 2 decimals of accuracy
[11:43:00][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
[11:43:00][D][sensor:125]: 'Pulse Meter': Sending state 0.00000 pulses/min with 2 decimals of accuracy
[11:43:00][D][sensor:125]: 'Pulse Meter': Sending state 8571.42871 pulses/min with 2 decimals of accuracy
[11:43:00][D][sensor:125]: 'Pulse Meter': Sending state 3157.89478 pulses/min with 2 decimals of accuracy
I expected it to measure the time between each rising edge, but it seems (just a guess) to measure between each pulse - so depending on the pulse-width (the time the pin is HIGH) you have different results.
I using pulse meter for Anemometer and I am also picking up 0 values and variable results. I am switching to ESP32, better power supply, nothing else running and play around with pull up resistors. Lets see if I can get to the bottom of what is happening