-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Unifi Integration Unexpected error 502 Disconnects indefinetly #40145
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
Comments
Related problem since 0.114.4. Device keep going from home to unavailable. Error log: _Exception in async_update_callback when dispatching 'unifi-reachable-192.168.1.113-default': () Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/unifi/unifi_entity_base.py", line 52, in async_update_callback self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 296, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 320, in async_write_ha_state sstate = self.state File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 667, in state return STATE_ON if self.is_on else STATE_OFF File "/usr/src/homeassistant/homeassistant/components/unifi/switch.py", line 184, in is_on return self.port.poe_mode != "off" AttributeError: 'NoneType' object has no attribute 'poe_mode' |
I agree that it would be nice if the unifi integration would try to reconnect. I am running the unifi controller behind an reverse proxy. The reverse proxy returns an 502 if it can not reach its upstream server. This happens, for instance, if the unifi controller is upgraded and restarted. I use unifi for presence detection, so it is quite annoying that I have to restart hass once in a while due to lost connection to the unifi controller. So a +1 for a reconnect from me :-) |
@JonasPed Hey Jonas, you don't have to restart Home Assistant to get the integration back, a few releases ago you can reload individual integrations, just go to the integrations page click the 3 dots, and reload. |
PR merged |
The problem
The Unifi integration, disconnects after a day or so, and stays as so until Home Assistant is restarted.
Picture of many of my wifi devices, which are working perfectly, but Unifi reports them as Unavailable.

Environment
Problem-relevant
configuration.yaml
Is configured using the GUI, here's a picture.
Traceback/Error logs
Additional information
As can bee seen, It get's an unexpected error, and disconnects from the Unifi integration. Problem is, It never tries to reconnect again. I have to restart Home Assistant. This happens every 18 - 24 hours. Meaning every other day I have to restart Home Assistant just because of that.
I'm running the unifi controller localy, outside of homeassistant, in a docker container, with valid SSL certificates, behind an nginx reverse proxy, I test the controller when Home Assistant loses connection and everything is fine, I rarely restart the controller, only on updates. So doesn't seem like a controller issue.
I believe that the integration should try to connect again.
The text was updated successfully, but these errors were encountered: