I’m a home assistant noob, fumbling my way through things. So in case anyone else lands here from Google searching, I wanted to confirm it’s possible to use zwave_js.set_value to reset kWh reading on an Aeotec Smart Switch 7, model ZWA023-A or ZWA023, a Z-wave smart plug.
It was surprisingly difficult for me to find this stuff. Some of the terms I tried searching for:
- energy meter reset
- power consumption reset
- electric consumption reset
- energy consumption reset
- power meter reset
Anyway, this is the meat of the script that can be used to reset the power consumption.
script:
reset_aeotec_plug_1_kwh:
alias: "Reset the kWh consumption for Aeotec 1"
description: "This should work."
sequence:
- service: zwave_js.set_value
data:
command_class: '50'
property: reset
value: true
target:
#device_id: xxxx
entity_id: sensor.aeotec_plug_1_electric_consumption_kwh
Any Z-Wave device that supports METER Z-Wave command class (with kWh, Watt, Voltage, Current) also supports the same specific commands for Meter RESET.
The above script references the target by entity_id
. Alternatively, you could reference the target by device_id
. To get the device_id
of your zwave device, you can grab it from the zwave_js_dump.json
file (how-to).
Also, to save anyone else the time - my initial approach was to try zwave_js.set_config_parameter
. This approach won’t work for my specific Aeotec device because the parameter/property is read-only. No way to write/change it manually.
Creating the zwave_js dump file can shine some light on what command_class
, device_id
, endpoint
, node_id
, etc, to use if you need that information. The following excerpt shows what the zwave_js dump looks like for the specific power consumption property. If you go up 1 level above this in the dump, you’ll also get the node_id
and device_id
.
{
"endpoint": 0,
"commandClass": 50,
"commandClassName": "Meter",
"property": "value",
"propertyKey": 65537,
"propertyName": "value",
"propertyKeyName": "Electric_kWh_Consumed",
"ccVersion": 5,
"metadata": {
"type": "number",
"readable": true,
"writeable": false,
"label": "Electric Consumption [kWh]",
"ccSpecific": {
"meterType": 1,
"rateType": 1,
"scale": 0
},
"unit": "kWh"
},
"value": 0.039
},