unifi-linux-utils icon indicating copy to clipboard operation
unifi-linux-utils copied to clipboard

Turn Off LED script

Open ricktendo opened this issue 7 years ago • 7 comments

Is there a way to use the API to turn off the LED on a UAP, if so could you create a script for this?

The UAP in my room is really bright at night and I would like a script that could disable this at nights.

ricktendo avatar Sep 11 '18 23:09 ricktendo

That's a great idea! Let me see what I can figure out...

stevejenkins avatar Nov 13 '18 04:11 stevejenkins

Thanks!

ricktendo avatar Nov 13 '18 04:11 ricktendo

Ooh.... I think I'm on to something. SSH into your AP and do this:

echo '0' >/proc/gpio/led_pattern

Does it turn your LED off?

If so, turn it on again with:

echo '1' >/proc/gpio/led_pattern

I think the best option will be two micro-scripts that can be run via cron which set the desired LED function at the desired times. You could schedule multiple on and off events that way.

stevejenkins avatar Nov 13 '18 04:11 stevejenkins

It worked perfect!

Any chance to make the controller aware of the change in setting of the LED?

ricktendo avatar Nov 13 '18 04:11 ricktendo

Yeah... that might be a bit trickier. But I'm doing some research and will post what I find.

There's a two year old feature requests in the UBNT forum for the ability to schedule the LED lights. Maybe I'll nudge some friends at UBNT to see if someone can cobble that together.

stevejenkins avatar Nov 13 '18 04:11 stevejenkins

LOL yea, I was probably the last to reply in that feature request. They have the new UniFi LED, these have a timer feature

https://unifi-led.ubnt.com/

Thanks for this!

ricktendo avatar Nov 13 '18 05:11 ricktendo

Seems like mother crontab on my APs get wiped out periodically. Is there a way to make them persistent?

mbierman avatar Mar 15 '21 04:03 mbierman