Relay script to turn on the amplifier

  • Hello,

    I am looking for the script to turn on and off the amplifier.

    The amplifier is an old logitech PC 5.1 system, which is connected to RPi3 through external usb 5.1 soundcard. But this sound system has only analog inputs and thus it cannot be driven through hdmi. The RPi works 24/7.

    I want to connect a relay through RPi GPIO, that would turn the logitech on when the hdmi output is active (tv shows kodi screens) and turn it off when the hdmi output is off (tv works with other inputs).

    Is there such possibility?

  • I think so. Write a Python script to check whether the screensaver is active. If yes, trigger the relay. Start the script from autostart.sh.