paul- wrote: 
> You can use the scripting method in squeezelite to call a script when
> the LMS power is toggled.  Look at the -S option.
Thanks for the golden tip! Turning on/off the RPi HDMI output when
turning on/off the pCP squeezelite player with my Remote Control or
Android App is now working!

Based on your hint I created a script called "hdmi-power-on-off.sh" (I
derived it from /home/tc/powerscript.sh), placed it in folder /home/tc,
and entered the path to the script in the "Power On/Off script" field on
the pCP Squeezelite Settings page. After saving settings, the HDMI
output is now turned on/off when turning on/off the squeezelite player.
When I turn off the pCP squeezelite player with my Remote Control the
monitor that is connected to the HDMI output now goes in standby mode,
indicating that the HDMI output is indeed switched off. This is exactly
the behavior that I was looking for.

Content of script hdmi-power-on-off.sh, placed in folder /home/tc, is as
follows:

Code:
--------------------
    #!/bin/sh
  
#----------------------------------------------------------------------------------------
  # Script for turning RPi HDMI output on/off when Squeezelite player is turned 
on/off.
  # This script requires that extension rpi-vc.tcz is installed.
  # Extension rpi-vc.tcz is installed by selecting HDMI power off on the pCP 
Tweaks page.
  # Enter the path to this "Power On/Off Script" on the pCP Squeezelite 
Settings page.
  
#----------------------------------------------------------------------------------------
  # squeezelite -S /home/tc/hdmi-power-on-off.sh
  # 
  # squeezelite sets $1 to:
  #     0: off
  #     1: on
  #     2: initialising
  
#----------------------------------------------------------------------------------------
  # Version: 0.1 2020-08-14 CJS
  
  case $1 in
  0)
  sudo vcgencmd display_power 0
  ;;
  1)
  sudo vcgencmd display_power 1
  ;;
  2)
  sudo vcgencmd display_power 1
  ;;
  esac
  
--------------------

The picture below shows where the path to the script is entered on the
pCP Squeezelite Settings page:

31284

Kind regards,
CJS


+-------------------------------------------------------------------+
|Filename: hdmi-power-on-off_squeezelite.png                        |
|Download: http://forums.slimdevices.com/attachment.php?attachmentid=31284|
+-------------------------------------------------------------------+


| LMS 7.9.3 | Squeezebox Boom | RPi0W + pCP 6.1.0 + HiFiBerry DAC |
------------------------------------------------------------------------
CJS's Profile: http://forums.slimdevices.com/member.php?userid=68700
View this thread: http://forums.slimdevices.com/showthread.php?t=112748

_______________________________________________
unix mailing list
unix@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/unix

Reply via email to