Unifi Switches POE control

Hi; is the user you’ve configured in Unifi for HA an admin? It needs sufficient permissions to control PoE rather than just see consumption

Have the Unifi integration lost its ability to control POE? I use it frequently when arming/disarming the alarm (POE-cameras), meaning at least twice a day. But it stopped working last month.

No. Do you see any errors in the log?

I have like 500 devices so theres useally an error pending constantly somewhere.

What log should I be looking at and for what?

Knowing “it should work” is actually helpful.
When looking into the logs I see that it is trying to access https using one local IP.
I run a reverse proxy just to get the past the annoying http-warning.

But for some reason the integration have started using https and the local IP, not http and local IP or https and local domain.
Because of the switch it has lost it’s credentials, or at least some. I still get update and power notifications. Seems it just applies to the POE-switches.
I’d suggest it is some breaking update some updates ago?

Anyways, question is if I can update credentials and access adress/protocol without removing/readding the integration? Got tons of costumization done to keep the naming consistent with all my other Home Assistant devices.

Logger: homeassistant
Källa: components/unifi/hub/entity_helper.py:152
Inträffade först: 21 juli 2024 kl. 15:23:33 (8 händelser)
Senast loggade: 22:38:21

Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/components/unifi/hub/entity_helper.py”, line 152, in _command
await self.api.request(
File “/usr/local/lib/python3.12/site-packages/aiounifi/controller.py”, line 65, in request
return await self.connectivity.request(api_request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.12/site-packages/aiounifi/interfaces/connectivity.py”, line 97, in request
response, bytes_data = await self._request(
^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.12/site-packages/aiounifi/interfaces/connectivity.py”, line 143, in _request
raise LoginRequired(f"Call {url} received 401 Unauthorized")
aiounifi.errors.LoginRequired: Call https://localip:443/proxy/network/api/s/default/rest/device/deviceID received 401 Unauthorized

Its an open issue that some users get 401 errors Authentication error 429/421 with controls but status sensors are working · Issue #122438 · home-assistant/core · GitHub

A workaround to it is to disable the integration restart the network app and then enable integration again.