Keep the following in mind:
- The Counter in the upper right corner displays in liters and is a daily counter (CounterToday) and will be reset to zero at midnight.
- The Counter in the middle of the widget displays in m3 (cubic_meter) and will not be reset.
- In order to reset that counter you have to send the negative counter value.
I do not know how you reset the counter, but I would implement a virtual switch and configure it as a "On" button. and send a status update by MQTT to Node RED.
In Node-RED, when I receive the reset command, I would request status information from the widget (node) and send that negative value to MQTT.
See an example below. Replace the IDX (rid) and the IP address:
[
{
"id": "6685db4105e29da0",
"type": "http request",
"z": "65711f41c50e0302",
"name": "",
"method": "GET",
"ret": "obj",
"paytoqs": "ignore",
"url": "http://192.168.10.50:8080/json.htm?type=command¶m=getdevices&rid=532",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "",
"senderr": false,
"headers": [],
"x": 410,
"y": 220,
"wires": [
[
"b3edbc0b5e951831",
"39c685e36ccae3c6"
]
]
},
{
"id": "4b08b480637677b1",
"type": "inject",
"z": "65711f41c50e0302",
"name": "Reset Counter",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 200,
"y": 220,
"wires": [
[
"6685db4105e29da0"
]
]
},
{
"id": "b3edbc0b5e951831",
"type": "debug",
"z": "65711f41c50e0302",
"name": "debug 231",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 610,
"y": 220,
"wires": []
},
{
"id": "39c685e36ccae3c6",
"type": "function",
"z": "65711f41c50e0302",
"name": "function 20",
"func": "msg.payload = { \"command\": \"udevice\", \"idx\": msg.payload.result[0].idx, \"nvalue\": 0, \"svalue\": (-(parseFloat(msg.payload.result[0].Counter))).toString() };\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 610,
"y": 280,
"wires": [
[
"8b5327b71eb073bb"
]
]
},
{
"id": "8b5327b71eb073bb",
"type": "debug",
"z": "65711f41c50e0302",
"name": "debug 232",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 810,
"y": 280,
"wires": []
}
]
Regards