Create a file /storage/.config/system.d/led.service
containing
[Unit]
Description=LED control
[Service]
User=root
Type=forking
ExecStart=bash -c “echo sd > /sys/class/leds/blue\:heartbeat/trigger”
TimeoutSec=0
RemainAfterExit=yes
[Install]
WantedBy=kodi.target
To flash blue led only when sd accessed.
then
# systemctl daemon-reload
# systemctl enable led.service
# systemctl start led.service