biker91620 / ha-cozytouch

Cozytouch support for Home Assistant
GNU General Public License v2.0
16 stars 22 forks source link

Error at startup: TypeError: unhashable type: 'set' #14

Closed browetd closed 4 years ago

browetd commented 4 years ago

I have the following error for each device in Cozytouch when I start Home Assistant (I have used Hacs to install Cozytouch... Not sure if the problem is coming for the code or the integration within Hacs). To set up the platform, I used the method via the integration menu... All entities seem to work correctly... I have uninstalled Cozytouch, restarted HA and reinstall it, restarted HA, same issue. Thanks !

2019-12-30 16:09:07 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 333, in _async_add_entity device = device_registry.async_get_or_create(**processed_dev_info) File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/device_registry.py", line 133, in async_get_or_create via = self.async_get_device({via_device}, set()) TypeError: unhashable type: 'set'

jugla commented 4 years ago

Hello, I have the same issue. Seems to work ... Same Error in 1.1 version or 1.2 version installed within HACS I'm running under raspbian (raspberry PI 4 , 4Go)

Here an extract of the log: 2020-01-16 00:13:21 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 333, in _async_a dd_entity device = device_registry.async_get_or_create(**processed_dev_info) File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/device_registry.py", line 133, in async_ge t_or_create via = self.async_get_device({via_device}, set()) TypeError: unhashable type: 'set'

bestlibre commented 4 years ago

I run into this as well and found that it caused the presence sensor to be ignored (HACS install). After the fix (in PR) they are discovered without problems.

browetd commented 4 years ago

Now instead of having this for each radiator I have, I only have once.

2020-04-21 11:16:31 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up cozytouch platform for binary_sensor Traceback (most recent call last): File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 186, in _async_setup_platform await asyncio.gather(pending) File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 295, in async_add_entities await asyncio.gather(tasks) File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 363, in _async_add_entity device = device_registry.async_get_or_create(**processed_dev_info) File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/device_registry.py", line 132, in async_get_or_create via = self.async_get_device({via_device}, set()) TypeError: unhashable type: 'set'

browetd commented 4 years ago

Still have it in 0.109.1 (one for binary_sensor and one for climate) see below. I do not have any binary _sensor nor climate entity... Just sensors (two per radiator...One for temperature and one for electricity) Any solution ? Thanks

2020-04-30 13:15:43 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up cozytouch platform for binary_sensor Traceback (most recent call last): File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 186, in _async_setup_platform await asyncio.gather(pending) File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 295, in async_add_entities await asyncio.gather(tasks) File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 361, in _async_add_entity device = device_registry.async_get_or_create(processed_dev_info) File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/device_registry.py", line 132, in async_get_or_create via = self.async_get_device({via_device}, set()) TypeError: unhashable type: 'set' 2020-04-30 13:15:44 ERROR (MainThread) [homeassistant.components.climate] Error while setting up cozytouch platform for climate Traceback (most recent call last): File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 186, in _async_setup_platform await asyncio.gather(pending) File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 295, in async_add_entities await asyncio.gather(tasks) File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 361, in _async_add_entity device = device_registry.async_get_or_create(processed_dev_info) File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/device_registry.py", line 132, in async_get_or_create via = self.async_get_device({via_device}, set()) TypeError: unhashable type: 'set'

jugla commented 4 years ago

Hello, It seems there arelot of activities on new development for the cozytouch integration https://github.com/Cyr-ius/hass-cozytouch. Idem --> the discovery of sensors seems to be more stable , but I've lost all the climate :-(

I've not seen how to post issues Philippe

bestlibre commented 4 years ago

Hi, I think it is not possible to post issue on https://github.com/Cyr-ius/hass-cozytouch. I have seen that one of the recent commit is similar to one of my pull requests (unique-id for climate). but the part fixing the unhashable type error is not present in master. @Cyr-ius : can you remove the {} arround the via-device definition to fix this issue ?

cyr-ius commented 4 years ago

Sorry, I had not seen your PR

browetd commented 4 years ago

Problem fixed for me with version 1.4.0b: the error message (unhashable) disappeared and the binary sensors + climates are back !!! Nice... Thank you ! But now I have other error messages that I have to investigate... but this one can be closed.