Someone wanted to turn off their TV each weekday automatically at a preset time.
Their TV set did not support CEC and they used a Rasberry Pi running Kodi (LibreElec)
The solution was to use some cron tasks.
15 8 * * 1-5 tvservice -o
17 8 * * 1-5 reboot
What this does is each day reboot the Rasberry Pi at 5am. This ensures that each morning the home screen is selected.
On weekdays (1-5) at 8:15am the HDMI output is stoppped. The TV no longer gets any signal via HDMI. After 2 minutes it powers off. The Pi will reboot and the HDMI signal is restored. The TV stays off as it does not have CEC.
Their TV set did not support CEC and they used a Rasberry Pi running Kodi (LibreElec)
The solution was to use some cron tasks.
- enable cron for Libreelec. Its under services
- type crontab -e
- In the editor add these lines, then save (control+X, Y, Return)
15 8 * * 1-5 tvservice -o
17 8 * * 1-5 reboot
What this does is each day reboot the Rasberry Pi at 5am. This ensures that each morning the home screen is selected.
On weekdays (1-5) at 8:15am the HDMI output is stoppped. The TV no longer gets any signal via HDMI. After 2 minutes it powers off. The Pi will reboot and the HDMI signal is restored. The TV stays off as it does not have CEC.