Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 3 123 LastLast
Results 1 to 10 of 25
  1. #1
    Junior Member
    Join Date
    Oct 2018
    Posts
    11

    Turning on stereo from piCorePlayer

    Hi all, and thanks in advance for your help with this!

    I have a rpi 3 with piCorePlayer and 7" touchscreen with Jivelite. it accesses music files on my Synology NAS and sends it out to a Logitech Transporter, serving as a preamp, and on to my amp. I've rigged a TP-Link wifi Smartplug to the power plugs for the Transporter and amp, and at the moment I can say "Alexa, turn on the stereo" to turn them on/off. But I always feel silly saying this, and I'd like to streamline the process.

    Ideally: is there a IFTTT option, so when the Jivelite/piCorePlayer is active it turns on the smartplug?

    Next best: can I add a menu option on the Jivelite menu that will active the smartplug?

    I hope this makes sense. Help?

    Andrew

    ps. I should add, I can handle the GUI for the pcp, but for any Unix coding you'll have to hold my hand.
    Last edited by andrewhess; 2018-10-24 at 05:07.

  2. #2
    Senior Member
    Join Date
    Sep 2005
    Posts
    2,790
    Hi,

    i have no clue about picoreplayer, but Jivelite is just a gui frontend - you may have some squeezelite session to run the audiostream.
    squeezelite supports the -S Parameter that runs a script when you power on/off that player.
    Now you only need a scripted way to do the same like telling alexa audio on/off.

    Search for squeezelite -S

  3. #3
    Senior Member
    Join Date
    Jan 2011
    Location
    Staffordshire. UK
    Posts
    2,485
    Squeezelite can start playback when the pi is powered on.

    You can select what you want to hear on the Squeezelite Tab in pCP.

    You just then need to control the power supplied to the pi.

    I used this feature with a rpi into pre-amp connecting to Active speakers, all plugged into the same power strip.

    ronnie

  4. #4
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    16,720
    Some TP-Link smart plugs have been "hacked" so that you can control them with a local python program.

    See https://github.com/softScheck/tplink-smartplug

  5. #5
    Junior Member
    Join Date
    Oct 2018
    Posts
    11
    Quote Originally Posted by bpa View Post
    Some TP-Link smart plugs have been "hacked" so that you can control them with a local python program.

    See https://github.com/softScheck/tplink-smartplug
    This is intriguing! But I have no clue how I might use the rpi with python. I imagine that I'd have the program check if the rpi is awake and then turn on the switch.

    I forgot to mention that the rpi is running Logitech Media Server, but not Squeezelite.

    A

  6. #6
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    16,720
    Quote Originally Posted by andrewhess View Post
    This is intriguing! But I have no clue how I might use the rpi with python. I imagine that I'd have the program check if the rpi is awake and then turn on the switch.

    I forgot to mention that the rpi is running Logitech Media Server, but not Squeezelite.
    If you're playing audio on the rpi - then Squeezelite is there in the background. The script could then be run from squeezelite.

    For player that are not on the rpi - you'd need the script to communicate with LMS through CLI. However I recall there used to be a plugin called somehting like svrPowerControl which might be able to run the script - however I don't know if it is currently supported/documented.

    edit:

    Old long thread for plugin but last post is in 2018.

    https://forums.slimdevices.com/showt...vrPowerControl
    Last edited by bpa; 2018-10-24 at 16:02.

  7. #7
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    1,598
    Squeezelite can run a script directly, based on the Power Status of the player.

    Look at the -S option.......or -G if you want to use direct control of the rpi gpio.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  8. #8
    Junior Member
    Join Date
    Oct 2018
    Posts
    11
    Quote Originally Posted by bpa View Post
    If you're playing audio on the rpi - then Squeezelite is there in the background. The script could then be run from squeezelite.

    For player that are not on the rpi - you'd need the script to communicate with LMS through CLI. However I recall there used to be a plugin called somehting like svrPowerControl which might be able to run the script - however I don't know if it is currently supported/documented.

    edit:

    Old long thread for plugin but last post is in 2018.

    https://forums.slimdevices.com/showt...vrPowerControl

    Sorry, too many acronyms on this forum (does everyone really understand all this? I feel old and dim.). What CLI? The svrPowerContol looks potentially perfect--I'll start researching it. One possible issue is that I want it to control the power supply to my stereo via the TP-Link smart plug (the Transporter has tubes that don't turn off when you turn off the Transporter--it's a mod). Can this plugin do that?

    Thanks,
    A

    edit: Wait...CLI....command line interface!
    Last edited by andrewhess; 2018-10-25 at 05:03.

  9. #9
    Senior Member
    Join Date
    Apr 2005
    Location
    UK/London
    Posts
    1,277
    If things have not changed with the top-link Smart plug then ... you could use the Python script from https://www.softscheck.com/en/revers...tp-link-hs110/ and use set_relay_state to make it turn the device off/on.
    First thing would be to get it working from a script ... and if it does ... then get that script called from whichever mechanism you end up using to determine that a switch on/off is needed.
    Paul Webster
    http://dabdig.blogspot.com
    Author Radio France (FIP etc) plugin

  10. #10
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    16,720
    Quote Originally Posted by andrewhess View Post
    Sorry, too many acronyms on this forum (does everyone really understand all this? I feel old and dim.). What CLI? The svrPowerContol looks potentially perfect--I'll start researching it. One possible issue is that I want it to control the power supply to my stereo via the TP-Link smart plug (the Transporter has tubes that don't turn off when you turn off the Transporter--it's a mod). Can this plugin do that?

    edit: Wait...CLI....command line interface!
    CLI = command line interface. LMS has an interface which text based command can begiven to control LMS / player and get status. If you have done any programming it is a bit cryptic as IIRC it is aimed at programs not humans.

    In LMS world - when players are turned off - they are not off - just the display is blank - SB players are only really off when power is removed. When you turn on a player by applying power (e.g. via smart socket) - you will need to allow time for player to power up, get on network and then for LMS to recognise player is on network.


    Quote Originally Posted by Paul Webster View Post
    If things have not changed with the top-link Smart plug then ... you could use the Python script from https://www.softscheck.com/en/revers...tp-link-hs110/ and use set_relay_state to make it turn the device off/on.
    First thing would be to get it working from a script ... and if it does ... then get that script called from whichever mechanism you end up using to determine that a switch on/off is needed.
    This looks to be the same script only I referenced github.

    The advice is right - don't waste time on LMS plugins etc until you have checked from a shell prompt that the script runs on rpi and that it can control the smart plug.

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
  •