Run shell command on Raspberry Pi

Tags: #<Tag:0x00007f326dd76b70>

I’m running HA (latest version) on a Raspberry Pi 4. I want to be able to turn off the red status light at night and have found the following shell command;

echo 0 | sudo tee /sys/class/leds/led1/brightness

This works fine for all of my other Pi’s, but I need to know how to issue that command from HA.

Thanks tom, should have searched the docs first!

Just an observation on the shell command though, I was initially getting a 127 return code but after removing the ‘sudo’ command it all worked fine.

1 Like