Today I upgraded to 0.104. This broke the Unifi integration for me. I dont see any breaking changes in the release notes but i’m getting this error since 0.104:
2020-01-16 15:16:36 ERROR (MainThread) [aiounifi.api] Couldn't find key: 'None'
2020-01-16 15:16:37 ERROR (MainThread) [aiounifi.api] Couldn't find key: 'None'
2020-01-16 15:16:37 ERROR (MainThread) [aiounifi.api] Couldn't find key: 'None'
2020-01-16 15:16:37 ERROR (MainThread) [aiounifi.api] Couldn't find key: 'None'
2020-01-16 15:16:37 ERROR (MainThread) [aiounifi.api] Couldn't find key: 'None'
2020-01-16 15:16:37 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 419, in _async_add_entity
await entity.async_update_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 284, in async_update_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 320, in _async_write_ha_state
state = self.state
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 588, in state
return STATE_ON if self.is_on else STATE_OFF
File "/usr/src/homeassistant/homeassistant/components/unifi/switch.py", line 219, in is_on
return self.port.poe_mode != "off"
File "/usr/src/homeassistant/homeassistant/components/unifi/switch.py", line 264, in port
return self.device.ports[self.client.sw_port]
AttributeError: 'NoneType' object has no attribute 'ports'
The error above is being spammed many times a minute.
This is my config:
configuration.yaml:
unifi: !include unifi.yaml
unifi.yaml
controllers:
- host: 192.168.7.xxx
site: My Site Name
ssid_filter:
- 'MySSID'
I hope someone can help me out.
Thanks in advance.
EDIT: Fix in the codeblock. It did not show the controllers property
I am running 0.104 and it is working as expected for me, my config is
#setting extra value in the unifi system to reduce tracking
unifi:
controllers:
- host: 192.168.0.7
site: Default
ssid_filter:
- '┓┏凵=╱⊿┌┬┐'
dont_track_clients: false
dont_track_devices: true
dont_track_wired_clients: true
detection_time: 30
Yes that is my SSID
I have this in my configuration.yaml
Well i just updated and i’m getting this error. I’ll see what fixes it
EDIT: looks like a bug. Has to do with the ‘switches’ for turning on and off ports on a unifi poe switch.
EDIT2: I just reinstalled the integration and the error went away.
EDIT3: I’m gonna write the issue up. Not sure what can be done seeing that the error goes away if you reinstall via ui. I’m guessing it loses track of the port number. Not sure.
I think it does. But not sure what you have to to do ‘reconfigure’ it. The whole situation is odd. It’s definitely a bug with stored data. I’m wondering if there’s information in .storage that is created and destroyed on configuring/unconfiguring.