Unifi Switches POE control

Can I turn on/off POE power of particular port on my Unifi switch with this component?

1 Like

No. It only exposes ports as devices. So you control the device “power”.

…by turning on or off the port PoE.

So yes.

Unless I am misunderstanding something.

Yes but you don’t address the port, you address the device, should the device change port you would control the new port instead.

Ah! I see. Thanks for explaining.

1 Like

I configured the unifi integration and a few devices are found automatically.

Not all of them, though. I fail to understand when/how these are detected and I can’t find how to add them manually.

Devices or clients? What are you expecting to see?

Right now it only supports clients, e.g. network devices not part of the infrastructure.

Ah, that’s a bummer.
Is that something that’s being worked on?

Other than that: it found all but one of my devices.
The one it did not find is a snom VoIP Phone, connected to a US-16-150.
There is a second phone daisychained to it, so 2 mac-addresses show up at the port. Is that the reason that it is not listed? How do I go about debugging that?

I have it on my to do list. Im doing some work on another component right now but will revisit UniFi, shortly.

Yes if there are multiple devices on one port those will be ignored. This usually represents some other switch or similar that is not possible to control by UniFi

Great.

I looked at the source and saw that both exceptions are exceptions that are built in to the code.
Presumably as a safe-guard, which does make sense as it prevents people from accidentally destroying their infrastructure.

Would it be an option to add a configuration item such as a boolean “allow_infrastructure”, which if set to true would override these 2 safe-guards?
It would be usefull to be able to turn off parts of the infrastructure (power off an AP or a switch)
It does add a risk, because one could accidentally turn off the switch upstream to the controller and prevent access to it.
If the configuration has a sane default (false) and the risk is well documented, it would however be very usefull

For ports containing multiple devices, this is a really special case I don’t know if it should be supported at all.

For turning off POE for infrastructure as in UniFi devices, I will add that in the future.

1 Like

Could you share a configuration example of a unifi poe switch (switch in home assistant)?

This is my config:

unifi:
  controllers:
    - host: localhost
      site: default
      dont_track_clients: true
      dont_track_devices: true
      dont_track_wired_clients: true

Also I’d like to track certain devices, but I don’t want to overload ha with all the clients to I set don’t_track to true.

There is no configuration to get poe switches. All you need is to have an admin account and a unifi poe switch

I have a poe switch and also use an admin account.

Do those entities get a certain name like:

switch.unifi_X

It gets a name based on what it has in UniFi

Does it get the name of the Port or the device that is connected to that port.

Does my configuration from above block the poe switches?

Name of the client

No new switch entity was added after I set up unifi.

I run my controller as a hassio addon. Could this be the issue?

Shouldn’t affect. Sounds to me like you don’t have any POE clients

Well I have two unifi access points connected to two poe ports. So those are not handled as clients right?

Would be awesome being able to restart them via home assistant (by turning off/on poe).