Sonoff Pow - resetting the total energy reading?

7,100 views
Skip to first unread message

flyn...@gmail.com

unread,
Jun 15, 2018, 8:58:06 AM6/15/18
to SonoffUsers
Anybody had any success resetting the total energy reading back to zero?   I have tried many different permutations around EnergyReset in the console but the only reading I have been able to reset is the 'Today' value, that happens if there is no number after the t         and no... EnergyReset3 = 0  does not work for me.

Program Version5.12.0i
Build Date & Time2018-05-14T10:09:11
Core/SDK Version2_4_0/2.1.0(deb1901)

Philip Knowles

unread,
Jun 15, 2018, 3:15:22 PM6/15/18
to flyn...@gmail.com, SonoffUsers

No = needed

cmnd/sonoff/EnergyReset3 0

 

Regards

 

Phil

Sent from Mail for Windows 10

--
You received this message because you are subscribed to the Google Groups "SonoffUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.
Visit this group at https://groups.google.com/group/sonoffusers.
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/18108e96-3fb1-4442-b7d0-1d5e42900c97%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

Philip Knowles

unread,
Jun 15, 2018, 3:20:32 PM6/15/18
to flyn...@gmail.com, SonoffUsers

BTW you can set to any figure you like not just 0. It’s in Wh not kWh so 55.296kWh would be entered as cmnd/sonoff/EnergyReset3 55296

 

Regards

 

Phil

 

Sent from Mail for Windows 10

 

From: flyn...@gmail.com
Sent: 15 June 2018 13:58
To: SonoffUsers
Subject: Sonoff Pow - resetting the total energy reading?

 

Anybody had any success resetting the total energy reading back to zero?   I have tried many different permutations around EnergyReset in the console but the only reading I have been able to reset is the 'Today' value, that happens if there is no number after the t         and no... EnergyReset3 = 0  does not work for me.

--

flyn...@gmail.com

unread,
Jun 17, 2018, 6:05:27 AM6/17/18
to SonoffUsers


Thanks for the replies guys, having now managed to reset the totals I am trying to write a Node-Red flow to be able to do so from a web page but am beginning to wonder if it is possible to execute a Tasmota console command (cmnd/sonoff_pow/EnergyReset3 0) via MQTT which uses a topic/payload format. Everything I have tried so far results in an 'unknown command' response in the console window. Perhaps this would be better asked in the Node-Red forum but can anybody confirm if it is possible to do or not? 

Glenn Chapman

unread,
Jun 17, 2018, 6:33:47 AM6/17/18
to flyn...@gmail.com, SonoffUsers
Hi Flynn,

What is the trailing 0 in your command doing?

On Sun, 17 Jun 2018, 11:05 , <flyn...@gmail.com> wrote:


Thanks for the replies guys, having now managed to reset the totals I am trying to write a Node-Red flow to be able to do so from a web page but am beginning to wonder if it is possible to execute a Tasmota console command (cmnd/sonoff_pow/EnergyReset3 0) via MQTT which uses a topic/payload format. Everything I have tried so far results in an 'unknown command' response in the console window. Perhaps this would be better asked in the Node-Red forum but can anybody confirm if it is possible to do or not? 

--
You received this message because you are subscribed to the Google Groups "SonoffUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.
Visit this group at https://groups.google.com/group/sonoffusers.

Philip Knowles

unread,
Jun 17, 2018, 6:34:18 AM6/17/18
to flyn...@gmail.com, SonoffUsers

It’s possible in openHAB. I reset the total at the beginning of each month with an MQTT command.

publish(mosquitto,sonoff-POW/EnergyReset3,0)

 

Sent from Mail for Windows 10

 

--

Philip Knowles

unread,
Jun 17, 2018, 6:34:55 AM6/17/18
to Glenn Chapman, flyn...@gmail.com, SonoffUsers

The 0 is the number that the Total is to be reset to

 

Sent from Mail for Windows 10

 

From: Glenn Chapman
Sent: 17 June 2018 11:33
To: flyn...@gmail.com
Cc: SonoffUsers
Subject: Re: Sonoff Pow - resetting the total energy reading?

 

Hi Flynn,

Glenn Chapman

unread,
Jun 17, 2018, 6:40:36 AM6/17/18
to Philip Knowles, flyn...@gmail.com, SonoffUsers
Then put a change node in and set that to 0

Colin Law

unread,
Jun 17, 2018, 6:41:27 AM6/17/18
to SonoffUsers
In node-red you can use an MQTT out node and write the appropriate
value to the appropriate topic.

Colin

flyn...@gmail.com

unread,
Jun 17, 2018, 9:41:21 AM6/17/18
to SonoffUsers
The trailing 0 is setting the value to zero. It is possible to set the value to anything instead of zero

flyn...@gmail.com

unread,
Jun 17, 2018, 10:40:26 AM6/17/18
to SonoffUsers

OK... thanks guys for putting me on the path.. I now have a web page showing the solar panel output of today's, yesterday's and total power since reset, along with a historical graph and a reset button that resets the today's and total to almost zero...(it depends on when the button is pressed in relation to the sample timing)

Here is the flow for anybody that is interested.. 

Enter code here...[{"id":"92fc4fc9.6018a","type":"mqtt in","z":"80693d89.27e74","name":"Panel output","topic":"tele/sonoff_pow/SENSOR","qos":"1","broker":"3f39c374.25352c","x":90,"y":140,"wires":[["bb4bac48.53d15","fa6ce233.d90f2","60536735.cd4798","46a6e450.a146fc"]]},{"id":"bb4bac48.53d15","type":"function","z":"80693d89.27e74","name":"get the Analog value for watts output","func":"msg.payload=JSON.parse(msg.payload);\nmsg.payload=msg.payload.ENERGY.Power;\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":80,"wires":[["aff6c703.5002b8","fdefc95c.fbd958","61fc0163.9e9ee"]]},{"id":"aff6c703.5002b8","type":"ui_chart","z":"80693d89.27e74","name":"","group":"581e26ca.0007e8","order":0,"width":0,"height":0,"label":"Solar Panel Output ","chartType":"line","legend":"false","xformat":"HH:mm","interpolate":"linear","nodata":"","dot":false,"ymin":"0","ymax":"1500","removeOlder":"7","removeOlderPoints":"","removeOlderUnit":"86400","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":690,"y":40,"wires":[[],[]]},{"id":"12c0a2a9.0d455d","type":"ui_text","z":"80693d89.27e74","group":"581e26ca.0007e8","order":0,"width":0,"height":0,"name":"","label":"Todays KWh Output","format":"{{msg.payload}}","layout":"row-center","x":680,"y":220,"wires":[]},{"id":"fa6ce233.d90f2","type":"function","z":"80693d89.27e74","name":"todays output","func":"msg.payload=JSON.parse(msg.payload);\nmsg.payload=msg.payload.ENERGY.Today;\nreturn msg;","outputs":1,"noerr":0,"x":360,"y":200,"wires":[["12c0a2a9.0d455d"]]},{"id":"60536735.cd4798","type":"function","z":"80693d89.27e74","name":"Yesterdays KWh output","func":"msg.payload=JSON.parse(msg.payload);\nmsg.payload=msg.payload.ENERGY.Yesterday;\nreturn msg;","outputs":1,"noerr":0,"x":138,"y":419,"wires":[["ef762d6b.ad586","3452e998.574336"]]},{"id":"ef762d6b.ad586","type":"ui_text","z":"80693d89.27e74","group":"581e26ca.0007e8","order":0,"width":0,"height":0,"name":"","label":"Yesterdays KWh output","format":"{{msg.payload}}","layout":"row-center","x":391,"y":380,"wires":[]},{"id":"fdefc95c.fbd958","type":"ui_gauge","z":"80693d89.27e74","name":"","group":"581e26ca.0007e8","order":0,"width":0,"height":0,"gtype":"gage","title":"Free Energy!","label":"Watts","format":"{{value}}","min":0,"max":"1500","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":650,"y":160,"wires":[]},{"id":"61fc0163.9e9ee","type":"mqtt out","z":"80693d89.27e74","name":"","topic":"Solar_panel/Power","qos":"1","retain":"","broker":"3f39c374.25352c","x":690,"y":100,"wires":[]},{"id":"a0ba8b81.4e7ed8","type":"file","z":"80693d89.27e74","name":"","filename":"/home/dietpi/dailyKWh","appendNewline":true,"createDir":true,"overwriteFile":"false","x":726,"y":441,"wires":[]},{"id":"3452e998.574336","type":"trigger","z":"80693d89.27e74","op1":"","op2":"","op1type":"nul","op2type":"payl","duration":"24","extend":false,"units":"hr","reset":"","bytopic":"all","name":"","x":405,"y":421,"wires":[["a0ba8b81.4e7ed8"]]},{"id":"14401307.bfa0dd","type":"inject","z":"80693d89.27e74","name":"","topic":"","payload":"ON","payloadType":"str","repeat":"","crontab":"*/15 9-21 * * *","once":false,"onceDelay":0.1,"x":250,"y":520,"wires":[["58088576.44521c"]]},{"id":"58088576.44521c","type":"mqtt out","z":"80693d89.27e74","name":"sonoff_pow ON","topic":"cmnd/sonoff_pow/POWER","qos":"1","retain":"","broker":"3f39c374.25352c","x":510,"y":520,"wires":[]},{"id":"27354c35.b908c4","type":"comment","z":"80693d89.27e74","name":"Ensure the solar panels are on during the day","info":"","x":360,"y":480,"wires":[]},{"id":"cdcd9726.30f7a8","type":"comment","z":"80693d89.27e74","name":"file containing the daily KWh figure","info":"actually there will be 2 entries per day in case the message gets lost","x":854,"y":393,"wires":[]},{"id":"46a6e450.a146fc","type":"function","z":"80693d89.27e74","name":"Total Energy since reset","func":"msg.payload=JSON.parse(msg.payload);\nmsg.payload=msg.payload.ENERGY.Total;\nreturn msg;","outputs":1,"noerr":0,"x":378.5,"y":262,"wires":[["730c17be.cfa3b8"]]},{"id":"730c17be.cfa3b8","type":"ui_text","z":"80693d89.27e74","group":"581e26ca.0007e8","order":0,"width":0,"height":0,"name":"","label":"Total Energy since reset","format":"{{msg.payload}} KWh","layout":"row-center","x":685.5,"y":269,"wires":[]},{"id":"b2aa6b3c.00bad8","type":"mqtt out","z":"80693d89.27e74","name":"","topic":"cmnd/sonoff_pow/EnergyReset1","qos":"1","retain":"","broker":"aeff1528.b23c78","x":665.5,"y":316,"wires":[]},{"id":"3c1c09f8.f707c6","type":"ui_button","z":"80693d89.27e74","name":"","group":"581e26ca.0007e8","order":0,"width":0,"height":0,"passthru":false,"label":"Reset","color":"","bgcolor":"","icon":"","payload":"0","payloadType":"str","topic":"cmnd/sonoff_pow/EnergyReset1 ","x":357.5,"y":315,"wires":[["b2aa6b3c.00bad8"]]},{"id":"3f39c374.25352c","type":"mqtt-broker","z":"","name":"localhost","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""},{"id":"581e26ca.0007e8","type":"ui_group","z":"","name":"Solar Panel Output","tab":"80820d88.e708c","order":1,"disp":true,"width":"6","collapse":false},{"id":"aeff1528.b23c78","type":"mqtt-broker","z":"","name":"","broker":"192.168.1.30","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""},{"id":"80820d88.e708c","type":"ui_tab","z":"","name":"Solar Panels","icon":"dashboard","order":5}]



