Control RPi HDMI touchscreen backlight - remotely..?

Hi All, I am thinking of getting a 7" LCD touchscreen and connecting it to a spare RPi as a wall mounted HA interface. I have seen some code online used for controlling the backlight via CLI commands…

To test this, you can simply try the following to turn the monitor off:

 $ vcgencmd display_power 0

You can then turn it back on again with:

 $ vcgencmd display_power 1

… but was wondering if anyone has managed to control the backlight remotely (ie: via a command sent from HA). My idea was to utilise existing motion sensors in my house to trigger the backlight to turn on and off. These motion sensors are already linked to HA so if I can get HA to send the command to the RPi, I’d be sorted…

Any ideas?

(or should I just buy an Android tablet… :thinking: ) (the bonus with using the RPi is that I could also use it for all my Tuya-Convert activities and a few other things)

Would it be possible to use the HA Command Line Switch?

Wondering how I can send the following to the RPi (linux is definitely not my strong point, hence…Google):

ssh [email protected] "$ vcgencmd display_power 1" 

and

ssh [email protected] "$ vcgencmd display_power 0"

Can that be done with the Command Line Switch?

Looks like I may have found a solution here

$ is not part of the command, it is the command line user prompt. You don’t sent that as part of the command.

1 Like

Ok cool, thanks for the heads up!

Hi there. I am trying to do exactly what you are doing, but when I follow the link to the solution you ended up using, I see that I have to generate a ssh private key. How du you generate that key?

Hi Jens,

Sorry for the late response. I didn’t end up buying the screen and setting up the RPi in the end, I just got an Android tablet. However to generate SSH key sets you can use PuttyGen