Reply
Highlighted
New Member
Posts: 1
Registered: ‎03-14-2019

Using the CLI to turn off WLAN

TLDR;

I manually turn a controller-defined WLAN off, and I would like to schedule its enabling a specific time each day. How do I go about? 

 

Full(er) story

This is admittedly a noob questions (apologies in advance for that), but my googling has only partially solved my problem, and hopefully some expert user here may guide me where to look further.

 

My situation is this. I have a specific WLAN for my kids' devices, which I now manually disable and then enable via the Controller GUI, since the scheduled time function is too static for my use-case (the turn-off time varies too much). I would like to automate the enabling (but not the disabling) of this WLAN. But although I have seen reference to the “Controller API”, I have failed to find any guide or instructions for it. What I have found, however, is a set of command lines that seems very promising indeed:

 

unifi_api /upd/wlanconf/<Id> '{"enabled": false}'

unifi_api /upd/wlanconf/<Id> '{"enabled": true}'

 

So I want to check if I understand how to utilise this (and corrected if not). My best guess is that I:

  1. log into the controller using my admin account
  2. use the second command line above to turn the on WLAN.

 

If that is possible, I can then use a script to run this command at the right time each day, and problem solved. So far I have not been able to test this, since I have not yet been able to ssh into my controller, which is a docker container on my Synology NAS.

 

So: Is this the command to use (and the right circumstance to use it)? And in that case, how do I access the controller CLI when it is in a docker container (the 'web' port is obviously not an option, and using port 22 only get me to my NAS)?

Reply