Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frequent error in switch.py in homeassistant logs. #9

Closed
bdraco opened this issue Dec 9, 2019 · 8 comments
Closed

Frequent error in switch.py in homeassistant logs. #9

bdraco opened this issue Dec 9, 2019 · 8 comments

Comments

@bdraco
Copy link
Contributor

bdraco commented Dec 9, 2019

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 275, in async_update_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 309, in _async_write_ha_state
state = self.state
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 576, in state
return STATE_ON if self.is_on else STATE_OFF
File "/usr/src/homeassistant/homeassistant/components/unifi/switch.py", line 204, 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'
2019-12-09 04:29:24 ERROR (MainThread) [aiounifi.api] Couldn't find key: 'None'
2019-12-09 04:29:24 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved

@niemyjski
Copy link

I'm also seeing this.

@Kane610
Copy link
Owner

Kane610 commented Apr 6, 2020

This is an issue when for some reason a client gets wrongfully marked as being powered by poe. I haven't figured out what characteristics that makes this happen. It is also problematic to do since it doesn't happen too often and what is needed is the snapshot of the client and device at the time of creating the entity.

A poor work around is to disable and then enable POE control to get rid of the faulty entities. But I think it will not be a part of hass until next release 0.109

@Kane610
Copy link
Owner

Kane610 commented Jun 26, 2020

@bdraco would you mind investigating this yourself? There must be some data in the client that can be used to not create a poe switch

@bdraco
Copy link
Contributor Author

bdraco commented Jun 26, 2020

I forgot I even opened this. I haven't had a chance to get unifi re-enabled since the UDMP switch over. I'll take a look as soon as I can.

@Kane610
Copy link
Owner

Kane610 commented Jun 26, 2020

There is no rush. This issue has existed for a long time, it is hard to catch it in the act and I've prioritised improving other aspects of UniFi.

@bdraco
Copy link
Contributor Author

bdraco commented Jun 26, 2020

I just re-enabled and I haven't seen this pop up. It used to stream down the log. I'll report back in a few days to so if it happens over time.

@bdraco bdraco closed this as completed Jul 15, 2020
@bdraco
Copy link
Contributor Author

bdraco commented Jul 15, 2020

No longer happening

@Kane610
Copy link
Owner

Kane610 commented Jul 15, 2020

Not impossible that it will come back. I'd be surprised if I solved it earlier this year 🤪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants