Announcement

Collapse
No announcement yet.

[Announce] LMS-lite certified Smart Home skill for Alexa

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • Originally posted by slartibartfast
    It has only unlinked itself again. LMS has only been restarted to install plugins recently and hasn't been shutdown for an appreciable length of time.
    It's not about LMS being restarted. It's about ngrok. Did that stay up during the LMS restart or did it restart too?

    ngrok made some changes recently and free-tier no longer gets ngrok.io URLs but ngrok-free.app instead. Who knows if they are restricting somehow to 'encourage' people to pay...
    Last edited by philchillbill; 2023-04-28, 19:35.

    Comment


    • Originally posted by philchillbill

      It's not about LMS being restarted. It's about ngrok. Did that stay up during the LMS restart or did it restart too?

      ngrok made some changes recently and free-tier no longet gers ngrok.io URLs but ngrok-free.app instead. WHo knows if they are restricting somehow to 'encourage' people to pay...
      I didn't reboot the pi so ngrok shouldn't have restarted.
      Living Room: Touch or Squeezelite (Pi3B) > Topping E30 > Audiolab 8000A > Monitor Audio S5 + BK200-XLS DF
      Bedroom: Radio
      Bathroom: Radio

      Comment


      • Originally posted by philchillbill

        It's not about LMS being restarted. It's about ngrok. Did that stay up during the LMS restart or did it restart too?

        ngrok made some changes recently and free-tier no longet gers ngrok.io URLs but ngrok-free.app instead. WHo knows if they are restricting somehow to 'encourage' people to pay...
        The ngrok dashboard says my tunnel was started 7 hours ago which seems odd to me. It also doesn't appear to show my ngrok URL.
        Aha if I click on the tunnel a box opens telling me the URL and it was started at 4.02 UTC 😀
        Living Room: Touch or Squeezelite (Pi3B) > Topping E30 > Audiolab 8000A > Monitor Audio S5 + BK200-XLS DF
        Bedroom: Radio
        Bathroom: Radio

        Comment


        • I think I know what is going on. When I changed my Virginmedia Hub I changed my server address so I guess I need to edit a config file.
          Living Room: Touch or Squeezelite (Pi3B) > Topping E30 > Audiolab 8000A > Monitor Audio S5 + BK200-XLS DF
          Bedroom: Radio
          Bathroom: Radio

          Comment


          • Originally posted by philchillbill

            It's not about LMS being restarted. It's about ngrok. Did that stay up during the LMS restart or did it restart too?

            ngrok made some changes recently and free-tier no longet gers ngrok.io URLs but ngrok-free.app instead. WHo knows if they are restricting somehow to 'encourage' people to pay...
            Got it working again, noticed the new free-app URL format. Luckily my UUID didn't change either 😀
            Living Room: Touch or Squeezelite (Pi3B) > Topping E30 > Audiolab 8000A > Monitor Audio S5 + BK200-XLS DF
            Bedroom: Radio
            Bathroom: Radio

            Comment


            • Just set up LMS-lite ... all went swimmingly, players discovered fine, the basic play and volume commands worked without an issue. What wasn't working was presets ... after a lot of fiddling, it looks like the skill is trying to invoke an ancient set of presets stored on mysqueezebox.com, rather than the local presets stored on LMS - which is odd, given I run LMS with the -nomysqueezebox flag !

              Any suggestions ?

              Comment


              • Originally posted by khoadley
                Just set up LMS-lite ... all went swimmingly, players discovered fine, the basic play and volume commands worked without an issue. What wasn't working was presets ... after a lot of fiddling, it looks like the skill is trying to invoke an ancient set of presets stored on mysqueezebox.com, rather than the local presets stored on LMS - which is odd, given I run LMS with the -nomysqueezebox flag !

                Any suggestions ?
                I can see from the logs that LMS is returning a mysqueezebox.com result for the query, regardless of your -nomysqueezebox flag. And the mysb folder happens to be at index zero in the array so all your mysb favorites are first with the non-mysb coming afterwards. The non-mysb items are actually there, but you haven't tried an index far enough to actually play something non-mysb. I see you tried both favorite and preset​​ commands, so a little explanation:

                When you use the favorite or preset command, the first thing the skill does is send this to your LMS:

                Code:
                '{"id":1,"method":"slim.request","params":[0,["favorites","items","0","200","feedMode:1"]]}'
                if it sees mysqueezebox.com among the results of that, it additionally queries LMS with

                Code:
                '{"id":1,"method":"slim.request","params":[0,["favorites","items","0","200","item_id:'+str(mysb)+'"]]}'
                so that it has 'all' your favorites. This data-structure is parsed to build an array of IDs and the favorite you requested is played thusly:

                Code:
                '{"id":1,"method":"slim.request","params":["'+str(playerid)+'",["favorites","playlist","play","item_id:'+str(id)+'"]]}'​
                If you use the term preset in your command instead of favorite, this is sent to LMS instead:

                Code:
                '{"id":1,"method":"slim.request","params":["'+str(playerid)+'",["favorites","playlist","play","item_id:'+str(int(preset) - 1)+'"]]}'​
                In other words, the preset command avoids any trickery on the favorites returned by the earlier query. It can be used if people get confused about how to count the correct index value to specify, but normally the favorite variant is better because it handles nested favorites more logically/thoroughly.

                Anyway, you need to properly address the -nomysb flag or else count your favorites correctly so that the number you specify in your command maps to the favorite you actually had in mind. As a reminder, the ID-sorting the skill uses matches that of the standard LMS skin and not the Material skin.
                Last edited by philchillbill; 2023-05-07, 09:41.

                Comment


                • Originally posted by philchillbill

                  I can see from the logs that LMS is returning a mysqueezebox.com result for the query, regardless of your -nomysqueezebox flag. And the mysb folder happens to be at index zero in the array so all your mysb favorites are first with the non-mysb coming afterwards.
                  Thanks for the prompt response.

                  I'd worked out a little bit of this myself, playing around. I don't normally use favourites, and hadn't really looked at them as a result, so was a little suprised to see a reference to mysqueezebox at the head of the list. Searching the forums it seems that this was a remnant from a older install predating the -nomysqueezebox flag, so I manually deleted it from the favourites, and then set up a couple of test favourites - these work fine.

                  However whilst I don't use favourites, I do use the per-device presets on a couple of Squeezebox Radios, which is what I thought the 'preset' command would invoke. However this isn't what seems to be happening:
                  • Favourites 1,2,3 work as expected;
                  • Presets 1,2,3 play the corresponding favourite;
                  • Favourite 4 tells me the index is out of range, which is correct, as I only set up three test favourites;
                  • 'Preset 4' gets the response of 'OK', but returns an empty playlist, whereas on the actual Radio, all the per-device presets corresponding to the hardware preset buttons are populated;
                  • The preset command carries on returning 'ok' plus an empty playlist all the way up to preset 99, even though there should only be 10 presets per player !
                  Clearly this doesn't work the way I thought it would (... Which is clear from the code samples you posted ...)

                  (I did try to rediscover the devices, in case the earlier reference to mysqueezebox.com was being cached somewhere)

                  It's not a big deal - I can set up favourites to match the existing presets. I'd lose the ability to have per-device presets, but as I only really need LMS-lite to enable my disabled partner to control the bedroom radio then that's not much of a loss.

                  Thanks again.
                  Last edited by khoadley; 2023-05-07, 19:33.

                  Comment


                  • Originally posted by khoadley
                    Thanks for the prompt response.

                    I'd worked out a little bit of this myself, playing around. I don't normally use favourites, and hadn't really looked at them as a result, so was a little suprised to see a reference to mysqueezebox at the head of the list. Searching the forums it seems that this was a remnant from a older install predating the -nomysqueezebox flag, so I manually deleted it from the favourites, and then set up a couple of test favourites - these work fine.

                    However whilst I don't use favourites, I do use the per-device presets on a couple of Squeezebox Radios, which is what I thought the 'preset' command would invoke. However this isn't what seems to be happening:
                    • Favourites 1,2,3 work as expected;
                    • Presets 1,2,3 play the corresponding favourite;
                    • Favourite 4 tells me the index is out of range, which is correct, as I only set up three test favourites;
                    • 'Preset 4' gets the response of 'OK', but returns an empty playlist, whereas on the actual Radio, all the per-device presets corresponding to the hardware preset buttons are populated;
                    • The preset command carries on returning 'ok' plus an empty playlist all the way up to preset 99, even though there should only be 10 presets per player !
                    Clearly this doesn't work the way I thought it would (... Which is clear from the code samples you posted ...)

                    (I did try to rediscover the devices, in case the earlier reference to mysqueezebox.com was being cached somewhere)

                    It's not a big deal - I can set up favourites to match the existing presets. I'd lose the ability to have per-device presets, but as I only really need LMS-lite to enable my disabled partner to control the bedroom radio then that's not much of a loss.

                    Thanks again.
                    Unfortunately, LMS does not have CLI commands to play the built-in presets so the skills cannot access them.

                    The preset verbiage for the skill was devised as a way to play server-favorites using a different numbering scheme. It's pretty defunct these days since I finally figured out how to query LMS via the CLI for the entire favorites hierarchy with one API call. That was never documented so when I first wrote the skills I had to query each nested folder recursively and that often led to timeouts because a skill must complete a command within 8 secs or Alexa times out. I eventually looked at the LMS source code because I was going to modify it to allow me to avoid recursion, only to discover that the feature was always there but undocumented. For quite a while now both skills use that feature and thus the timeouts never occur. I never removed the preset command though because there are a few German users still using it.

                    Comment


                    • I cannot login into LMS-Lite as it asks me credential. I don't know which i must insert. From the Alexa app i can read there is an installer which make all the process easier, but where is the installer ? How to download it?
                      EDIT: i found the installer script and put in /home/tc of my pCP. Ran it and got:

                      [ INFO ] Backing up files to /mnt/mmcblk0p2/tce/mydata.tgz

                      Done.

                      [ OK ] Backup successful.

                      Checking if network ready. [Available]

                      Starting ngrok.




                      Establishing link...




                      wget: can't connect to remote host (127.0.0.1): Connection refused

                      wget: can't connect to remote host (127.0.0.1): Connection refused

                      wget: can't connect to remote host (127.0.0.1): Connection refused
                      Sorry, ngrok failed to initialise within the allocated timeframe

                      So the script stopped. What happened?
                      In this way i cannot get the URL to put inside the skill.
                      Can someone help me in this trouble?

                      Last edited by maurizio53; 2023-06-19, 14:07.

                      Comment


                      • Originally posted by maurizio53
                        I cannot login into LMS-Lite as it asks me credential. I don't know which i must insert. From the Alexa app i can read there is an installer which make all the process easier, but where is the installer ? How to download it?
                        EDIT: i found the installer script and put in /home/tc of my pCP. Ran it and got:

                        [ INFO ] Backing up files to /mnt/mmcblk0p2/tce/mydata.tgz

                        Done.

                        [ OK ] Backup successful.

                        Checking if network ready. [Available]

                        Starting ngrok.




                        Establishing link...




                        wget: can't connect to remote host (127.0.0.1): Connection refused

                        wget: can't connect to remote host (127.0.0.1): Connection refused

                        wget: can't connect to remote host (127.0.0.1): Connection refused
                        Sorry, ngrok failed to initialise within the allocated timeframe

                        So the script stopped. What happened?
                        In this way i cannot get the URL to put inside the skill.
                        Can someone help me in this trouble?

                        you very likely have the wrong os selected 32/64 bits.

                        Comment


                        • Originally posted by philchillbill

                          you very likely have the wrong os selected 32/64 bits.
                          I am running pCP on raspberry pi3b and selected the 32bit release of the installer.

                          Comment


                          • Originally posted by maurizio53

                            I am running pCP on raspberry pi3b and selected the 32bit release of the installer.
                            check your OS version. Rpi os can be either 32 or 64 bits. It's not clear what you mean by 'installer' here. Could be the pCP installer, could be the ngrok installer...
                            Last edited by philchillbill; 2023-06-20, 10:53.

                            Comment


                            • I have been trying to get LMS-lite working but just cannot get Alexa to discover new devices.

                              I have successfully installed ngrok on a Windows PC using the configuration script creator. I can navigate to the LMS page via the link on the local ngrok server page, although it is a little slow over my satellite Internet connection.

                              I have successfully linked the skill using both the automated and manual methods. I have started from fresh a few times and even though the skill is linking consistently, I cannot get Alexa to discover my single Squeezebox Touch using a voice command or through the Alexa app.

                              I'm hoping that someone can suggest a way forward. Thanks for any assistance.​

                              Comment


                              • Originally posted by rahl
                                I have been trying to get LMS-lite working but just cannot get Alexa to discover new devices.

                                I have successfully installed ngrok on a Windows PC using the configuration script creator. I can navigate to the LMS page via the link on the local ngrok server page, although it is a little slow over my satellite Internet connection.

                                I have successfully linked the skill using both the automated and manual methods. I have started from fresh a few times and even though the skill is linking consistently, I cannot get Alexa to discover my single Squeezebox Touch using a voice command or through the Alexa app.

                                I'm hoping that someone can suggest a way forward. Thanks for any assistance.​
                                The uuid you linked the skill with is not the uuid you are updating the ngrok tunnel details with. That can really only happen if you used different browsers or browser tabs for different parts of the process. The docs explain you have to do it all from the same machine/browser/tab or else you are seen as a new user each time and keep getting different uuids.

                                Comment

                                Working...
                                X
                                😀
                                🥰
                                🤢
                                😎
                                😡
                                👍
                                👎