Home of the Squeezebox™ & Transporter® network music players.
Page 5 of 5 FirstFirst ... 345
Results 41 to 49 of 49
  1. #41
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    4,947
    Quote Originally Posted by Jeff07971 View Post
    Hi Greg,

    As in "Player off" IE Pcp active and powered with SL running just not active (as if you hit "power" on the remote or in SL-X or the Web GUI)

    Having an "off" returned by pcp mode you could then turn of the "Stop" LED

    Hope this expains !

    Jeff
    For the record, that is how the GPIO control works within squeezelite. If you want to script things a bit more, then you can use the script option from within squeezelite.

    If you would still rather run a poll script, then why not just use the combination of mode and power commands? That is about the only way to do what you want, sure I could build it into pCP, but its just going to use the same combination of commands. AFAK, there is no way to get this out of LMS in a single command.

    If mode = Play do something
    If mode = Stop and Power = On do somehting
    If mode = Stop and Power = off do something different.
    Last edited by paul-; 2022-09-11 at 08:20.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  2. #42
    Senior Member Jeff07971's Avatar
    Join Date
    Aug 2011
    Location
    London, England
    Posts
    1,810
    Quote Originally Posted by Greg Erskine View Post
    My understanding is these soft "power off" buttons are doing the equivalent of a "stop".

    The "power on" will restore squeezelite to its previous mode either "play" or "stop" (or "pause"?).

    These power on/off commands probably do more on actual Logitech SB hardware, like turn on/off the screen.

    What happens on a jivelite screen with pCP?
    Hi Greg

    With Jivelite the screen does whatever you want it to do selected by the "When Off" screensaver it could be display the time or turn the screen off completely.

    So Jivelite can discern "Off" from "Stop" I am assuming not with the "pcp mode" command but by some other query to the server

    Jeff

    Want a webapp ? Get SqueezeLite-X ! https://forums.slimdevices.com/showt...l=1#post903953

  3. #43
    Senior Member Jeff07971's Avatar
    Join Date
    Aug 2011
    Location
    London, England
    Posts
    1,810
    Hi Paul-

    Quote Originally Posted by paul- View Post
    For the record, that is how the GPIO control works within squeezelite. If you want to script things a bit more, then you can use the script option from within squeezelite.
    Can you elaborate a little on this please ?

    If you would still rather run a poll script, then why not just use the combination of mode and power commands?
    This is possibly the simplest way to do it but how do I query "Power" ?

    I tried "pcp power ?" but soon realised what that does !

    Is there a command that give the power status simply or do I have to query the server ?

    Jeff

    Want a webapp ? Get SqueezeLite-X ! https://forums.slimdevices.com/showt...l=1#post903953

  4. #44
    Senior Member Greg Erskine's Avatar
    Join Date
    Sep 2006
    Location
    Sydney, Australia
    Posts
    2,622
    Quote Originally Posted by Jeff07971 View Post
    Hi Greg

    With Jivelite the screen does whatever you want it to do selected by the "When Off" screensaver it could be display the time or turn the screen off completely.

    So Jivelite can discern "Off" from "Stop" I am assuming not with the "pcp mode" command but by some other query to the server

    Jeff
    I mean when you press "power off", say in "material GUI", does the jivelite screen turn off?

    BTW: "pcp mode" is LMS "mode ?"

  5. #45
    Senior Member Greg Erskine's Avatar
    Join Date
    Sep 2006
    Location
    Sydney, Australia
    Posts
    2,622
    Quote Originally Posted by Jeff07971 View Post

    I tried "pcp power ?" but soon realised what that does !

    Is there a command that give the power status simply or do I have to query the server ?

    Jeff
    The "pcp" in the command "pcp power ?" is just a script simple "/usr/local/bin/pcp" that links to a subset of functions in pcp_lms_functions.

    pcp_lms_functions is a subset of LMS commands.

    Code:
    <playerid> power <0|1|?|>
    
    The "power" command turns the player on or off. Use 0 to turn off, 1 to turn on, ? to query and no parameter to toggle the power state of the player.
    For remote streaming connections, the command does nothing and the query always returns 1.
    
    Examples:
    
    Request: "04:20:00:12:23:45 power 1<LF>"
    Response: "04:20:00:12:23:45 power 1<LF>"
    
    Request: "04:20:00:12:23:45 power ?<LF>"
    Response: "04:20:00:12:23:45 power 1<LF>"
    ? and toggle options have not been implemented in pcp_lms_functions.

    EDIT: I think I have added ? and toggle to pcp_lms_functions. Requires a bit more testing.
    Last edited by Greg Erskine; 2022-09-11 at 14:50.

  6. #46
    Senior Member Jeff07971's Avatar
    Join Date
    Aug 2011
    Location
    London, England
    Posts
    1,810
    Hi Greg,

    Quote Originally Posted by Greg Erskine View Post
    I mean when you press "power off", say in "material GUI", does the jivelite screen turn off?
    Yes, There is an option in Jivelite for Pcp Settings > Picoreplayer > Adjust Backlight brightness when off, if you set this to "0" then the display turns off completely

    Quote Originally Posted by Greg Erskine View Post
    BTW: "pcp mode" is LMS "mode ?"
    Thanks Greg

    EDIT: I think I have added ? and toggle to pcp_lms_functions. Requires a bit more testing.
    That would be great ! If this could be added I think I can modify Aki's script to do what I want

    Jeff
    Last edited by Jeff07971; 2022-09-11 at 15:10.

    Want a webapp ? Get SqueezeLite-X ! https://forums.slimdevices.com/showt...l=1#post903953

  7. #47
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    4,947
    Quote Originally Posted by Jeff07971 View Post
    Hi Paul-
    Can you elaborate a little on this please ?
    https://ralph-irving.github.io/squeezelite.html

    Look at the -G option or the -S option, These are configurable on the pCP web page.

    In either case the state change happens with the power state is changed on the device. (i.e. power button pressed, or you have a power off delay timer set in LMS to power off if the device is idle)
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  8. #48
    Senior Member Jeff07971's Avatar
    Join Date
    Aug 2011
    Location
    London, England
    Posts
    1,810
    Quote Originally Posted by paul- View Post
    https://ralph-irving.github.io/squeezelite.html

    Look at the -G option or the -S option, These are configurable on the pCP web page.

    In either case the state change happens with the power state is changed on the device. (i.e. power button pressed, or you have a power off delay timer set in LMS to power off if the device is idle)
    Hi Paul-,

    Thanks for that, I use the -G option on both my Pcp's but I'd never really looked at the -S option I have now and can see that I could have used this however I use the -G option so without writing a script to take over the -G options job it dosent seem I can use it.

    Not sure I trust my scripting as much as I trust your coding for turning the Amps On/Off

    Jeff

    Edit: I may have a play later though !

    Want a webapp ? Get SqueezeLite-X ! https://forums.slimdevices.com/showt...l=1#post903953

  9. #49
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    4,947
    Quote Originally Posted by Jeff07971 View Post
    Hi Paul-,

    Thanks for that, I use the -G option on both my Pcp's but I'd never really looked at the -S option I have now and can see that I could have used this however I use the -G option so without writing a script to take over the -G options job it dosent seem I can use it.

    Not sure I trust my scripting as much as I trust your coding for turning the Amps On/Off

    Jeff

    Edit: I may have a play later though !
    If you look at /home/tc/powerscript.sh that is an example script. The only word of caution....the execution of this script is blocking from within squeezelite, so keep the execution to small/fast tasks.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •