node-zwave-js: Missing device configuration: Building 36 Technologies ADC-SWM150 (ValueError)

Checklist

Which device is missing?

Building36 Smart Water Valve & Meter ADC-SWM150

Manufacturer ID

0x0190

Product Type

0x0007-0x0001

Product ID

0x0001

Firmware Version

1.30

Is the device listed on the Z-Wave Alliance website?

No response

Do you have a manual?

problem is when temperature of water goes below 5oC a temperature alarm is given but its not handled correctly in z-wave js

Logger: homeassistant
Source: components/sensor/__init__.py:623
First occurred: 12:16:58 PM (1 occurrences)
Last logged: 12:16:58 PM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 752, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1278, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 941, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1062, in _async_write_ha_state
    state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 999, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 947, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 623, in state
    raise ValueError(
ValueError: Sensor sensor.smart_water_valve_meter_water_temperature_alarm_status provides state value '8', which is not in the list of options provided
Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:507
Integration: Sensor (documentation, issues)
First occurred: 12:16:58 PM (1 occurrences)
Last logged: 12:16:58 PM

Error adding entities for domain sensor with platform zwave_js
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 752, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1278, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 941, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1062, in _async_write_ha_state
    state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 999, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 947, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 623, in state
    raise ValueError(
ValueError: Sensor sensor.smart_water_valve_meter_water_temperature_alarm_status provides state value '8', which is not in the list of options provided
Logger: homeassistant.components.zwave_js
Source: components/zwave_js/__init__.py:891
Integration: Z-Wave (documentation, issues)
First occurred: 12:16:50 PM (1 occurrences)
Last logged: 12:16:50 PM

Unexpected exception: Sensor sensor.smart_water_valve_meter_water_temperature_alarm_status provides state value '8', which is not in the list of options provided
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/zwave_js/__init__.py", line 891, in client_listen
    await client.listen(driver_ready)
  File "/usr/local/lib/python3.11/site-packages/zwave_js_server/client.py", line 284, in listen
    await self.receive_until_closed()
  File "/usr/local/lib/python3.11/site-packages/zwave_js_server/client.py", line 443, in receive_until_closed
    self._handle_incoming_message(data)
  File "/usr/local/lib/python3.11/site-packages/zwave_js_server/client.py", line 532, in _handle_incoming_message
    self.driver.receive_event(event)  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/zwave_js_server/model/driver.py", line 86, in receive_event
    self.controller.receive_event(event)
  File "/usr/local/lib/python3.11/site-packages/zwave_js_server/model/controller/__init__.py", line 854, in receive_event
    node.receive_event(event)
  File "/usr/local/lib/python3.11/site-packages/zwave_js_server/model/node/__init__.py", line 462, in receive_event
    self.emit(event.type, event.data)
  File "/usr/local/lib/python3.11/site-packages/zwave_js_server/event.py", line 65, in emit
    listener(data)
  File "/usr/src/homeassistant/homeassistant/components/zwave_js/entity.py", line 250, in _value_changed
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 941, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1062, in _async_write_ha_state
    state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 999, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 947, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 623, in state
    raise ValueError(
ValueError: Sensor sensor.smart_water_valve_meter_water_temperature_alarm_status provides state value '8', which is not in the list of options provided

About this issue

  • Original URL
  • State: closed
  • Created 6 months ago
  • Comments: 20 (15 by maintainers)

Commits related to this issue

Most upvoted comments

My perspective was just that the state parameter is optional by the ZW spec and deemed “invalid” (only?) by HA.

In the defense of HA, its code to use the value states was added before v12, where the states were in the “extended” form, and it was working fine then. It was only after the v12 release where the problem started, as the change referenced above is technically a breaking change to the public API.

The “replace” mode does cause some inconsistencies, as some Z-Wave JS notification values support the actual Z-Wave Notification value, while others will use the event values. That’s kind of the point of the metadata though, so you don’t need to be concerned with the raw values. However, a benefit is that it removes duplicate states. There’s no difference between “Water temperature alarm status” without event data, and “Water temperature alarm status” + event “No data”. For applications like HA, which auto-generate sensors based on the metadata, the replace mode removes a duplicate entity.

There are several notifications though that look as if they do require the event data to make any sense. Consider the Valve operation status notification, event 0 is off and event 1 is on. What does it mean if the notification is sent w/o any event data, is it on or off?

I think @kpine is on point. The door sensor is the only one where the list of states is extended by the event parameters. All others should operate in “replace” mode. So even without the event parameters in the received payload, Z-Wave JS should use one of the defined states (1,2,3) , not the original notification event (8).