[ALPHA] Hunter Douglas PowerView integration

EDIT (12/26/17): At this time only the v1 hub is supported. Reports indicate that the v2 hub has API differences that are not compatible with this integration. I am awaiting a v2 hub of my own to investigate.

I wanted to share an early version of my integration with Hunter Douglas PowerView. I know there are some existing integrations out there, but they seemed to be in varying states of support, and they didn’t support the main use case I wanted (integrating with EchoSistant for voice control of blinds).

I’m sharing this to get feedback both on whether this is of interest to the wider community (or if people are happy with the existing integrations) and on the implementation itself, since this is one of my first non-trivial SmartApp/device attempts.

Things that are supported:

Shades

Shade support is basic, but functional. You can:

  • Create Things for individual shades, or for all shades discovered on the hub
  • Set the top and bottom positions (work in progress, not all shade types are fully supported)
  • Issue Jog and Calibrate commands
  • Refresh status

The accuracy of the data returned from the PowerView Hub is quite variable, so shade position and battery info may be out of date.

Scenes

You can:

  • Create Things for individual scenes, or for all scenes discovered on the hub
  • Trigger scenes either as a momentary switch or as a window covering via the ‘presetPosition’ command

Rooms

Room support is tailored to work with EchoSistant. EchoSistant allows specifying window coverings to be opened or closed as a group. Rather than specifying multiple sets of shades and having EchoSistant trigger them individually, you can assign an Open and/or Close Scene to a Room, and assign the Room in EchoSistant – “opening” or “closing” the Room will in turn trigger the corresponding scene.

Works in progress:

  • Discovery/configuration needs to be more reliable
  • If possible, status querying needs to be more reliable, but this may be a limitation of the PowerView Hub
  • More configurable refresh time
  • Support for multi-room scenes
  • (Possibly) optionally support LAN-based service intermediary to query PowerView and only report updates via callback, to reduce load on SmartThings.

Please provide any feedback, suggestions, or (constructive) criticism here.

PLEASE NOTE: I consider this an ALPHA quality release. I am not able to guarantee personal support for installing or using this code, but I will try to do my best here and definitely appreciate anyone willing to be an early adopter.

Hi Chris

Just thought you’d like to know this seems to work well for me.

Discovery worked quickly on the second attempt, I’m not sure why it failed the first time. It picked up all blinds and scenes and I’m able to use them without issue in the short time I’ve been testing.

The biggest advantage for me was that it is the only method that I can get to work with my Google Home. I don’t think Google Home supports Hunter Douglas directly. LogitechHarmony/Google Home wouldn’t operate the blinds as I am in the UK and it’s not yet supported in Google Home.

Your Smartthings app works well with the shortcuts function of Google Home. I set up various shortcuts along the the lines of:

When I say “open all blinds”, Google Home should “turn on open all blinds”

So, pretty happy and many thanks.

Great to hear! I’d also experienced the issue where discovery only works the second time, but haven’t debugged it yet. I’ll take another look at it.

Out of curiosity, do you have top-down/bottom-up blinds or another style? I’d like to make the top/bottom position handling a little more robust in the face of different shade types.

Glad it’s working for you. Please let me know if you find anything else missing or not working.

Thank you! Worked for me on first try - without any Groovy or other developer skills.

I cannot get the discovery to work. Tried multiple times, even changed IP address on my Powerview hub, no luck. Any ideas? Could my router be blocking port 80?

Maybe. Are you able to copy and paste log output from the SmartThings IDE? That might help. If not maybe I can add more detailed logging to try to debug.

I don’t see anything in the IDE log, is there another log file I can look at? I can operate the shades by inputing the scene IP address on my phone browser (http get).

Chris, really appreciate the code for these blinds, but I’m having trouble discovering the apps from smart things. I’ve manually added the smart app and 3 device handlers and published them. In SmartThings, I run your app, enter the IP of the HD hub and it begins to discover devices, but none of them appear. I’ve checked logging and there is nothing in there related to blinds. Any suggestions would be very helpful.

@Geoffrey_Dwyer and & @nate_haley: I’m sorry for the delay in getting back to you. I had some other things going on and wasn’t able to spend much time on this project recently. I updated the SmartApp with a little bit of additional logging whenever it calls the PowerView hub. If you would like to give it another go, update your SmartApp and try discovery again. It should output some debug logging starting with 'callPowerView: ’ that will include the URL it’s using to retrieve rooms/shades/scenes.

If it still doesn’t work, could you try using that same URL directly in your browser and see if it works there?

Thanks for the update. When I copy and paste the URLs you provide in the log, I can access them from both my phone and my computer. Still no luck through smartthings though.
I’m thinking it must be related to smarthings hub getting blocked from acessing port 80, but not sure how to fix.

Having the same issue with discovery… Hope to hear some suggestions soon. Here are some logs I saw after initiating discovery…

