Closed GSzabados closed 6 months ago
I think started with this:
2024-05-07 19:07:55.798 ERROR (MainThread) [homeassistant.components.select] Error adding entity select.velop_mesh_devices for domain select with platform linksys_velop
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 580, in _async_add_entities
await coro
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 892, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1359, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1009, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1132, in _async_write_ha_state
state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1071, in __async_calculate_state
if extra_state_attributes := self.extra_state_attributes:
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/linksys_velop/select.py", line 182, in extra_state_attributes
return self._additional_description.extra_attributes(**ea_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/linksys_velop/select.py", line 50, in _get_device_details
if not device_name.startswith("Network Device (")
^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'startswith'
I can suppress this easily enough but it shouldn't ever really be an issue because there should always be a name for a device.
If you could send me the diagnostics from the integration that would help me track the root cause down.
I am quite sure it has to do something with the select.velop_mesh_devices
as it is currently unavailable.
I just don't know in which configuration setting should I have it filled. Under the UI devices or the Device trackers, as I have selected in both of them none.
I know exactly where the problem is, what I don't fully understand at the moment is why it is happening.
Essentially the library pulls the device name from the API. If there is no name, just like Linksys, the device will be labelled as 'Network Device'. This caused a problem in the select
entity if there were multiple devices labelled as 'Network Device'. I applied a fix to an earlier beta that appended either the IP address, or the unique id if the device was disconnected. This made the item unique in the select
and resolved the issue.
Now, this error implies that there is no name for the device, but that shouldn't be the case. So, your diagnostics will help me work out what was returned from the library and if I'm just missing a simple check somewhere or if there is something bigger at play.
The select
entity only affects retrieving details for a device for either populating the attributes into the select
or into the temporary UI device, depending on what your config is set to. Everything else in the integration should continue to work.
Do you have an email address where I can send you the diagnostics? Unfortunately it is far too big to send it through the Community Forum's messaging system. It is about 170000 character longer than the allowed maximum 32000. 😄
Can you just compress it and attach the file?
config_entry-linksys_velop.zip
Use 7Zip to decompress it, I will message you the password.
Any chance you have an idea how this could be resolved?
I haven't had time to have a look at it yet, I'm afraid.
OK. I've had a quick look and still can't see why it's happening. Could you disable the select
entity and see if the problem still happens?
Also, could you send me screenshots of the attributes for the Online Devices
and Offline Devices
attributes? It should detail the devices and their associated names which may shed some light for me.
I have disabled it and the error disappeared.
OK, that's fine if you don't use it for anything (I'll make sure it's disabled by default). However, if you could send the screenshots I might be able to find what is actually causing the problem.
Sent you as a PM.
Should be fixed by #470
I see the following error message after activating the Mesh restart button. Might be due to some misconfiguration.