Using the Unifi API it is possible to enable and disable switch ports, but this feature is not implemented in the HA integration. Would be a very useful addition.
I think that just turns the POE power on and off, not enabling/disabling the ports ? The non-POE ports don’t show there ?
Those buttons only toggle the PoE. I have a US-8 and a US-8-PoE-150W. The 150W has these buttons whereas the other doesnt.
(technically the US-8 has one of those PoE buttons, which aligns with the number of PoE switches available)
That could be the case, I use it to turn on/off POE cameras which effectively do what I’d expect.
Don’t they only turn off the POE power, not disable the port ? I think that is what is being requested here
I’m not arguing here
I’m simply stating that these switches work the way I expect them to work. I haven’t used them to turn off the actual network because I can’t check that. Once the POE is off, the camera is off. Therefore it’s doing what I’d expect the switches to do. My assumption is that it cuts everything, it may not. Hence why this FR is still open.
Hello, this is exactly the function I am looking for and would like from the integration of Unifi Network in Homeassistant.
I would like to completely deactivate the port when a specific device disconnects from it.
This is intended to increase security when the access point in the garden is disconnected from the LAN.
I just tested the assumption that everything is separated and not just POE. This is not the case and only the POE is switched off, but the port remains active.
correct - as I said before, the US-8 only has 1 PoE port, but 8 ports in total. There is only one PoE switch via the HA integration and nothing for the other 7 ports - which quite clearly points to it being only a PoE switch and not a complete port switch.
What you can do in home assistant is control firewall rules that are configured on your unifi dashboard, so you could set up a firewall rule to block a certain device or port and then have an automation set up in home assistant to activate or deactivate that firewall rule. Not quite as simple as direct controls of the physical ports but still doable.
you can use firewall rules, but generally that requires time for the blocked device to time out and take some sort of action - whereas the port getting switched off is instantly detected as “link down”. in my scenario I am trying to force a fail over so I don’t want to be waiting minutes for a time out… I just want the connection dead instantly.
Just want to upvote this as well. I’d love to have an automation trigger when the port goes down to disable it, so having both a sensor and a switch would be great.
That’d allow making outdoor cameras and access points much safer, if someone unplugs it the port goes dead. Wish that was available in Unifi itself, but having it in HA would be great