Sonos Connect Error: "Error: Cannot get property 'hub' on null object"


(C Schwartz) #1

Any Help would be appreciated.
Quick Synopsis: Audio is not playing; seeing “Error: Cannot get property ‘hub’ on null object” when viewing Sonos (Connect) under SmartThings Labs
Error as seen on hub logging for Sonos: Connect: 346d8aee-ebf7-4e1d-ba42-bc59a01b728a 9:10:44 PM: error java.lang.NullPointerException: Cannot get property ‘hub’ on null object @ line 202

Details:
My sonos integration quit working today; not sure if something happened or the power outage this morning caused an issue or was just a fluke. I noticed later in the day my mail arrival, and mode change messages were not playing. I investigated and went into SmartThings Labs > Sonos (Connect) and attempted to validate that my sonos speakers are still detected. Discovery starts and they are found with no issues. I select my devices and hit done and get the error: “Error: Cannot get property ‘hub’ on null object” I can not manually play any of my messages defined within Labs, as well as under things when i click on a speaker to play and pause, the state on the button changes, but nothing plays. I know sonos is functional as I can use sonos apps with no issues, as well as, my third party Roomie Remote application to still control Sonos.

Here is logging from the hub when causing the error I see by click done under Sonos (Connect):

 346d8aee-ebf7-4e1d-ba42-bc59a01b728a 9:10:45 PM: trace SONOS REPONSE TYPE: Content-Type: text/xml
346d8aee-ebf7-4e1d-ba42-bc59a01b728a 9:10:44 PM: debug Executing GET /xml/device_description.xml HTTP/1.1 
HOST: 10.0.1.12:1400 

on REMOVEDFROMTRACE via sendHubCommand
346d8aee-ebf7-4e1d-ba42-bc59a01b728a 9:10:44 PM: trace ip:10.0.1.12:1400
346d8aee-ebf7-4e1d-ba42-bc59a01b728a 9:10:44 PM: trace dni: 0A00010C:0578
346d8aee-ebf7-4e1d-ba42-bc59a01b728a 9:10:44 PM: warn UNVERIFIED PLAYERS!: [uuid:RINCON_000E5844486E01400::urn:schemas-upnp-org:device:ZonePlayer:1:[port:0578, ssdpUSN:uuid:RINCON_000E5844486E01400::urn:schemas-upnp-org:device:ZonePlayer:1, mac:000E5844486E, devicetype:04, hub:db2d0417-a959-4e38-9ef0-1557d213ad08, ssdpPath:/xml/device_description.xml, ssdpTerm:urn:schemas-upnp-org:device:ZonePlayer:1, ip:0A00010C]]
346d8aee-ebf7-4e1d-ba42-bc59a01b728a 9:10:44 PM: error java.lang.NullPointerException: Cannot get property 'hub' on null object @ line 202
346d8aee-ebf7-4e1d-ba42-bc59a01b728a 9:10:44 PM: trace dni = 0A000120:0578
346d8aee-ebf7-4e1d-ba42-bc59a01b728a 9:10:44 PM: trace newPlayer = null
346d8aee-ebf7-4e1d-ba42-bc59a01b728a 9:10:44 PM: trace Scheduling 'scheduledActionsHandler' for InstalledSmartApp: 346d8aee-ebf7-4e1d-ba42-bc59a01b728a
346d8aee-ebf7-4e1d-ba42-bc59a01b728a 9:10:44 PM: debug schedule('23 30 0/3 * * ?', scheduledActionsHandler)
346d8aee-ebf7-4e1d-ba42-bc59a01b728a 9:10:43 PM: trace Deleting all scheduled jobs for InstalledSmartApp: 346d8aee-ebf7-4e1d-ba42-bc59a01b728a
346d8aee-ebf7-4e1d-ba42-bc59a01b728a 9:10:43 PM: trace Sonos (Connect) is attempting to unsubscribe from all events
346d8aee-ebf7-4e1d-ba42-bc59a01b728a 9:10:43 PM: trace Deleting all scheduled jobs for InstalledSmartApp: 346d8aee-ebf7-4e1d-ba42-bc59a01b728a
346d8aee-ebf7-4e1d-ba42-bc59a01b728a 9:10:43 PM: trace Updated with settings: [selectedSonos:[0A000120:0578, 0A000122:0578, 0A000109:0578]]

(Greg) #2

I had the same issue. After every power outage, even if it was brief, my sonos would still appear in connect but none of the smart apps would work, however my non ST sonos app worked fine. If I ran a second connect “new” sonos would appear and it would say I had more sonos than I had.

I had to delete all my smart apps, my sonos, sonos connect. Then I made a mac address reservation for my sonos and reinstalled connect and my smart apps. I have lost power since then and not lost any sonos.


(Ben Edwards) #3

This is strange, but good, that it is repeatable it sounds like. I have filed a bug with our product team. An additional info you can provide here would be helpful. Thanks.


(C Schwartz) #4

