In my ManCave I use my own Android App (AndyMOTE) to control my media setup. Here I have a Raspberry Pi 4 running LibreElec. The idea is that I push a button on the AndyMOTE App and it automatically switches on the devices required; in this case “Watch Kodi” causes the Tv to be switched on with HDMI #1 selected, the AV amp switched on and the correct input selected and Raspberry Pi switched on.
The problem is, you cannot switch a Raspberry Pi on using, for example, Wake on LAN.
One solution is to just leave the Raspberry Pi running, however, as the Pi 4 runs quite hot, I really didn’t want to do this. Also I want to switch off a hard drive, connected to the RPi, when the Kodi system has been shut-down.
Shut down is no problem; I just use a simple Home-Assistant automation thus:
alias: Turn Kodi ManCave OFF
trigger:
platform: state
entity_id: sensor.mancave_kodi
to: "off"
action:
service: kodi.call_method
data:
entity_id: media_player.mancave_kodi
method: System.Shutdown
My solution: to connect a relay to Pins 5 & 6 on my Pi 4 and control this from another Raspberry Pi using MQTT to signal when to trigger the relay.
I interested, you can see a more detailed Application Note describing this setup here and view my HomeAssistant configuration here.