okay for anybody that is wanting to have a monitor directly on the raspberry pi that homeassistant resides on
this needs to be done
- SSH into your Home assistant computer as normal
- install this first
- Change user to whatever your home assistant user name is “default is homeassistant” if default copy and paste
sudo apt-get install sshpass
sudo -u homeassistant -H -s
ssh [email protected] ‘export DISPLAY=:0 && xset dpms force on’
-
Type yes.
-
below command lines should now work for you in Home Assistant Switch Template
- platform: command_line
switches:
touch_screen:
friendly_name: Touch Screen
command_on: sshpass -p YOUR_PASSWORD ssh [email protected] 'export DISPLAY=:0 && xset dpms force on'
command_off: sshpass -p YOUR_PASSWORD ssh [email protected] 'export DISPLAY=:0 && xset dpms force off'
command_state: sshpass -p YOUR_PASSWORD ssh [email protected] 'export DISPLAY=:0 && xset -q | grep "Monitor is" | cut -c14-17' | grep "On" > /dev/null