diff --git a/homeassistant/components/zwave_js/discovery.py b/homeassistant/components/zwave_js/discovery.py index 0dda3d639bc..39b97e5d3f4 100644 --- a/homeassistant/components/zwave_js/discovery.py +++ b/homeassistant/components/zwave_js/discovery.py @@ -27,7 +27,10 @@ from zwave_js_server.const.command_class.lock import ( DOOR_STATUS_PROPERTY, LOCKED_PROPERTY, ) -from zwave_js_server.const.command_class.meter import VALUE_PROPERTY +from zwave_js_server.const.command_class.meter import ( + RESET_PROPERTY as RESET_METER_PROPERTY, + VALUE_PROPERTY, +) from zwave_js_server.const.command_class.protection import LOCAL_PROPERTY, RF_PROPERTY from zwave_js_server.const.command_class.sound_switch import ( DEFAULT_TONE_ID_PROPERTY, @@ -1180,6 +1183,18 @@ DISCOVERY_SCHEMAS = [ stateful=False, ), ), + # button + # Meter CC idle + ZWaveDiscoverySchema( + platform=Platform.BUTTON, + hint="meter reset", + primary_value=ZWaveValueDiscoverySchema( + command_class={CommandClass.METER}, + property={RESET_METER_PROPERTY}, + type={ValueType.BOOLEAN}, + ), + entity_category=EntityCategory.DIAGNOSTIC, + ), ] diff --git a/tests/components/zwave_js/test_discovery.py b/tests/components/zwave_js/test_discovery.py index a177e01afad..1179d8e843c 100644 --- a/tests/components/zwave_js/test_discovery.py +++ b/tests/components/zwave_js/test_discovery.py @@ -29,6 +29,14 @@ from homeassistant.core import HomeAssistant from homeassistant.helpers import device_registry as dr, entity_registry as er +async def test_aeon_smart_switch_6_state( + hass: HomeAssistant, client, aeon_smart_switch_6, integration +) -> None: + """Test that Smart Switch 6 has a meter reset button.""" + state = hass.states.get("button.smart_switch_6_reset_accumulated_values") + assert state + + async def test_iblinds_v2(hass: HomeAssistant, client, iblinds_v2, integration) -> None: """Test that an iBlinds v2.0 multilevel switch value is discovered as a cover.""" node = iblinds_v2