flyn...@gmail.com

unread,
Jun 17, 2018, 10:50:55 AM6/17/18
to SonoffUsers
It works with sending a payload of 0 from the switch node to the MQTT out node with a topic of cmnd/sonoff_pow/EnergyReset. (sonoff_pow is the friendly name) It didn't work specifying EnergyReset3 to just reset the total, nor did EnergyReset1 to just reset the today total. however, what I have now works well enough for my needs.

thanks again

Philip Knowles

unread,
Jun 17, 2018, 3:08:57 PM6/17/18
to flyn...@gmail.com, SonoffUsers

EnergyResetn just shows the total needs a 0 to actually reset. Not as clear as could be in the wiki

EnergyReset

Show Energy Total, Yesterday and Today

EnergyReset1

0..42500

((P)Re)Set Energy Today in Wh

EnergyReset2

0..42500

((P)Re)Set Energy Yesterday in Wh

EnergyReset3

0..42500000

((P)Re)Set Energy Total in Wh

 

 

Sent from Mail for Windows 10

 

From: flyn...@gmail.com
Sent: 17 June 2018 15:50
To: SonoffUsers
Subject: Re: Sonoff Pow - resetting the total energy reading?

 

It works with sending a payload of 0 from the switch node to the MQTT out node with a topic of cmnd/sonoff_pow/EnergyReset. (sonoff_pow is the friendly name) It didn't work specifying EnergyReset3 to just reset the total, nor did EnergyReset1 to just reset the today total. however, what I have now works well enough for my needs.

Reply all
Reply to author
Forward
0 new messages