I have successfully set up Balena-dash on my official Raspberry Pi 7" display and have been able to give it a custom URL pointing to my Home Assistant interface.
Is it possible to turn the display on and off via a command from my local network (via ssh) for a quick response please? I have a motion sensor linked into Home Assistant and would like to use this to send a command that turns the display on when I walk into the room, and then another off command when no motion is detected.
I currently do this using a HyperPixel 4.0 display which works really well, but I’d like to upgrade to the larger 7" display using Balena-dash instead. Being able to turn the display on and off is key for use with this project.
I have found the following commands that may work but I’m not sure how to check if this path exists within the custom build?
sudo sh -c 'echo "1" > /sys/class/backlight/rpi_backlight/bl_power'
sudo sh -c 'echo "0" > /sys/class/backlight/rpi_backlight/bl_power'
You can definitely do this, if you take a look at the scheduler part of balenaDash where we allow you to switch the backlight on and off via a timed schedule, you’ll see that the commands used are very similar:
Great to hear that we can use the same method to switch the backlight on/off.
In my case though I can’t use the scheduler though as it needs to be on-demand. Looking through the guides it looks like I need to set up a local ssh server on the docker client to receive commands? Would I still be able to issue those commands above from within the container - would it have access?
Yes, the scheduler runs the commands from within a container too, so there’s no reason why you wouldn’t be able to use the same technique. You could setup an SSH server within a container, yep, or you could create a basic web interface that runs the same commands triggered from an HTTP request.
i would like to switch the backlight via http command. Unfortunately i don’t how to setup a “basic webinterface” that can be triggered from an http get request.
i would appreciate some help.
Thomas