See attached for my diagram,
Trying to utilize CEC client to turn on and off my LEDs with Standby CEC command via bash script created by user RaPiiDe:
I think my biggest challenge will be finding a splitter that sends CEC commends out more than 1 port.
But does this make sense, or am over complicating things?
Bash
#!/bin/bash
# Script for hyperion which allows you to turn off your LEDs when your AVR is off and vice versa.
# Tested with Raspian on an RPi3
# 1 - Plug your RPi with an HDMI cable on your AVR
# 2 - Copy the script on your RPi
# 3 - Run sudo chmod +x on the script
# 4 - To make it run at startup, add @reboot /your/path/yourscriptname.sh to crontab -e
# 5 - Enjoy
# RaPiiDe
remotePath="hyperion-remote"
isOn=-1
while :
do
# We get the CEC status
status=$(echo pow 0 | timeout 5 cec-client -d 1 -s)
# If it's off and it wasn't already, let's turn off the LEDS
if [[ "$status" == *"power status: standby"* ]] && [[ "$isOn" != "0" ]]
then
eval "$remotePath --priority 0 --color black"
isOn=0
# If it's on and it wasn't already, let's turn on the LEDS
elif [[ "$status" == *"power status: on"* ]] && [[ "$isOn" != "1" ]]
then
eval "$remotePath --clearall"
isOn=1
fi
sleep 2
done
Alles anzeigen