espurna icon indicating copy to clipboard operation
espurna copied to clipboard

Energy measurement reset on a schedule / from MQTT

Open hyteoo opened this issue 6 years ago • 10 comments

Coming from issue #671 I think in order to complete this functionality would be to implement an auto reset.

I'm thinking of a real world situation where the kWh would be recorded every month, so a reset at the 1st of any month would make sense.

An elegant way to do this would be to tie into the already existing scheduling engine, however I haven't gone into the code there so I'm not sure how hard that would be.

Another feature would be to reset via a MQTT command. I'm thinking of having the reset time/day coordinated from a central point for several devices.

hyteoo avatar Apr 08 '18 20:04 hyteoo

MQTT reset would be a Great PLUS. As i use ony mqtt in my home automation system.

Thank you !

bignooz avatar Jan 19 '19 07:01 bignooz

"@xoseperez xoseperez removed this from the 1.13.5 milestone 10 days ago"

Is this modification cancelled ?

bignooz avatar Mar 06 '19 18:03 bignooz

Hi! Has this enhancement been totally cancelled?

bignooz avatar Jun 08 '19 08:06 bignooz

Hi, what's the status of fhis feature request? That would be a cool additional function that I could use.

CoolID2 avatar Feb 11 '20 20:02 CoolID2

I'd like to vote for this feature as well. And to add that it should also be possible to do this via the RESTapi (PUT api/energy value=0.0)

Jessendelft avatar Dec 11 '20 20:12 Jessendelft

RE: above, both MQTT (through a .../set topic) and HTTP API should already work with dev builds Scheduling part is something to add though

mcspr avatar Dec 11 '20 21:12 mcspr

Can you elaborate on how to reset the energy counter through the HTTP API?

sjevtic avatar Feb 22 '21 01:02 sjevtic

See the /api/list output, if you are running latest versions from the dev branch for all available endpoints. There should be /api/energy returning current value on GET. Sending value=0 will reset the energy to 0 (but, only if the sensor supports it)

mcspr avatar Feb 24 '21 15:02 mcspr

Did this feature break in more recent versions? On version 2021-01-22 I can send an MQTT command as follow: ESPURNA/energy/0/set with a payload 0, and it resets the energy to 0. On more recent versions, including 2022-06-13 and 2022-05-24, sending this same MQTT command does absolutely nothing

Jessendelft avatar Aug 19 '22 15:08 Jessendelft

Did this feature break in more recent versions? On version 2021-01-22 I can send an MQTT command as follow: ESPURNA/energy/0/set with a payload 0, and it resets the energy to 0. On more recent versions, including 2022-06-13 and 2022-05-24, sending this same MQTT command does absolutely nothing

See #2530 and Releases page in this repo for .bin if you meant nightly release date, MQTT actually causes a crash edit: specific fix is https://github.com/xoseperez/espurna/commit/7f15da59ee6cae65664f6e5f9b7d6748fe09d91d

mcspr avatar Aug 19 '22 15:08 mcspr