[ST Edge] Sonos LAN based Control

It seems to work for me now after deleting and re-adding all Sonos devices.

Next issue is that playing a favourite doesn’t replace the queue.

Looks like this may be relevant: Is there a way to clear the sonos queue via the API? - Stack Overflow

1 Like

The official Sonos Edge Driver (Beta) has an preference setting to replace the queue.

Just posting my solution for this by going outside the app and creating a new rule via the smartthings CLI, which allows level-based volume control on the speaker group - hopefully others find useful… (replace button-id and sonos-dth-id with the appropriate IDs which you can find by listing your devices)

{
   "name": "Sonos Button 1 volume increase",
   "actions": [
      {
         "if": {
            "equals": {
               "left": {
                  "string": "pushed"
               },
               "right": {
                  "device": {
                     "devices": [
                        "button-id"
                     ],
                     "component": "button1",
                     "capability": "button",
                     "attribute": "button"
                  }
               }
            },
            "then": [
               {
                  "if": {
                     "lessThan": {
                        "left": {
                           "device": {
                              "devices": [
                                 "sonos-dth-id"
                              ],
                              "component": "main",
                              "capability": "mediaGroup",
                              "attribute": "groupVolume"
                           }
                        },
                        "right": {
                           "integer": 9
                        }
                     },
                     "then": [
                        {
                           "command": {
                              "devices": [
                                 "sonos-dth-id"
                              ],
                              "commands": [
                                 {
                                    "component": "main",
                                    "capability": "mediaGroup",
                                    "command": "setGroupVolume",
                                    "arguments": [{"integer":9}]
                                 }
                              ]
                           }
                        }
                     ],
                     "else": [
                        {
                           "if": {
                              "lessThan": {
                                 "left": {
                                    "device": {
                                       "devices": [
                                          "sonos-dth-id"
                                       ],
                                       "component": "main",
                                       "capability": "mediaGroup",
                                       "attribute": "groupVolume"
                                    }
                                 },
                                 "right": {
                                    "integer": 13
                                 }
                              },
                              "then": [
                                 {
                                    "command": {
                                       "devices": [
                                          "sonos-dth-id"
                                       ],
                                       "commands": [
                                          {
                                             "component": "main",
                                             "capability": "mediaGroup",
                                             "command": "setGroupVolume",
                                             "arguments": [{"integer":13}]
                                          }
                                       ]
                                    }
                                 }
                              ],
                              "else": [
                                 {
                                    "if": {
                                       "lessThan": {
                                          "left": {
                                             "device": {
                                                "devices": [
                                                   "sonos-dth-id"
                                                ],
                                                "component": "main",
                                                "capability": "mediaGroup",
                                                "attribute": "groupVolume"
                                             }
                                          },
                                          "right": {
                                             "integer": 19
                                          }
                                       },
                                       "then": [
                                          {
                                             "command": {
                                                "devices": [
                                                   "sonos-dth-id"
                                                ],
                                                "commands": [
                                                   {
                                                      "component": "main",
                                                      "capability": "mediaGroup",
                                                      "command": "setGroupVolume",
                                                      "arguments": [{"integer":19}]
                                                   }
                                                ]
                                             }
                                          }
                                       ],
                                       "else": [
                                          {
                                             "command": {
                                                "devices": [
                                                   "sonos-dth-id"
                                                ],
                                                "commands": [
                                                   {
                                                      "component": "main",
                                                      "capability": "mediaGroup",
                                                      "command": "setGroupVolume",
                                                      "arguments": [{"integer":25}]
                                                   }
                                                ]
                                             }
                                          }
                                       ]
                                    }
                                 }
                              ]
                           }
                        }
                     ]
                  }
               }
            ]
         }
      }
   ]
}

3 Likes

I’m hoping for some help removing this driver. I try to remove the driver from the drivers menu in the hub, but I get “This driver can’t be deleted because it’s currently being used.” I assume that’s because the devices that got created when I scanned, are still in Smartthings.

But I can’t delete the devices. I mean I can, but they immediately reappear on their own. How can I get rid of these and the driver?

Thanks
BD

This means that you have a device using the driver. Delete the devices and you can remove the driver…

But as i said, i CAN’T delete the devices. As soon as I delete them they add themselves back immediately. How do I stop that?

Normally, the Sonos devices only get added back if you do a “Scan Nearby”. Are you saying they just “magically” reappear on their own without you doing anything after deleting them?

If that keeps happening, I’d want to see the driver logging from the ST CLI.

That is exactly what I’m saying. I’ll try to pull logs tomorrow and post them. Thank you.

BD

And just as magically, removal works just fine today! No idea what changed, but I’m not asking any questions. Devices and driver removed. Thanks!
BD

2 Likes

Just starting using your Sonos driver after Sonos updated app and old link seems to not work on my connect amp, i like how you can pick favs on this, do you know if you can get this driver to select the line input of the connect amp, thanks in advance

Sorry for piggybacking on this thread but I did not see an option to create a new one.

I used to be able to program ST to send an audio message (“the door is open”) when that condition was met. Now it doesn’t work.

I downloaded the edge driver (thank you) and found it surprisingly easy. It found my Sonos 1. But I still can’t get an audio message, or anything else, when the door is open.

Did I do something wrong?

Found 2 bugs

  1. When playing a Spotify Playlist added to My Sonos (Not a Sonos Playlist) the tracks gets added to the que and does not clear ques first like a Sonos Playlist does

  2. The Shuffle feature has no effect

Hope it is something that can be fixed in this really nice driver

I’ve been having this same issue but gave up on finding a solution a couple years ago. Glad to have found this thread!

I’m having the same issue where I cannot get a drop-down menu of Sonos favorites when using a routine. I can play a favorite if I select the speaker individually in ST app. I have installed schwark’s drivers. Same issue.


I think this is the same situation you had.
So before I delete all of my Sonos speakers and re add them (I have 14, so I don’t want to do this unless I have to lol), I just wanted to check with you to see if that’s what you did, and if that enabled you to then be able to select a favorite for a routine.

Hoping I finally can get this working!

Thanks in advance for your help!

@joshzimmerman Your screenshot looks like the ST Sonos stock driver but in either case you need to use the favourite number in a routine request. Info can be found on how to get these in and around this post in another thread:

:+1: