Overview
The Shelly Wave devices that have energy meters support setting the accumulated energy value to a specific number.
This can be useful after:
Replacing a device
Moving a device to another controller
Restoring a previous energy reading
Correcting an incorrect meter value
In Home Assistant, this can be done with the zwave_js.invoke_cc_api action. The action must target the energy entity of the required channel. This is especially important for multi-channel devices.
Requirements
Before using the action, confirm that:
The device supports Meter Command Class reset with a target value.
The device firmware is up to date.
The energy entity is available in Home Assistant.
The entity reports energy in
kWh.
Not all Z-Wave devices support setting the meter to a specific value. Some devices only support resetting the meter to zero.
Single-channel device
For a single-channel device, target its energy entity:
action: zwave_js.invoke_cc_api target: entity_id: sensor.your_device_energy data: command_class: 50 method_name: reset parameters: - type: 1 scale: 0 rateType: 1 targetValue: 150
Replace:
sensor.your_device_energy
with the actual energy entity ID from Home Assistant.
Multi-channel device
A multi-channel device normally has a separate energy entity for each output. Devices Shelly Wave 2PM, Shelly Wave Pro 2PM, Shelly Wave Pro 2PM Dimmer, Shelly Wave Shutter, Shelly Wave Pro Shutter
To change the energy value of channel 1, target the energy entity assigned to channel 1:
action: zwave_js.invoke_cc_api target: entity_id: sensor.your_device_channel_1_energy data: command_class: 50 method_name: reset parameters: - type: 1 scale: 0 rateType: 1 targetValue: 150
To change the energy value of channel 2, target the energy entity assigned to channel 2:
action: zwave_js.invoke_cc_api target: entity_id: sensor.your_device_channel_2_energy data: command_class: 50 method_name: reset parameters: - type: 1 scale: 0 rateType: 1 targetValue: 450
Using the endpoint-specific entity is recommended because Home Assistant automatically sends the command to the Z-Wave endpoint linked to that entity.
Parameter explanation
The action uses the following parameters:
| Parameter | Value | Description |
|---|---|---|
command_class | 50 | Z-Wave Meter Command Class |
method_name | reset | Runs the Meter Reset command |
type | 1 | Electric meter |
scale | 0 | Energy in kWh |
rateType | 1 | Consumed energy |
targetValue | Example: 150 | The value sent to the device |
In some cases, the following rate type may also work:
rateType: 0
This represents an unspecified rate type.
Use rateType: 1 first for consumed energy.
Changing both channels in one script
The two channels can be updated in the same Home Assistant script:
sequence: - action: zwave_js.invoke_cc_api target: entity_id: sensor.your_device_channel_1_energy data: command_class: 50 method_name: reset parameters: - type: 1 scale: 0 rateType: 1 targetValue: 150 - delay: seconds: 2 - action: zwave_js.invoke_cc_api target: entity_id: sensor.your_device_channel_2_energy data: command_class: 50 method_name: reset parameters: - type: 1 scale: 0 rateType: 1 targetValue: 450
The delay is optional, but it allows the first command to complete before the second command is sent.
How to find the correct entity
In Home Assistant:
Open Settings.
Select Devices & services.
Open the Z-Wave integration.
Select the required device.
Find the energy entity with the unit
kWh.For a multi-channel device, confirm which entity belongs to channel 1 and which belongs to channel 2.
The entity names may differ depending on the device and the names assigned in Home Assistant.
Troubleshooting
The action returns “Unknown error”
Confirm that the action targets an energy entity instead of the complete device.
Use:
target: entity_id: sensor.your_device_channel_1_energy
Do not use the device ID when trying to address a specific channel.
The meter resets to zero
Confirm that all parameters are included:
parameters: - type: 1 scale: 0 rateType: 1 targetValue: 150
If type, scale, or targetValue is missing, the device may receive a normal reset command instead of a reset with a specific value.
The device rejects the command
Update the device to the latest available firmware.
Older firmware versions may reject a valid Meter Reset command with a target value.
The wrong channel changes
Check that the selected entity belongs to the correct endpoint.
For example:
sensor.your_device_channel_1_energy
must be linked to endpoint 1, while:
sensor.your_device_channel_2_energy
must be linked to endpoint 2.
Important notes
Support depends on the device firmware.
Some devices only support resetting the meter to zero.
The command changes the meter value stored by the device.
Home Assistant statistics may take some time to reflect the new reading.
Existing long-term statistics are not automatically rewritten when the device meter value changes.