Home of the Squeezebox™ & Transporter® network music players.
Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 25
  1. #11
    Senior Member Greg Erskine's Avatar
    Join Date
    Sep 2006
    Location
    Sydney, Australia
    Posts
    1,569
    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.

  2. #12
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    16,720
    Attached is a Perl version of the Python script to control a TP-Link smart plug. Should run OK on an rpi - possibly from a shell script which is polling CLI port for player status.
    Attached Files Attached Files

  3. #13
    Junior Member
    Join Date
    Oct 2018
    Posts
    11
    Quote Originally Posted by bpa View Post
    Attached is a Perl version of the Python script to control a TP-Link smart plug. Should run OK on an rpi - possibly from a shell script which is polling CLI port for player status.
    Cool! I'll give it a try, as soon as I reset my PiCorePlayer (I got foolish with trying static IPs and lost touch with my rpi . )

  4. #14
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    16,720
    Quote Originally Posted by andrewhess View Post
    Cool! I'll give it a try, as soon as I reset my PiCorePlayer (I got foolish with trying static IPs and lost touch with my rpi . )
    Out of curiousity - I created a plugin as a proof of concept which has commands to turn a specific device on/off.
    It is very basic (i.e. no info returned is displayed, no error if comms fail) but might be enough. The commands appear as a menu under Extra.

    Install using this repository
    http://downloads.sourceforge.net/pro...ntrol-repo.xml

    Device IP address and commands are configured via the menu.opml file - not sure how you handle this on picoplayer.

    LMS caches menu - so you need to go back to top level menu between successive commands.

    Enable plugin.remotecontrol logging to INFO to see the replies from device logged.

  5. #15
    Junior Member
    Join Date
    Oct 2018
    Posts
    11
    Quote Originally Posted by bpa View Post
    Out of curiousity - I created a plugin as a proof of concept which has commands to turn a specific device on/off.
    It is very basic (i.e. no info returned is displayed, no error if comms fail) but might be enough. The commands appear as a menu under Extra.

    Install using this repository
    http://downloads.sourceforge.net/pro...ntrol-repo.xml

    Device IP address and commands are configured via the menu.opml file - not sure how you handle this on picoplayer.

    LMS caches menu - so you need to go back to top level menu between successive commands.

    Enable plugin.remotecontrol logging to INFO to see the replies from device logged.
    Wow! I'll give it a try. But hand-holding time -- can you explain how to install it? newbie here.
    Thanks!

  6. #16
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    16,720
    Quote Originally Posted by andrewhess View Post
    Wow! I'll give it a try. But hand-holding time -- can you explain how to install it? newbie here.
    Thanks!
    If you can hold off until later today - I have a updated version which I think is "better".

    As an aside - there has been 3 downloads of the plugin. One from Canada and 2 from Russia. Interesting that there are no repository downloads from Russia which means no LMS - strange !

    LMS is not a secure system - if you make smartplugin accessible via LMS - then you have make sure access to LMS is secure

    As a general instruction for installing plugin. The repository URL tell LMS where to find a ZIp file for the plugin - the repository URLs is added to "Additional Respositories" at the very bottom of ther WebUI Setting/Plugins page.

    1. Using browser open LMS WebUI Settings/Plugins and go to bottom of page to the empty field of "Additional Respository" (or last field empty if there are other filled fields) -
    2. Copy & Paste in the repository URL into the empty field and press Return
    3. Click Apply button at bottom RHS of Plugins pages
    4. In Plugins Pages look for section "bpa Remote Control POC plugin" - if necessary click triangle to drop down list
    5. Check the box for the "Remote Control (v1.x)" enstry and click apply. LMS may prompt and need to be restarted
    6. After restart check WebUI Setting/Plugins page. If installed OK , then rhere is likely to be an entry for Remote control at top of Plugin page - check box to activate and click Apply, restart LMS if necessary/
    7. When Remote Control plugin is installed and enabled i twill show up in the "Active Plugins" list
    8. The Plugin menu will appear in Extras > Remote Control - what appears with in this menu is controlled by the plugin's menu.opml file which will need to be customised for yoru devices.

    Some LMS UIs such as on Smart phone/tablets do not show the Extras menu - if that is an issue the plugin menu can bemove to any home menu (e.g My Apps, Radio)

  7. #17
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    16,720
    I've posted an updated to the plugin - now V1.1 uses the same repository URL so if anybody has V1.0 installed - they will be notified of the update.

    Repository URL is
    http://downloads.sourceforge.net/project/bpaplugins/remotecontrol-repo.xml

    The Changes are:
    * better handling of errors and failure to connect
    * TP link control is now a web page handled by LMS so T-Link action can be initiated from a browser or from a command line using wget or curl

    TP-Link plugin is now a "page" in LMS so command such as can be "given" from a browser (i.e. open the page with the URL)

    http://<ipaddressofLMS>:9000/plugins/RemoteControl/remote.txt?action=info&target=192.168.1.64

    Green is the LMS server IP address or possibly "Localhost". Red is the command. Blue is the IP address of the socket.

    Valid command for TP-Link smart socket include "on", "off", "info", "time", "cloudinfo"

    This will return the JSON reply from the device if the command is valid. If there is an erro in the command or making connection - then a simple text messageis returned.

  8. #18
    Junior Member
    Join Date
    Oct 2018
    Posts
    11
    Quote Originally Posted by bpa View Post
    I've posted an updated to the plugin - now V1.1 uses the same repository URL so if anybody has V1.0 installed - they will be notified of the update.

    Repository URL is
    http://downloads.sourceforge.net/pro...ntrol-repo.xml

    The Changes are:
    * better handling of errors and failure to connect
    * TP link control is now a web page handled by LMS so T-Link action can be initiated from a browser or from a command line using wget or curl

    TP-Link plugin is now a "page" in LMS so command such as can be "given" from a browser (i.e. open the page with the URL)

    http://<ipaddressofLMS>:9000/plugins/RemoteControl/remote.txt?action=info&target=192.168.1.64

    Green is the LMS server IP address or possibly "Localhost". Red is the command. Blue is the IP address of the socket.

    Valid command for TP-Link smart socket include "on", "off", "info", "time", "cloudinfo"

    This will return the JSON reply from the device if the command is valid. If there is an erro in the command or making connection - then a simple text messageis returned.
    Okay, that was cool!! Thank you!! I installed the plugin, and I'm able to change the URL in a browser to turn it on and off. I don't know how to put the proper info into the plugin. Do I have to edit the menu.opml file? If so, how? Also can I change the items to say something like "Stereo On" rather than "plug on"?

    NEVERMIND! I worked it out. I'm learning! woo hoo!



    Oh, and while I'm being so demanding...Jivelite on the Picoreplayer has an option that enables you to promote an icon to the home menu. Can that be done w/ these icons?
    Last edited by andrewhess; 2019-01-27 at 10:40.

  9. #19
    Senior Member
    Join Date
    May 2017
    Posts
    364
    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: 2x SB2 (Living room and study), 1x Radio (Kitchen), 1x Boom (Dining room), 1x piCorePlayer (jacuzzi), 1x piCorePlayer (Garden) 1x OSMC + Squeezelite (Movie room), 1x Touch (Bedroom)
    Server: LMS on Pi3 7.9.1. on PcP 3.21
    Network: AVM Fritzbox, D-Link Smart Switch 24p, 3x Ubiquity

  10. #20
    Junior Member
    Join Date
    Oct 2018
    Posts
    11
    Quote Originally Posted by edwin2006 View Post
    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.
    But do you have to physically turn on the cord? I'm hoping to put a menu item on the Picoreplayer so I don't have to physically bend over to the power cord (so much work!) or even have to be in the room. This plugin is getting me close to just having to tap on a web page, or my phone's Squeeze Controler, or the touchscreen.


    So, any idea how I can promote it to the main Jivelite screen?

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
  •