Subscribing to status changes when using capability.musicPlayer (Music Player speakers like Sonos or Samsung)


(Endoplasmic) #1

I’ve been doing a bunch of digging around and I can’t for the life of me figure out how subscribe to status changes on these wireless speakers. I thought that something like subscribe(speakers, "status", someHandler) would be fine enough. No dice.

I also tried subscribe(speakers, "" (and "touch" on it's own), someHandler) and it also didn’t work. Basically what I’m trying to work around is the lack of status update on the device itself (I’m sending them a refresh() call so that the status changes), but then I have no way to hear about when the value has changed.

I gotta assume someone has done this before, but my Google skill is failing me right now :frowning:

(Kevin) #2

You can try the 2 attributes below, but it really all depends on how the Device Handler was written. If the DH you’re using doesn’t update any of the attributes, subscribing to them won’t do anything.

subscribe(speakers, “trackDescription”, someHandler)
subscribe(speakers, “trackData”, someHandler)

(Endoplasmic) #3

Appreciate the attempt, but it looks like neither of those are working. FWIW I’m using the SmartThings DH’s for both the Sonos speaker and the Samsung speaker.

(Kevin) #4

If I remember correctly, the code for both of those DHs isn’t publically available so I don’t think there’s anything you can do.

(Endoplasmic) #5