Turning the backlight off on the Raspberry PI 7″ touch screen

When I first setup Home Assistant here, I did so on a Raspberry PI 4B with a Phoscon RaspBee II ZigBee interface attached. It also has the official Raspberry PI 7″ touch screen, so it’s mounted high up on my Kitchen wall as that’s in a central location in the House.

Recently, as Home Assistant was under-performing, I rebuilt Home Assistant as a virtual machine within my ProxMox cluster, but the PI still manages the ZigBee connection via Zigbee2MQTT and a touch screen interface for HA – I also have several tablets wall mounted around the house doing the same thing.

However, as the PI is wall mounted it’s also powered via PoE and recently the PI’s started to report under-volt warnings as the PoE has started to provide less power than the PI needed.

So, as a temporary solution to this, until I can replace the power supply with either better PoE or a direct supply, the solution was to turn off the most power hungry device attached to the PI, which is the touch screen’s backlight.

So to turn off the backlight, simply run the following on the PI:

sudo sh -c 'echo "1" > /sys/class/backlight/rpi_backlight/bl_power'

This instantly turns off the backlight and, since I did this several days ago there’s been no under-volt warnings reported by the PI.

Note: Confusingly the 1 here turns the backlight off. Using 0 would turn it back on, the opposite to what you might expect.