Soma Smart Shades (HTTP API) Device Handler HELP required!

Hi Garrett
There a few reasons why my DTH doesn’t (yet) work with multiple blinds in no particular order:

  • I’m writing this in my spare time and learning both Groovy and the SmartThings APIs as I go along.
  • It was easier to treat the Soma Connect (bridge) plus a single blind as one device until I had the basics working. I’ve now started work on a “composite device” in a branch in my git repo. I’ll definitely merge it back to the master if and when I can get it all working.
  • Then there are some technical issues which I’ve hit:
    ** The SmartThings physicalgraph.device.HubAction seems to be asynchronous (which is normally a good thing) in a way that completely disconnects the request from the response so if you send two separate status queries to the Soma Connect Bridge for two different blinds, you get two different responses as asynchronous “events” and you have no way of understanding which response came from which blind (at least that I can find. If anyone can help with this it would be great!)
    ** The SOMA Connect API doesn’t include the blind Name or MAC address in several of the API response, so this can’t (yet) be used to work around the above issue. (I’ve requested that SOMA extend their JSON to include this information and they have agreed to do so in some future release…) I’m in the process of testing custom callbacks as a possible solution for this also…
    ** There also appears to be an outright (and long standing) bug in SmartThings physicalgraph.device.HubAction which causes all responses to go missing unless you have very particular DNIs. (eg. See Device Handler not receiving HubAction to parse())
    ** Due to the above issue, at present, the issue I have with trying to get a Composite device working is that all responses from any child device arrives as events to the parent which is not at all what I’d expect! (Although I see that some other DTH/SmartApp combinations work this way)
    Now it’s possible that I’m making some basic mistake, or that there is a simple work around but I’ve done a lot of trolling through this site and many Google searches as well as several weekends of trial and error coding and I’m afraid that I still haven’t managed to crack this (multiple shade issue) fully. If and when I do, I’ll update here, but in the meantime, any and all suggestions are appreciated!