Read the statement by Michael Teeuw here.
Turning system on and off
-
Please give me ideas on how I can turn my system on and off without doing too much do you use motion sensing or what are simpler ways that I can make sure that the system is not continuously running and am able to turn it off each night. Thank you!
-
@Michelle-H2020
RPI has no rtc so it cannot be turned on alone.
The easiest solution I think is a smart outlet(socket) with timer. Set the timer to switch on/off the RPI. Before turning off every night, you can shutdown RPI with CRON setup. -
@MMRIZE oh that’s smart we have some of those ! Also what is CRON setup can you explain that?
-
@Michelle-H2020 just a warning. the SD cards don’t do well with power off, so YOU NEED to do a proper shutdown before you power off
cron is the name of a Linux task, whose job it is to run tasks on a time cycle.
goigle
help Linux cronall commands on Linux have a manual page (man page)
see man cron
or help
cron --help -
@Michelle-H2020
If you are not familiar with CRON or Linux things, I think you can use this module instead. It implements CRON features as MagicMirror module.
https://github.com/ralberth/MMM-ScriptScheduler
I didn’t test personally. -
Ok so it’s better to install the scheduler and then just do a complete shut down after with scheduled outlet timer ? Or do I just do the scheduler module and have only the monitor shut down with smart outlet . Thanks for clarifying
-
@Michelle-H2020
You should shutdown RPI before power off of outlet. I think 5 minutes would be enough before cut the power off.
For example, you can set 00:00 to turn off for outlet, and you have to shutdown on RPI by cron(or that module) at 23:55. -
@Michelle-H2020 The pi itself don’t take that much power, I’d just leave it running - and instead, control the monitor. simple commands - if you’re using a TV for a monitor like I do for one screen, look into CEC tools.
vcgencmd display_power
Show current display power state, or set the display power state.vcgencmd display_power 0
will turn off power to the current display.vcgencmd display_power 1
will turn on power to the display. If no parameter is set, this will display the current power state. The final parameter is an optional display ID, as returned bytvservice -l
, which allows a specific display to be turned on or off.vcgencmd display_power 0 7
will turn off power to display ID 7, which is HDMI 1 on a Raspberry Pi 4.
-
My solution. Cronjob to shut down the raspi and a Shelly Relay to switch the power on and off. As already mentioned here, I only switch the power off 5 minutes later. The Shelly works like a timer and you can switch on and off several times a day. It switches off the power to both the Raspi and the display. With the Shelly app or an additional switch, you can also switch on the MM outside the programmed times. If you are not familiar with 230V wiring, use a Shelly plug.
Übersetzt mit DeepL
-
I never could get the motion sensing to work as well as I’d like. My solution at night is as others mentioned: a cron job to shut down and then a smart outlet to cut power 5 min later. The smart outlet turns on at 5:45AM so my MM is up and running when I wake up.
I also implemented a screensaver to run after a period of inactivity to prevent screen burn-in.