cgarwood / homeassistant-zwave_mqtt

Limited Pre-Release of the new OZW1.6 Z-Wave component. Currently has limited platform support. Check the README for more details.
72 stars 8 forks source link

Platform zwave_mqtt does not generate unique IDs #103

Closed Dinth closed 4 years ago

Dinth commented 4 years ago

Im getting a lot of these errors, it seems that zwave_mqtt is struggling with generating unique IDs if there's few devices of same make/model in the mesh.

Entity id already exists - ignoring: switch.fibaro_system_fgs213_switch_instance_2_switch_3. Platform zwave_mqtt does not generate unique IDs
Entity id already exists - ignoring: switch.tkb_home_tz68_on_off_switch_socket_switch. Platform zwave_mqtt does not generate unique IDs
Entity id already exists - ignoring: switch.tkb_home_tz69_smart_energy_plug_in_switch_switch. Platform zwave_mqtt does not generate unique IDs
Entity id already exists - ignoring: switch.fibaro_system_fgs223_double_relay_instance_1_switch. Platform zwave_mqtt does not generate unique IDs
Entity id already exists - ignoring: switch.fibaro_system_fgs223_double_relay_instance_2_switch. Platform zwave_mqtt does not generate unique IDs
marcelveldt commented 4 years ago

This is a known issue at the moment. See #99

Dinth commented 4 years ago

Sorry, havent seen an open issue about that. Also im getting a different errors, could you advise if youre aware of those before i open a new issue?

Log Details (ERROR)
Logger: homeassistant.util.logging
Source: util/logging.py:165
First occurred: 10:55:37 AM (142 occurrences)
Last logged: 10:56:07 AM

Exception in _delete_callback when dispatching 'zwave_mqtt_delete_entity': ('35-14636699381153810',)
Traceback (most recent call last):
  File "/config/custom_components/zwave_mqtt/entity.py", line 228, in _delete_callback
    await self.async_remove()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 505, in async_remove
    self._on_remove.pop()()
  File "/usr/src/homeassistant/homeassistant/core.py", line 625, in remove_listener
    self._async_remove_listener(event_type, listener)
  File "/usr/src/homeassistant/homeassistant/core.py", line 682, in _async_remove_listener
    self._listeners[event_type].remove(listener)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 576, in __eq__
    if self.unique_id is None or other.unique_id is None:
  File "/config/custom_components/zwave_mqtt/entity.py", line 210, in unique_id
    return self.values.unique_id
AttributeError: 'NoneType' object has no attribute 'unique_id'

Exception in _delete_callback when dispatching 'zwave_mqtt_delete_entity': ('35-14918174357864466',)
Traceback (most recent call last):
  File "/config/custom_components/zwave_mqtt/entity.py", line 228, in _delete_callback
    await self.async_remove()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 505, in async_remove
    self._on_remove.pop()()
  File "/usr/src/homeassistant/homeassistant/core.py", line 625, in remove_listener
    self._async_remove_listener(event_type, listener)
  File "/usr/src/homeassistant/homeassistant/core.py", line 682, in _async_remove_listener
    self._listeners[event_type].remove(listener)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 576, in __eq__
    if self.unique_id is None or other.unique_id is None:
  File "/config/custom_components/zwave_mqtt/entity.py", line 210, in unique_id
    return self.values.unique_id
AttributeError: 'NoneType' object has no attribute 'unique_id'

Exception in _delete_callback when dispatching 'zwave_mqtt_delete_entity': ('35-15199649334575122',)
Traceback (most recent call last):
  File "/config/custom_components/zwave_mqtt/entity.py", line 228, in _delete_callback
    await self.async_remove()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 505, in async_remove
    self._on_remove.pop()()
  File "/usr/src/homeassistant/homeassistant/core.py", line 625, in remove_listener
    self._async_remove_listener(event_type, listener)
  File "/usr/src/homeassistant/homeassistant/core.py", line 682, in _async_remove_listener
    self._listeners[event_type].remove(listener)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 576, in __eq__
    if self.unique_id is None or other.unique_id is None:
  File "/config/custom_components/zwave_mqtt/entity.py", line 210, in unique_id
    return self.values.unique_id
AttributeError: 'NoneType' object has no attribute 'unique_id'

Exception in _delete_callback when dispatching 'zwave_mqtt_delete_entity': ('35-72057594631176209',)
Traceback (most recent call last):
  File "/config/custom_components/zwave_mqtt/entity.py", line 228, in _delete_callback
    await self.async_remove()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 505, in async_remove
    self._on_remove.pop()()
  File "/usr/src/homeassistant/homeassistant/core.py", line 625, in remove_listener
    self._async_remove_listener(event_type, listener)
  File "/usr/src/homeassistant/homeassistant/core.py", line 682, in _async_remove_listener
    self._listeners[event_type].remove(listener)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 576, in __eq__
    if self.unique_id is None or other.unique_id is None:
  File "/config/custom_components/zwave_mqtt/entity.py", line 210, in unique_id
    return self.values.unique_id
AttributeError: 'NoneType' object has no attribute 'unique_id'

Exception in _delete_callback when dispatching 'zwave_mqtt_delete_entity': ('35-593952785',)
Traceback (most recent call last):
  File "/config/custom_components/zwave_mqtt/entity.py", line 228, in _delete_callback
    await self.async_remove()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 505, in async_remove
    self._on_remove.pop()()
  File "/usr/src/homeassistant/homeassistant/core.py", line 625, in remove_listener
    self._async_remove_listener(event_type, listener)
  File "/usr/src/homeassistant/homeassistant/core.py", line 682, in _async_remove_listener
    self._listeners[event_type].remove(listener)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 576, in __eq__
    if self.unique_id is None or other.unique_id is None:
  File "/config/custom_components/zwave_mqtt/entity.py", line 210, in unique_id
    return self.values.unique_id
AttributeError: 'NoneType' object has no attribute 'unique_id'
marcelveldt commented 4 years ago

Thanks! In fact this error was a missing piece in the puzzle, helping us to solve it ;-)

MartinHjelmare commented 4 years ago

https://github.com/cgarwood/homeassistant-zwave_mqtt/blob/e1dfbd8c78200df12da8343d4efbb088f5b12875/custom_components/zwave_mqtt/entity.py#L240

marcelveldt commented 4 years ago

https://github.com/cgarwood/homeassistant-zwave_mqtt/blob/e1dfbd8c78200df12da8343d4efbb088f5b12875/custom_components/zwave_mqtt/entity.py#L240

Yeah, working on it ;-)

Dinth commented 4 years ago

Glad i was able to help!