Setting up Unifi Controller via integrations

I’ve created a PR to not allow cloud key POE to be controlled from HASS.

Cool. Thanks a lot.

I believe it allows the POE ports on a Unifi switch to become a switch. The controller has the functionality to do this and the component is likey using the api for the controller, not a connection to the actual hardware.

@silvrr yes and I have two POE cameras connected to my unifi switch. Neither are appearing in the integrations screen nor have any new switches been set up in my frontend.

Is it a POE switch though. Is the switch providing the power or do you have another inline device providing the power like a POE adapter?

@silvrr I have an AP connected via POE 24V passive to my Switch8-150. Nothing is appearing in the integration nor frontend.

Access points and switches powered by POE are not supported by the component yet.

Only devices connected directly to a UniFi POE switch will show up as a Switch.

Same here… I’m running 0.82.0b2 and have the “user input malformed” error.
Adding the following to configuration.yaml and restarting fixed it for me.

logger:
  default: info
  logs:
    homeassistant.components.unifi: debug

I’ve created an issue with the frontend to fix the int becoming a string problem.

Hi Robban,

I’ve notice that, in case a device is switched off when restarting HASS, the switch is no longer available to be enabled anymore and I have to go to the Unifi UI to enable it again. I believe the component currently automatically detects what ports are in use and provides that list to HASS. Could you add a parameter to the setup where I can define that eg ‘port 8’ needs to be added as well, regardless of the status of the port?

Thanks again for this great addition to HASS, Johan

Hi @jongsma!

With the original PR I had this functionality included that state would be preserver between restarts. But I had to change implementation from my internal implementation to using what is available in the HASS backend. And that in turn needing a refactoring, we decided to remove support for it.

Current state is that I’m waiting for the refactoring to be done, it is actively ongoing. And then I will add support for saving states of identified POE devices between restarts. This will also help if using a different POE mode than the auto, e.g. 24v passive.

In the mean time Im working on two other PRs that I will finish before going back to add this functionality.

So I got it loaded but the controller wants to be updated… I downloaded a DEB file but have no idea what to do with it

So… I’m trying to set up Unifi integration.
I’ve set logger level to debug for homeassistant.setup and homeassistant.components.switch as well as for homeassistant.components.unifi and homeassistant.components.switch.unifi
When setting up integration I get a lot of info from the 24 port PoE switch I have, but after that, the only line I get is this:
2019-08-06 09:50:02 INFO (MainThread) [homeassistant.components.switch] Setting up switch.unifi
Nothing else happens. Like it’s stuck. I don’t see any info in regards to any Unifi component in dev.tools -> States or any other places.
Anything wrong?

What are you expecting to get? Do you have any POE clients connected to the switch?

I have two APs (Lite and Pro) + controller (Running on RPI 3B+ with PoE HAT).
I would have hoped to get some info about connected clients etc. I see nothing anywhere in regards to Unifi / Ubiquiti gear.

Right now POE only controls clients. I have it on my ToDo to add support for POE controlling network infrastructure as well. Maybe it will be ready for HASS 0.98. For 0.97 there will be a lot of new stuff coming with UniFi integration; client tracking, device tracking, block/unblock specific clients

Thanks for your reply.
OK, so what kind of entities am I supposed to be seing, if integration is set up properly, running 0.96.5?
Will I need BOTH the integration set up in Configuration -> Integrations and with the code in configuration.yaml? I got a bit unsure when seeing I would have to punch in hostname, username and password both places.

Prior to 0.97 the integration is only POE control of clients; a switch will appear per POE appliance (camera, RPI, etc.)

With 0.97 everything is merged together and no external configuration will be needed

Then I’ll wait for 0.97
Thanks.

You can try out the beta today :wink: