Sonos Integration - Is It Still Working or Has Sonos Broken It?

Some time ago, with the help and advice of other community members, I set up a cool barking dogs routine where if I was away my porch sensor noticed something on the porch, it would turn on my foyer light, brighten the porch light, and set off several seconds of loud barking dogs played through one of my Sonos devices. Well, for some reason everything works except the barking dogs, which has ceased working. I have checked addresses and all the normal stuff I could think of. I was wondering if Sonos with all their problems has broken the Hubitat-Sonos integration? Any thoughts? I can't seem to manually set off the routine either.

Still working for me, and I'm not aware of any changes that would have affected this (it uses the local API that I think is unofficial and that I think Sonos has said they'd discontinue or maybe just not focus on going forward, but I'm not aware of any actual recent changes in this regard).

I'd test things from the device detail page rather than an app (e.g., rule) to make sure you can get things working there first. Easy things to check would be the IP address changing, any errors or warnings in Logs, or anything else that might point to possible problems.

Trouble is there is no real "device" page in this case. It's a simple call to the Sonos device from the Rule. Living Room Sonos: Play Track And Restore: 'http://192.168.1.50/local/barkingdogs01.mp3'. The file is where it should be in the local file manager of the hub. The Living Room Sonos works otherwise just fine. The IP address is correct. I'm sure there is some little gotcha that I'm forgetting.

There has to be if you are doing this action in RM:

The device would be "Living Room Sonos," and you should find it -- and be able to access its device detail page for testing, as I mentioned above -- from the Devices page on your hub.

Try this URL instead:

http://192.168.1.50:8080/local/barkingdogs01.mp3

1 Like

This may or not be related, but my Ikea speaker stopped working with this driver a couple of weeks ago and I got around to checking it out this weekend.

After a couple of tries running the discover function with no luck I brought up the Sonos app and it turned out the speaker was due for a firmware upgrade. After that completed I re-ran the discover function and it came up as a new speaker, which I added and the tests all worked again. Somewhere along the way the original device was wiped out and I had to go back through my rules to fix the broken actions but everything is back up and running now.

Thanks for the pointer; not sure why I never noticed that before. Anyway, so I went to the device page and the Play and Restore Track area and entered the proper string in the URL section and put a modest 25 volume and pressed the play button: nothing. I also tried other user ASHOK's section of putting :8080 at the end of the IP address. Same result. And as I am typing that Sonos device is playing music. I wonder if I have to reboot something in my Sonos system, but am not sure what that would be. I will try another Sonos device next.

Ruling out the easy things first: where is this file hosted? Your hub? (If so, adding port 8080 is a good idea.) Wherever it is, can you verify that the file is still there? You should be able to type (or paste) this address into any web browser on the same network to verify that it will at least download the file.

You can also try a different command, like Pause (if you're playing music) or Speak (to try TTS).

It is hosted on my hub. [By the way, this has worked in the past. But I didn't notice until lately that it had stopped working.] I tried playing music using my Sonos app and then doing the PAUSE from the hubitat device page. It didn't pause the music. I will next try to access the file from a web browser. UPDATE: I was able to bring up the file and play it from my web browser. Still not from Hubitat.

Could the IP address of your Sonos have changed? The app should catch that, but opening the Sonos Integration app and re-attempting discovery (you shouldn't need to actually change anything) is one way to force it to retry. If you know the actual IP address of your Sonos, you can also compare that to the device network ID (from the Device Info tab of the device detail page) of the Sonos device on your hub, which is the IP address in hex form (using an online conversion tool like these is probably easiest; no separators or 0x prefix on the hex ID) and even manually change it if needed, though again, it would be a mystery why this is necessary.

Reserving an address for them on your network if you haven't already, probably something you've already done for your hub, is an easy way to avoid that if it's the cause.

Interestingly enough I have never paid much attention to the IP addresses of the Sonos devices before because I didn't have to, plus I use a bridge (not sure how that fits in). But I have never reserved an address for the Sonos devices. And, since you mentioned it. I have "rediscovered" the Sonos devices a couple of times using the Sonos Integration app since I have been trying to solve the problem, but to no avail. I am really at a loss now.

Sonos Amp: Living Room
Serial Number: 48-A6-B8-61-0B-48:7
Sonos OS: S2
Version: 16.6.1 (build 83162052)
Hardware Version: 1.24.1.12-1.2
Series ID: A101
IP Address: 192.168.1.3

I turned off my VPN and tried again. Still no dice. But I have always had the VPN in the past anyway.

Well, well, well. The Hubitat device info network id shows C0A8011C (192.168.1.28), whereas Sonos says it's 192.168.1.3. So I suppose the next step is to Rediscover yet again, right? Or is there a backdoor way to tell Hubitat what the address really is? Maybe I should delete all those Sonos devices before I Rediscover. But then it would probably mess up my Rules (for sure).

1 Like

You can modify the DNI to the new IP, in hex, as I suggested above. But it looks like opening the integration app and doing a discovery (nothing else needed, just opening the page) should make this change on its own if nothing else gets there first, so I'm not sure why that wouldn't have been worked unless the discovery process just isn't working on your network for some reason.

I'll repeat the suggestion to reserve a DHCP address to avoid this in the future if that is the case (even though, again, it shouldn't matter...).

1 Like

Well, I changed (in Hex) the network ID to what Sonos says it is, and it still doesn't work, so I guess now that I am slightly more dangerous I need to figure out some more stuff. I might now try to Rediscover to see if it changes it back.

Update: I had to remove the first two HEX digits from the address.

Now it works again. Thanks a bunch.

2 Likes

Use DHCP reservations for your Sonos speakers.

2 Likes