Announcement

Collapse
No announcement yet.

How to include link in LMS GUI to Switch-on/off Raspberry Pi via Tasmota smart plug?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to include link in LMS GUI to Switch-on/off Raspberry Pi via Tasmota smart plug?

    Hello all,
    I have multiple piCorePlayers running on a Raspberry Pi each.The LMS is running on a Synology NAS (Docker).
    I'd like to switch-on the Raspberry Pi's and the Amp via a smart plug (Delock 11826 running Tasmota 7.2.0) by a link included in the LMS GUI main menu calling a curl.
    Furthermore, I'd like to switch-off the Raspberry Pi and the Amp by another link and in addition via the sleep plug-in if it switches off the the PiCorePlayer software.
    Keeping the Raspberry Pi and the Amp online is no option, because of the WAF (woman acceptance factor)... ;-)
    Unfortunately, I couldn't find a way how to include such a link nor if there is some existing plug-in for this purpose.
    Maybe there is an easy way to write an own plug-in, but I currently don't know where to start...
    Any help is very appreciated. Thanks a lot in advance!

    #2
    The usual way to approach this is via the regular "power" button on the player controls.
    Then link that event to a script.
    See the EventTrigger plugin for one way to do it.


    it was discussed on this forum within the last few days.
    Paul Webster
    Author of "Now Playing" plugins covering Radio France (FIP etc), PlanetRadio (Bauer - Kiss, Absolute, Scala, JazzFM etc), KCRW, ABC Australia and CBC/Radio-Canada
    and, via the extra "Radio Now Playing" plugin lots more - see https://forums.slimdevices.com/showt...Playing-plugin

    Comment


      #3
      I did a proof of concept for a TP-Link smart plugin where On/off was triggered by HTTP / GET on an URL - thread below is the exchange. Event trigger plugin may be easier.
      https://forums.slimdevices.com/forum...yer#post106286 post 16 onward relates to plugin solution.

      Comment


        #4
        Thanks, Paul.
        I have seen this discussion, but this doesn't solve my problem, because the power button isn't available if the Raspberry Pi is completely switched-off.
        Only reachable piCorePlayers (hardware is switched-on) are listed at the upper most left corner of the GUI. But if the player is not listed there I can't switch it on...
        It also doesn't solve the problem to send a switch-off event if the sleeping count-down is over...

        Comment


          #5
          Thanks bpa,
          I tried to test your plug-in. Unfortunately, it isn't compatible with the the current version of LMS...

          Comment


            #6
            Originally posted by E.T. View Post
            Thanks, Paul.
            I have seen this discussion, but this doesn't solve my problem, because the power button isn't available if the Raspberry Pi is completely switched-off.
            Only reachable piCorePlayers (hardware is switched-on) are listed at the upper most left corner of the GUI. But if the player is not listed there I can't switch it on...
            It also doesn't solve the problem to send a switch-off event if the sleeping count-down is over...
            Good point - players disappear from the UI when they are not running ... however, there might be a way around that.
            You could use the Group Players plugin and create a group that has just one member - and then maybe you will still get events for the group player being switched off/on.

            I suspect, but have not tested, that when the sleep timer is reached it can result in a power-off event being fired.
            Paul Webster
            Author of "Now Playing" plugins covering Radio France (FIP etc), PlanetRadio (Bauer - Kiss, Absolute, Scala, JazzFM etc), KCRW, ABC Australia and CBC/Radio-Canada
            and, via the extra "Radio Now Playing" plugin lots more - see https://forums.slimdevices.com/showt...Playing-plugin

            Comment


              #7
              Originally posted by E.T. View Post
              Thanks bpa,
              I tried to test your plug-in. Unfortunately, it isn't compatible with the the current version of LMS...
              Not really incompatible just the install.xml is old.
              Stop LMS.
              Edit Cache/InstalledPlugins/Plugins/RemoteControl/install.xml file and change the maxVersion from 7.* to 8.*
              Start LMS

              edit:

              Alternatively just check the box "Use unsupported extensions" (last line of Plugins page)
              Last edited by bpa; 2023-03-16, 23:52.

              Comment

              Working...
              X