Raspberry Pi - Power On/Off TV with HDMI-CEC

If you are using OptiSigns pre-built Raspberry Pi image, you can follow this tutorial to set up the schedule to power on/off your TV at designated times and days.

Ensure that the TV in use is equipped with built-in HDMI-CEC features and that it is turned on.

By executing the three command lines provided below, the device can be configured to adhere to the desired schedule.

The characters highlighted in green signify what time you want the device to turn on.

The characters highlighted in red signify what time you want the device to turn off.

Each asterisk is identified as the following in this order:

<Minute> <Hour> <Day_of_the_Month> <Month_of_the_Year> <Day_of_the_Week>

By modifying the <minute> and <hour> values (the initial two asterisks), you can set the schedule for your device’s on/off times. If you intend to apply this schedule daily, there’s no need to adjust the remaining asterisks.


Example: As shown below the script will schedule your pi device to turn off at 15:40 (5:40 PM) and turn on at 7:45 AM every day. The other asterisks are left alone as they don't need to be identified unless you want to set a schedule for a specific date.

You can also use our Remote Command Execution feature to run this command remotely instead of manually being at the location.

Note: You can run the command to check the status of the TV screen.

echo "pow 0" | cec-client -s -d 1

Example of the result:

  • If the result shows "power status: on," it indicates the TV screen is on.
  • If the result shows "power status: standby," it indicates the TV screen is off.

If you have any additional questions, concerns, or any feedback about OptiSigns, feel free to reach out to our support team at support@optisigns.com