Enable/disable PoE on a UniFi switch port

Hi all!

I have a UniFi PoE switch with an outdoor wifi AP on it. Because it is getting colder outside, I want to turn of the outdoor wifi with a switch.
I found the REST calls for UniFi (authenticate, set portconfig to port…) and now I want ti implement a rule that turns the port on or off.

I’ve been searching the forum but no one seems to have done this before from the looks of it. But does anyone have an idea on how to proceed?

Regards,
Peter

What are the REST calls you could maybe do it through the HTTP binding.

Do you refer to this https://ubntwiki.com/products/software/unifi-controller/api ?
You could develop a script that works on the command line and then use the exec binding or executeCommandLine

.

@denominator & @Wolfgang_S: both thanks for replying.
I can’t use the HTTP binding because it only accepts text/plain for POST commands and I need multiple steps to achieve my goal.

Writing a script was 1 of my options but I wanted something more elegant :slight_smile: But for now a script it will be :slight_smile:
However, if anyone else has an idea…

Stay safe!
Peter

You may have a look at this example script . I am not sure if that is supported on your hardware.

1 Like

@Wolfgang_S thx! I found that script myself a while ago. But thanks for pointing it out!

I have managed to got it working by command line. Look in this topic for info.

1 Like

Thanks Olaf! I did find you post too. thx!

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.