You can use these scripts to turn on/off monitor of raspberry pi
screen_off.sh:
#!/bin/sh
tvservice --off > /dev/null
screen_on.sh:
#!/bin/sh
export DISPLAY=:0
tvservice -p
fbset -depth 8; fbset -depth 16; xrefresh
Another option (this is failed when tested because apt-get doesnt found cec-util package):
apt-get install cec-util
# Screen on, change to the active input of the Pi
echo "on 0" | cec-client -s > /dev/null
sleep 5
echo "as" | cec-client -s > /dev/null
#Screen off
echo "standby 0" | cec-client -s
Source:
– https://www.danpurdy.co.uk/web-development/raspberry-pi-kiosk-screen-tutorial/