Have someone the same “issuse” ? Everytime i restart HA - i receive this error:
Hassio 0.99.2
i have two unifi AC and two switches (UniFi Switch 8 POE-60W)
the unifi Controller is a VM
Error in Log:
2019-09-21 13:41:47 ERROR (MainThread) [aiounifi.api] Couldn't find key: 'None'
2019-09-21 13:41:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 266, in async_update_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 300, in _async_write_ha_state
state = self.state
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 554, in state
return STATE_ON if self.is_on else STATE_OFF
File "/usr/src/homeassistant/homeassistant/components/unifi/switch.py", line 202, in is_on
return self.port.poe_mode != "off"
File "/usr/src/homeassistant/homeassistant/components/unifi/switch.py", line 249, in port
return self.device.ports[self.client.sw_port]
AttributeError: 'NoneType' object has no attribute 'ports'
Error doing job: Task exception was never retrieved
8:36 PM components/unifi/switch.py (ERROR) - message first occured at September 27, 2019, 1:26 AM and shows up 30290 times
Couldn’t find key: ‘None’
8:36 PM components/unifi/switch.py (ERROR) - message first occured at September 27, 2019, 1:26 AM and shows up 30290 times
Oct 1 00:09:27 hassbian hass[13305]: 2019-10-01 00:09:27 ERROR (MainThread) [aiounifi.api] Couldn't find key: 'None'
Oct 1 00:09:27 hassbian hass[13305]: 2019-10-01 00:09:27 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never ret
rieved
Oct 1 00:09:27 hassbian hass[13305]: Traceback (most recent call last):
Oct 1 00:09:27 hassbian hass[13305]: File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 266, in asy
nc_update_ha_state
Oct 1 00:09:27 hassbian hass[13305]: self._async_write_ha_state()
Oct 1 00:09:27 hassbian hass[13305]: File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 300, in _as
ync_write_ha_state
Oct 1 00:09:27 hassbian hass[13305]: state = self.state
Oct 1 00:09:27 hassbian hass[13305]: File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 554, in sta
te
Oct 1 00:09:27 hassbian hass[13305]: return STATE_ON if self.is_on else STATE_OFF
Oct 1 00:09:27 hassbian hass[13305]: File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/unifi/switch.py", line 20
2, in is_on
Oct 1 00:09:27 hassbian hass[13305]: return self.port.poe_mode != "off"
Oct 1 00:09:27 hassbian hass[13305]: File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/unifi/switch.py", line 24
9, in port
Oct 1 00:09:27 hassbian hass[13305]: return self.device.ports[self.client.sw_port]
Oct 1 00:09:27 hassbian hass[13305]: AttributeError: 'NoneType' object has no attribute 'ports'
I’m hunting down the reasons for this situation. Have done some improvements for hass 0.100. Probable cause is unifi bug marking wireless devices as wired
Not 100% that I follow. I have had a couple of devices(not sure what it is tbh) mapped as Switches in HA. I went into the Configuration->Entity Registry and deleted each of them. The other devices, mapped as sensors in HA, i left unchanged (currently marked as unknow as there is no contact with the unifyctrl). The I rebooted HA - was that what you ment me to do?
Hi,
I had the same error with a "device_tracker.", I removed that from .storage/core.entity_registry (couldn’t remove it from the UI) but still seem to have some troubles with my Unifi integration.
System Health
arch x86_64
dev false
docker true
hassio false
os_name Linux
python_version 3.7.4
timezone Europe/Helsinki
version 0.100.2
virtualenv false
Removed the integration then reimplemented and the integration and the problem seems to be gone.
Hooray! - I can use my logs for troubleshooting again!
Well… I haven’t gotten to the bottom of all possible issues, one situation I have improved is that there will be fewer wireless clients from UniFi marked as wired which could in some cases get created as POE control switches.