Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 10 of 245

Threaded View

  1. #1
    Senior Member philchillbill's Avatar
    Join Date
    Jan 2019
    Location
    The Netherlands
    Posts
    703

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

    LMS is so awesome, it deserves more than just one certified Alexa skill to control it. That's why I've released a second and very different skill that complements MediaServer and nicely co-exists with it. Just like MediaServer, because it's a certified skill you do not need any developer or beta accounts to use it. Plus, it's free!

    Name:  lms-lite - small.png
Views: 3297
Size:  15.4 KB

    It's called LMS-lite and unlike MediaServer which is a custom skill, this one uses the Smart Home paradigm. While the downside of this is far fewer and more limited commands compared to MediaServer, the upside is that there's never a need for an invocation name (so commands are shorter), plus, your LMS players show up as smart-home devices in the Alexa app. That means they can be included in groups with other smart home devices and used in routines to do clever things like switch an amplifier on/off together with a Squeezebox.

    With the Smart Home paradigm, Amazon has pre-written a bunch of voice commands to control gadgets. A skill author cannot extend or change these, but they do provide basic/useful functionality and are available for several spoken languages. There's a pool of so-called interfaces that a skill can rely on, and for this skill I've included everything that could possibly work with LMS: Alexa.PowerController, Alexa.Speaker, Alexa.PlaybackController, Alexa.RangeController, Alexa.ModeController, Alexa.ToggleController and Alexa.EndpointHealth. Check https://developer.amazon.com/en-US/d...nterfaces.html if that got you curious.

    LMS-lite uses exactly the same account-linking process as the full-function MediaServer skill, where most people use ngrok as their proxy. The easy-setup procedure is explained at https://smartskills.tech/lmslitesetup but if you already have MediaServer then you will be familiar with the idea.

    Once you link the skill successfully, you just say Alexa, discover devices. You should also do this any time you add or remove players. Note that Alexa will only mention a device as being 'new' the first time she sees it so if you re-discover you will be told that no new devices were found. However, whatever Squeezeboxes were found will always be visible in the Alexa app in the display category MUSIC_SYSTEM. Here's an example:


    Name:  IMG_5531.PNG
Views: 368
Size:  20.8 KB


    During discovery, your player names are untouched by the skill and reported as-is to Alexa (except for removing disallowed characters).

    So, what commands do we have available? The following examples are for spoken English and are on an interface-by-interface basis and assuming a Squeezebox called Touch for example purposes. Once a player name has been mentioned in any of the commands, it persists until a different player is mentioned or a different music-playing skill is launched from that Echo. The examples below omitting 'Touch' in them assume that fact and will not work if no previous command recently mentioned Touch (or else Alexa will ask "Sorry, on what device?"). If in doubt, always mention the player name in the command. Each Echo has its own persisted Squeezebox too, so remember that fact if you move to another room and issue a name-free command. Don't blame/credit me for these utterances, they're Amazon's work:

    Alexa.PowerController gives us power on/off.

    Alexa, power ON the Touch
    Alexa, power OFF the Touch
    Alexa, turn ON the Touch
    Alexa, turn OFF the Touch

    Alexa.Speaker gives us volume control and muting.

    Alexa, set Touch volume to 70
    Alexa, volume 20 on Touch
    Alexa, increase the Touch volume by 10
    Alexa, louder
    Alexa, quieter
    Alexa, decrease the volume by 20
    Alexa, mute the Touch
    Alexa, unmute Touch

    Alexa.PlaybackController gives us transport commands.

    Alexa, next track on Touch
    Alexa, next
    Alexa, skip this
    Alexa, previous track on Touch
    Alexa, previous
    Alexa, go back
    Alexa, 'play' on Touch *
    Alexa, resume Touch *
    Alexa, pause
    Alexa, stop
    Alexa, rewind (not native on LMS but skips back 60 sec)
    Alexa, FastForward (not native on LMS but skips ahead 60 sec)
    Alexa, start-over (goes to track 1)

    *For play/resume, never leave out the player name. Otherwise a music skill will attempt to process the command instead of LMS-lite.

    Alexa.RangeController gives us setting and querying the track index (first track is 1) and numbered favorites.

    Alexa, track 7 on Touch
    Alexa, what track is the Touch at?
    Alexa, favorite 3 on Touch
    Alexa, preset 6 on Touch

    Alexa.ToggleController gives us setting and querying of both loop (repeat album) and shuffle-play (shuffle by song)

    Alexa, turn ON 'loop' on Touch
    Alexa, activate 'loop' on Touch
    Alexa, turn OFF 'loop' on Touch
    Alexa, deactivate 'loop' on Touch
    Alexa, is 'loop' ON, on Touch?

    Alexa, turn ON 'shuffle play' on Touch
    Alexa, activate 'shuffle play' on Touch
    Alexa, turn OFF 'shuffle play' on Touch
    Alexa, deactivate 'shuffle play' on Touch
    Alexa, is 'shuffle play' ON, on Touch?

    Alexa.ModeController gives us more control of both repeat and shuffle.

    Alexa, set 'repeat mode' on Touch to 'OFF'
    Alexa, set 'repeat mode' on Touch to 'song'
    Alexa, set 'repeat mode' on Touch to 'playlist'
    Alexa, set 'repeat mode' on Touch to 'album'
    Alexa, what is the repeat mode on Touch?

    Alexa, set 'shuffle mode' on Touch to 'OFF'
    Alexa, set 'shuffle mode' on Touch to 'song'
    Alexa, set 'shuffle mode' on Touch to 'playlist'
    Alexa, set 'shuffle mode' on Touch to 'album'
    Alexa, what is the shuffle mode on Touch?

    See https://mediaserver.smartskills.tech...ml#section-6-0 for an explanation of the above and also a summary of how LMS-lite and MediaServer handle overlapping commands.

    With an Alexa Routine*, you can have a single trigger send a volley of commands to a player - much like a smart-home 'scene'. A trigger can be a self-defined voice command, time of day, or input from a sensor such as motion/contact/illuminance. Any combination of player Power (on/off), Favorite (#), Loop (on/off), Player Volume (0-100), Preset#, Repeat Mode (off/song/album), Shuffle Mode (off/song/album), Shuffle Play (on/off) and Track (#) can be assigned to a single trigger (see image on the left). This could be used to start playing a particular favorite at a certain volume at a pre-defined time (giving a more capable Alarm Clock than the built-in LMS one - see image on the right) or when you arrive home and your door-contact triggers.

    *In the Alexa app select Routines and under Add/edit routine, as an Action select Smart Home. Under All Devices you should see your players among your other Smart Home devices. Any parameter(s) you tick will be included in the routine with the selected value.

    Name:  routine.png
Views: 324
Size:  64.1 KB


    With smart-home skills, custom error messages are not possible. Any error(s) mentioned by Alexa with your connectivity should be taken as a prompt to check out your entire connectivity chain from cloud to player - the error text may not nail down the real issue. A disconnected player or server, for example, can result in incorrect advice to re-link the skill (which is totally unnecessary). Always check the LMS GUI to troubleshoot connectivity !

    You should use the same ngrok tunnel for both LMS-lite and MediaServer. If you have any account-linking issues then it should *not* be necessary to unlink either skill just to get the other one working. Like MediaServer, LMS-lite can handle multiple LMS instances at different locations provided player names are unique.
    Last edited by philchillbill; 2021-05-31 at 00:51. Reason: New commands, new screenshots from App

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
  •