@greg - I figured it might be something like this and have already taken the steps to define my sonos devices with static DHCP reservations. I will try to recreate the setup this weekend and cause a psuedo power outage and see how it goes. Thanks for the info!


(C Schwartz) #5

@Ben - Please let me know if your team needs anything. If not this coming week I will be doing what @greg suggested and static IP my sonos devices and uninstall and recreate the sonos connect setup.


(Daniel Andoni) #6

Hello I am a complete newbie, but have set up the hub, some switches, and the sonos, but every few days the sonos stops working,then I have to delete everything and reinstall. I have made the DHCP reservations and it still happened. Can someone please give me some direction on how to fix this?


(Geoff Chat) #7

I, too, am in this boat. I have had to delete and re-setup my smartapps a few times, then they break after just a day or two. I’m not losing power or anything, it just stops working.


(Greg) #8

I’ve never had an issue except for after power loss. Sorry no suggestions from me.


(Daniel Andoni) #9

It just did it again…but I think that shutting off the power to:
The hub
Sonos bridge
Apple airport
Vonage hub

Will fix it.


(Daniel Andoni) #10

Well that did it, shutting off the power to everything and turning it back on, so far 24hrs of the sonos working. The reboot is only slightly less annoying than having to reinstall everything. I would love to hear if anyone else has a solution or similar problem.


(Morgan) #11

These appear to be the same issues, I’m having. Do you have to power everything off or do a full re-install every few days?


(C Schwartz) #12

@thrash99er Restarting all devices did not resolve the problem. (Switches, routers, access points, Sonos devices, SmartThings hub) This evening I have statically assigned IP Addresses via Static DHCP reservations to all Sonos devices and the smarthings hub I will be deleting and recreating all Sonos events tomorrow night and will let you know if this appears to resolve my problem.


(C Schwartz) #13

I have now deleted all my Sonos devices and recreated my Sonos (Connect) and all smartapps and it is functional again. I will keep this thread updated should it quit functioning again even with static IPs.

One quirk I do want to point out is I was unable to uninstall Sonos(Connect) without uninstalling IFTTT first. I kept receiving an error warning that Sonos was still in use and narrowed it down to IFTTT integration. This appears odd as the Sonos devices do not show up in the selectable list of items to allow IFTTT access to but was hindering the ability to uninstall Sonos (Connect) until IFTTT was uninstalled first.


(Morgan) #14

Are all of your Sonos apps working and connecting? I use Sonos has a voice reminder for things, but because of the inconsistence of the integration with ST I can’t really use it the way I want and need to.

I’ve been disappointed with the flakiness of the integration so far.

Did setting up Static IPs help? My DHCP server keeps giving out the Sonos the same IPs, so I haven’t seen them change so I didn’t think it would make a difference.


(Greg) #15

I lost power last night during a severe storm. My sonos is working fine today. I did MAC address reservation and haven’t had an issue since.


(C Schwartz) #16

All Sonos’ are currently working and connecting, but I have only had it re-setup for about 3hrs now… To be honest I don’t think setting the static DHCP reservations helped me resolve my issue rather the uninstall and re-install of all sonos devices and activities cleared up the issue. I just set the static IPs to hopefully eliminate any wonkiness should my Sonos IPs change during power outage etc. as that is where my issue seemed to occur last time was directly after a power outage. (again that just could have been an anomaly.)

I will let you know after a couple days if I it is still working and update this thread.


(Morgan) #17

That would be great, I use the apps to trigger off events, trigger messages and music off events and on fixed times. I don’t control Sonos from the ST app much, but those scenarios are unreliable at best.


(C Schwartz) #18

After numerous network reboots and a couple power outages, everything appears to still be working. I have not had any issues with Sonos completely stop working. I do see a few minor issues from time to time, but nowhere near as bad reliability issues as before.

One issue I see is if a message has not been played in awhile it appears choppy on first play, then after that play it appears to work. Example: notification that Chris has arrived. Arrived may be choppy playback on initial play but next play will work fine.

Second bug I think is when I have a message played for mode change, and arrival of occupants. When both I and the girlfriend arrive home at the same time. It appears Sonos begins playing the last played item on the Sonos even though Sonos was not playing when I left. I am planning on posting about this issue shortly in another post as I believe it is a different issue that requires review.


(Greg) #19

I’ve noticed and posted about music resuming when no music was playing prior to the notification playing.

I believe it is related to sonos not having a stop button. I might be playing music. I pause it, forget about it. Then an hour later a sonos notification goes off and all of a sudden music starts. It doesn’t happen everytime, but it does happen.


(C Schwartz) #20

@greg - I think you are spot on! The assumption that once someone is done playing music they will “stop” the music vs. pause the audio is impractical, as well as, not intuitive from an end user standpoint. A family user is not going to remember that nor want to stop it each time when they are done, the logical and simple pause state change is what I believe most users would do because then they can go back in sonos and restart their music right where they left next time.

I think I saw somewhere in the forums or recalled it being mentioned on one of the developer sessions that they now have a resource within Sonos, hopefully this means the integration will become stronger and oddities like this will be stomped out.