Hi @Roman, I recently updated firmware on my nanoHD AP that seems to have broken my ability to turn on/off the LED and keep the change persisting. Is your process still working?
Thanks. This happened on new 5.43.19.12493. Downgraded to 4.3.21.11325 and all is well again. Seems to be a lot of users with issues on the release thread on the Ubiquiti forum. Not necessarily regarding the LED though.
i have udm with version 1.8.5. apparently there is no /var/etc forlder, and no sed program. and first command is not persistent. do you know any solution yet?
@Roman - Nice! Works like charm. Any thoughts on how one could use this approach to enable/disable an access point via SSH? I.e. to turn off the radios.
Is there someone who was able to integrate the different colors/effects into a template light?
Currently I use an input select in combination with a template light (off → shell command with parameter 0, on → shell command with parameter input select state).
In template lights you can set effect lists and trigger effect changes but can’t get it to work. Any ideas?
works for me too, but only for the access points. i need it for the dreammachine too.
on the usg on/off works but not staying is there any different path?
My usage is that when nobody is home (based on device connection to AP) and motion is detected then it starts blinking to “emulate” warning light to possibly scare away possible intruder. Also to remind me my device didn’t connect to WiFi yet and thus other security measures are ON.
Not sure what I’ll do with these. Will probably just turn them off at night and leave them on during the day. But mostly just because I’m a completionist and want to automate as much as possible.
So coming in a bit later here in this thread and I know there have been quite a few updates since these posts. Is anyone able to confirm if this is still working? I’ve attempted as the first post says just the one liner, but the config gets reset pretty quickly (within about 5 secs max). I then tried adding the mgmt.led_patther_override=1 into the persistent config, and it had no affect on the reset. So it would seem there is some other mechanism resetting/altering this led config. Was hoping to use this as a subtle notifier in the house, but can’t seem to make the config stick at all.
I recently bought a U6+ and turning on/off LED with above shell command didn’t work properly (it reset after few seconds). Also Python script didn’t work for me. This might be due to latest firmware version.
I was able to make it work with the following commands (added as shell commands to configuration.yaml)
Replace USER_NAME with your actual ssh user name and AP_IP with the IP address of your access point. Create an ssh key in your config/.ssh/ directory and register the public key in your Unifi Console.
Once HA is restarted, you can use service shell_command.unifi_ap_led_on or *off.
Hopefully this helps somebody else. I recently wanted to make it so that our upstairs AP flashes when our security is armed for an easy visual cue. I followed the guide here:
for setting up the SSH keys but I didn’t see anywhere else that if you are running a Unifi controller you have to copy and paste your public key into the controller by logging in and going to Settings > System > Advanced tab > paste your pub key to the SSH keys section of device authentication.
I was able to get the device to flash by using the SSH commands given in this thread but I didn’t like the fact that in order for it to flash I was having to continuously send it commands and authenticating.
I didn’t see anybody else that did this so I made a few scripts, one that automatically checks and then creates the flashing script prior to running, the actual script itself, and then one that kills the script from running on the AP.
The reason for the first script is that even though the directory is called persistent, anything in it is wiped out after a reboot. Here are the scripts I used and if anybody found a better way of doing this feel free to let me know
Feel free to edit the config for whatever color / delay you need. I made it so that when the house is armed it runs the first command which creates the script and then runs the newly created script. When the house is disarmed it kills the script and returns the normal color back to blue. I attempted to do it with two commands using && or ; but the AP just refused to run multiple commands in sequence.
For anyone wandering in here, wondering why they can’t get the LED color to persist, here’s what I did wrong for many attempts.
The payload written down by @FPro seems to be up to date for me, on 6.6.65 on an AP AC Lite.
HOWEVER, go to your Unifi console and make sure that the AP LED you want to modify via SSH is actually turned on there:
I had that box unchecked. This led (haha) to the LED being deactivated after ten seconds.
Now I have that box checked, and the LED reacts exactly as I’d expect it to.