Page 1 of 1

Shutdown a Raspberry Pi from dzVents

Posted: Thursday 29 December 2022 23:47
by peterbos
Hi,

I searched the internet but did not find a solution, not even a faint hint for my question. I want to shutdown a Raspberry Pi (not the one running Domoticz) from within dzVents. I found out that my Picoreplayer (running on a Pi 4), active loudspeakers, television and settopbox use about a kWh per day - just being idle for the most of the day. I want to switch them off with a smart plug when they are in idle state. That's no problem for the loudspeakers, the tv and the box, but the Pi must be shutdown of before switching the power off to avoid corruption of the SD card. My idea is to shutdown the Pi first and then after a minute or so (or when the Pi doesn't answer to a ping or something similar) switch off the power plug.
Switching the power plug is not my problem, I know how to do that. I'm looking specifically for a way to shutdown the Pi.

Peter

Re: Shutdown a Raspberry Pi from dzVents

Posted: Friday 30 December 2022 0:38
by waltervl
You can use executeShellCommand https://www.domoticz.com/wiki/DzVents:_ ... _execution to use ssh to your remote RPi
Eg
ssh [email protected] 'shutdown'
More info see https://www.shellhacks.com/ssh-execute- ... ipt-linux/