Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 2 12 LastLast
Results 1 to 10 of 32

Hybrid View

  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,854
    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
    4,239
    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
    20,325
    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
    20,325
    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 Greg Erskine's Avatar
    Join Date
    Sep 2006
    Location
    Sydney, Australia
    Posts
    2,203
    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.
    piCorePlayer is a minimal Linux distribution, we strive to keep it very small, so we don't include Python. There is microPython but very few libraries. As this is a LMS install there will be Perl?

    I forgot to mention that the rpi is running Logitech Media Server, but not Squeezelite.
    I think some people missed this very important point: NO Squeezelite.

  8. #8
    Senior Member
    Join Date
    Apr 2005
    Location
    UK/London
    Posts
    3,976
    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 of "Now Playing" plugins covering Radio France (FIP etc), PlanetRadio (Bauer - Kiss, Absolute, Scala, JazzFM etc), KCRW, Supla Finland, ABC Australia, CBC/Radio-Canada and RTE Ireland

  9. #9
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    20,325
    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.

  10. #10
    Senior Member
    Join Date
    May 2017
    Posts
    745
    I used a power extension cord with master / slave. Amp in master, rest in slave. When I power up the amp the rest (incl SB) follows and vicaversa. Very low tech but works great.
    SqueezeBoxes: 1x Transporter (Living room) 1x SB2 (shed), 1x Radio (Kitchen), 1x Boom (Dining room), 1x piCorePlayer (jacuzzi), 1x piCorePlayer (Garden) 1x OSMC + Squeezelite (Movie room), 1x Touch (Study 2), few spare unit's
    Server: LMS on Pi3 7.9.1. on PcP 3.21
    Network: AVM Fritzbox, Netgear Smart Switch 24p, 3x Ubiquity

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
  •