70398a7f-39fd-40ff-a2e0-fcc4fc46d3f2 10:02:15 AM: error java.lang.StringIndexOutOfBoundsException: String index out of range: 197
70398a7f-39fd-40ff-a2e0-fcc4fc46d3f2 10:02:15 AM: debug scene: ID = 7974, name = Open
70398a7f-39fd-40ff-a2e0-fcc4fc46d3f2 10:02:15 AM: debug scene: ID = 23771, name = Closed
70398a7f-39fd-40ff-a2e0-fcc4fc46d3f2 10:02:15 AM: debug json: [sceneIds:[23771, 7974, 34832], sceneData:[[id:23771, order:0, networkNumber:0, colorId:15, name:Q2xvc2Vk, iconId:0, roomId:23044], [id:7974, order:1, networkNumber:1, colorId:15, name:T3Blbg==, iconId:0, roomId:23044], [id:34832, order:2, networkNumber:2, colorId:15, name:VXA=, iconId:0, roomId:23044]]]
70398a7f-39fd-40ff-a2e0-fcc4fc46d3f2 10:02:15 AM: debug Entered scenesCallback()… hubResponse: physicalgraph.device.HubResponse(index:15, mac:002674E210EF, ip:C0A8018E, port:0050, requestId:24c5f343-b0df-4c62-afd6-9c81b01b4167, hubId:d267ea65-31ce-4f1d-93e6-5bb7b2f34473, callback:scenesCallback)
70398a7f-39fd-40ff-a2e0-fcc4fc46d3f2 10:02:15 AM: debug shade: ID = 45920, name = Great Room (Back)
70398a7f-39fd-40ff-a2e0-fcc4fc46d3f2 10:02:15 AM: debug shade: ID = 27677, name = Great Room (CA Room)
70398a7f-39fd-40ff-a2e0-fcc4fc46d3f2 10:02:15 AM: debug json: [shadeIds:[27677, 45920], shadeData:[[id:27677, positions:[position1:0, posKind1:3], groupId:23044, order:0, name:R3JlYXQgUm9vbSAoQ0EgUm9vbSk=, batteryStatus:3, roomId:23044, batteryStrength:149, type:23], [id:45920, positions:[position1:0, posKind1:3], groupId:23044, order:1, name:R3JlYXQgUm9vbSAoQmFjayk=, batteryStatus:3, roomId:23044, batteryStrength:161, type:23]]]
70398a7f-39fd-40ff-a2e0-fcc4fc46d3f2 10:02:15 AM: debug Entered shadesCallback()… hubResponse: physicalgraph.device.HubResponse(index:16, mac:002674E210EF, ip:C0A8018E, port:0050, requestId:d0017671-96cf-49ac-ae82-6d2dcec0dfc1, hubId:d267ea65-31ce-4f1d-93e6-5bb7b2f34473, callback:shadesCallback)
70398a7f-39fd-40ff-a2e0-fcc4fc46d3f2 10:02:15 AM: debug room: ID = 23044, name = Great Room
70398a7f-39fd-40ff-a2e0-fcc4fc46d3f2 10:02:15 AM: debug json: [roomData:[[id:23044, order:0, colorId:10, name:R3JlYXQgUm9vbQ==, iconId:0]], roomIds:[23044]]
70398a7f-39fd-40ff-a2e0-fcc4fc46d3f2 10:02:15 AM: debug Entered roomsCallback()… hubResponse: physicalgraph.device.HubResponse(index:15, mac:002674E210EF, ip:C0A8018E, port:0050, requestId:be672a4f-d036-4e2a-8e98-05e7d18b34fd, hubId:d267ea65-31ce-4f1d-93e6-5bb7b2f34473, callback:roomsCallback)
70398a7f-39fd-40ff-a2e0-fcc4fc46d3f2 10:02:14 AM: debug callPowerView: url = ‘http://192.168.1.142:80/api/scenes’, method = ‘GET’, body = ‘null’, query = null
70398a7f-39fd-40ff-a2e0-fcc4fc46d3f2 10:02:14 AM: debug callPowerView: url = ‘http://192.168.1.142:80/api/shades’, method = ‘GET’, body = ‘null’, query = null
70398a7f-39fd-40ff-a2e0-fcc4fc46d3f2 10:02:14 AM: debug callPowerView: url = ‘http://192.168.1.142:80/api/rooms’, method = ‘GET’, body = ‘null’, query = null

I’m looking at possibly buying the Powerview shades…before I do it, I want to make sure the v2 of the hub works with this? Can anyone help me out on this? Also, anyone try this integration with Core or WebCoRE?

Unfortunately, I don’t have a v2 hub to test this with yet, so I can’t speak to that question. I’ll try to find out more details and follow up on the v2 hub I was told I would be receiving.

I haven’t tried a WebCoRE integration, but it should work as the devices are exposing standard capabilities. I’ll see if I can test it tomorrow.

Thanks, Johnvey, I believe, will try to look at the updated drivers for other devices on the DH website to see if he can reverse engineer…I posted that I might just opt for v1 if I can get that…that way I know it will work with Alexa once ST sees the shades as a thing?

Well… I’ve tried directly (in the browser) going to the URLs that show up in the log. I’m getting a refused connection message. This is with a v2 hub. I’ve done a little googling about this, but so far no helpful hints.

Decided to go with Lutron…

Unfortunately, I’m still waiting for my v2 hub so I can’t offer much help until it arrives. If anyone with a v2 hub can help debug or put up the necessary fixes as a pull request on github, I could integrate them, but until then I need to wait.

I’m working on it this afternoon… and I’ll let you know if I find a solution. More to follow.

OK. I found it. Totally embarrassing. The word HUB can be confusing. I’ve been doing ST stuff for a while and I got it wrong, so I can’t pull out the newbie card.

I got confused between the ST hub (I was using its IP address) and the PowerView hub… Different IP address.

When I searched the devices on my intranet, I finally found it. The device (on my network) is called PDBU-Hub3 0.

The smartapp is good, the user was lost in another world. Oh well. Problem solved.

Glad to hear it! I’d like to get smarter PowerView hub discovery working,
which might make this step less error-prone, but I haven’t been able to
work on that.