Skip to content

Instantly share code, notes, and snippets.

@amercier
Last active July 3, 2026 21:52
Show Gist options
  • Select an option

  • Save amercier/e64ee30eb3f96fcc42e3 to your computer and use it in GitHub Desktop.

Select an option

Save amercier/e64ee30eb3f96fcc42e3 to your computer and use it in GitHub Desktop.
Turn leds on/off on Synology DiskStation

Synology scheduled tasks

Usage

Go to Control Panel / Task Scheduler and add the content of these scripts as root scripts.

Leds

Codes have been taken from this article.

  • turn-leds-off.sh: turns leds off
  • turn-leds-on.sh: turn leds back on

Ex (this is how I use it): turn leds daily at 10PM, turn them back on at 6AM.

#!/bin/sh
printf \\x36 > /dev/ttyS1 # UART2_CMD_LED_POWER_OFF
printf \\x37 > /dev/ttyS1 # UART2_CMD_LED_HD_OFF
printf \\x42 > /dev/ttyS1 # UART2_CMD_LED_USB_OFF
printf \\x4B > /dev/ttyS1 # UART2_CMD_LED_10G_LAN_OFF
printf \\x50 > /dev/ttyS1 # UART2_CMD_LED_MIRROR_OFF
#!/bin/sh
printf \\x34 > /dev/ttyS1 # UART2_CMD_LED_POWER_ON
printf \\x38 > /dev/ttyS1 # UART2_CMD_LED_HD_GS
printf \\x40 > /dev/ttyS1 # UART2_CMD_LED_USB_ON
printf \\x4A > /dev/ttyS1 # UART2_CMD_LED_10G_LAN_ON
printf \\x51 > /dev/ttyS1 # UART2_CMD_LED_MIRROR_GS
@pquerner

pquerner commented Jan 1, 2016

Copy link
Copy Markdown

Nice. ;)

@mikkelnl

Copy link
Copy Markdown

Hi! This doesn't seem to work on DSM 6 because it changed the way root works, can you expand your script to work on DMS 6 maybe?

@kostasns

kostasns commented Aug 26, 2016

Copy link
Copy Markdown

Works fine for me on DSM 6. Just select user 'root' under General Settings.

@whispy

whispy commented Aug 31, 2016

Copy link
Copy Markdown

It doesn't work for me on DSM 6 with root selected.

@m11y

m11y commented Sep 25, 2016

Copy link
Copy Markdown

Doesn't work for on DSM 6.0, device model: DS212j.

ghost commented Oct 4, 2016

Copy link
Copy Markdown

Very cool, thank you

@dstancioff

Copy link
Copy Markdown

Turns off my Power and status light, but not LAN or USB. DSM 6.0, DS216j

@neddy

neddy commented Feb 15, 2017

Copy link
Copy Markdown

Hey Guys, thanks for the script, I really appreciate it... I've just found that in DSM there is actually a feature now to completely control the LEDs. It's under 'Control Panel>Hardware & Power>LED Brightness Control' it allows you to completely turn off the LEDs and to set a schedule too... Hopefully this helps someone. Cheers

@Kirdock

Kirdock commented Feb 19, 2017

Copy link
Copy Markdown

The setting "LED Brightness Control" does not exist on my NAS. (DS1515+; DSM 6.0.2-8451 Update 9).
Does nobody has a solution for LAN LED?

@mornology

Copy link
Copy Markdown

I have the RS3617xs with DSM 6.1.3-15152 Update 1 and the LED options within control panel do not exist. I used the script trick with the DS1515+ but once I updated that system to DSM 6.0 it no longer worked. I tried the script with my RS3617xs but only the power button goes out, not the insanely bright HDD lights.

@mosauter

Copy link
Copy Markdown

Has anybody tried that with a extension unit? In my case a DX513. Cause the main module has a led control via the website but I seem to be unable to find the settings for the extension...

@vistalba

Copy link
Copy Markdown

For me only Power, Status and USB works on DS211+ :(
The option to control the LED from Synology itself is only avaiable on newer devices. (DS916+ in my case).

Is there a way also to switch off LAN, DISC1 and DISC2? That would be great for me :)

@johnflan

Copy link
Copy Markdown

Thanks for this, like some of the people it works for power LEDs etc but not for disk activity LEDs.

@howdey57

howdey57 commented Jan 1, 2019

Copy link
Copy Markdown

Does anyone know the codes to turn off the LAN, DISC1 and DISC2 lights too?

Thanks

@sniarn

sniarn commented Feb 17, 2019

Copy link
Copy Markdown

Thanks for this. The blue power LED was driving me nuts (ds3617xs).

@neolith

neolith commented Aug 12, 2020

Copy link
Copy Markdown

Awesome! Thank you so much!

@stevenfoxhound

stevenfoxhound commented Feb 10, 2021

Copy link
Copy Markdown

Function code working from Task scheduler script on the DSM or from SSH:

echo 0 >/dev/ttyS1 Power on
echo 1 >/dev/ttyS1 Power off
echo 2 >/dev/ttyS1 Short beep
echo 3 >/dev/ttyS1 Long beep
echo 4 >/dev/ttyS1 Power LED on
echo 5 >/dev/ttyS1 Power LED flash
echo 6 >/dev/ttyS1 Power LED off
echo 7 >/dev/ttyS1 Status LED off
echo 8 >/dev/ttyS1 Status LED on green
echo 9 >/dev/ttyS1 Status LED flash green
echo A >/dev/ttyS1 USBCopy LED flash
echo B >/dev/ttyS1 USBCopy LED off
echo C >/dev/ttyS1 Reset
echo @ >/dev/ttyS1 USBCopy LED on
echo : >/dev/ttyS1 Status LED on orange
echo ; >/dev/ttyS1 Status LED flash orange

You can mix several code together.

echo 48 >/dev/ttyS1 Power LED on + Status LED on green

@1RandomDev

Copy link
Copy Markdown

Function code working from Task scheduler script on the DSM or from SSH:

echo 0 >/dev/ttyS1 Power on echo 1 >/dev/ttyS1 Power off echo 2 >/dev/ttyS1 Short beep echo 3 >/dev/ttyS1 Long beep echo 4 >/dev/ttyS1 Power LED on echo 5 >/dev/ttyS1 Power LED flash echo 6 >/dev/ttyS1 Power LED off echo 7 >/dev/ttyS1 Status LED off echo 8 >/dev/ttyS1 Status LED on green echo 9 >/dev/ttyS1 Status LED flash green echo A >/dev/ttyS1 USBCopy LED flash echo B >/dev/ttyS1 USBCopy LED off echo C >/dev/ttyS1 Reset echo @ >/dev/ttyS1 USBCopy LED on echo : >/dev/ttyS1 Status LED on orange echo ; >/dev/ttyS1 Status LED flash orange

You can mix several code together.

echo 48 >/dev/ttyS1 Power LED on + Status LED on green

Most of them are obvious, but what exactly do code 0 and 1 do? Apparently they are not used to turn the NAS on and off and they don't seem to have any effect at all. (Tested on DS220+)

@Dragodraki

Dragodraki commented Jul 3, 2026

Copy link
Copy Markdown

Does anyone know how to reset all LEDs (including the Power LED, Status LED and USBCopy LED)? I would have "Automatic" back so that my NAS colors them according the the disk state again (green blinking for okay, orange for failures etc.).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment