How to configure electricity meter with ESP easy pulse counter?

Everything about esp8266 and more.

Moderator: leecollings

Post Reply
Nautilus
Posts: 722
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Finland
Contact:

How to configure electricity meter with ESP easy pulse counter?

Post by Nautilus »

I have setup a pulse counter with ESP easy to read the blinks from my electricity meter. After a week this seems to work realiably and I get the same total consumption as the electricity provider is reporting. However, I have a somes challenges.

There was a short blackout on Monday and I guess the pulse counter starts from zero at that point. So I got a huge negative reading to my device in Domoticz for this time. How should I set it up (a setting in Domoticz or device type, or a setting in ESP easy) so that it would only report the increment pulses to previous reading? I would like to use the device type in Domoticz that shows both current consumption and the used power. Must I use an incremental counter (which cannot show both values?) or is there a workaround
Capture.PNG
Capture.PNG (66.96 KiB) Viewed 3906 times
The other thing is that I have now set the reporting to every ten seconds. This seems to result in a situation that the reported power is quite often zero (although for sure the consumption is something, but the pulses come 1000/kWh so if it is low enough I get it there is no pulses). What I do not understand in why Domoticz shows it as zero even on the 5min graph:
Capture2.PNG
Capture2.PNG (99.07 KiB) Viewed 3906 times
Is there any other option than to increase the interval so that I would capture at least one pulse for every time ESP easy reports it forward?

And as a bonus, shift+click does not seem to work for energy usage in the short log to remove incorrect value. Domoticz will ask if I really want to remove it and I click "yes" but it stays there. Shift+click works fine on daily on monthly graphs for energy use.
User avatar
waltervl
Posts: 5371
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: How to configure electricity meter with ESP easy pulse counter?

Post by waltervl »

You could try to let the ESPEasy first read the total current value from domoticz, add the pulse and send the new total.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
marcojpolet
Posts: 63
Joined: Thursday 04 February 2016 20:18
Target OS: -
Domoticz version:
Contact:

Re: How to configure electricity meter with ESP easy pulse counter?

Post by marcojpolet »

Hi,

Not 100% sure, but if you edit the counter in Domoticz, you can change the way it calculates; you can choose From device, which I think you have now. But you can set it to 'Compute' that way, Domoticz will take care of the totals.

Regards
Marco
Nautilus
Posts: 722
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Finland
Contact:

Re: How to configure electricity meter with ESP easy pulse counter?

Post by Nautilus »

Thanks for the suggestions. I don't know any easy way to read the domoticz current value so I was thinking if I would just move to reporting the delta - should it then work (with delta instead of cumulative reporting) if I change the configuration on the device "from device" to "compute"?
User avatar
waltervl
Posts: 5371
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: How to configure electricity meter with ESP easy pulse counter?

Post by waltervl »

For delta you need another type of device, the counter increment.
With your current device you could send only the current power (in Watt), with compute option the device will calculate the total Wh values
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Nautilus
Posts: 722
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Finland
Contact:

Re: How to configure electricity meter with ESP easy pulse counter?

Post by Nautilus »

Ok, sounds good - will give that a try :)
dwmw2
Posts: 52
Joined: Thursday 03 December 2015 12:42
Target OS: Linux
Domoticz version:
Contact:

Re: How to configure electricity meter with ESP easy pulse counter?

Post by dwmw2 »

I had a similar problem a few years ago and solved it with a LUA script:
https://www.domoticz.com/wiki/Lua_-_Ele ... se_counter

More recently I'm using ESPHome, so I've just submitted a PR which fixes the handling of `total_increasing` devices with MQTT AutoDiscovery: https://github.com/domoticz/domoticz/pull/6163
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests