Working ST control of Hunter Douglas PowerView Motorized Window Coverings

motorizedblinds
blinds
dth_windows
project_shades

(Paul Mullen) #1

This is not the most sophisticated set up, but it should work well enough to give others the hints they need to control the HD PowerView blinds.

First, the thing to know is that the blinds are operated by sending a GET to the IP address of the blind controller. You’ll have to do a little sleuthing to find the IP address. I’m assuming that people in this forum can sort that out.

Next, you’ll want to establish some scenes using your PowerView app. Use the HD app for your smartphone.

Now, to operate the blinds, you’re going to need the scene numbers associated with each of the scenes you’ve just set up. They’re typically 4-6 digit integers. To find them, go to the browser of your choice and enter > http://your_ip_address/scenes?

You’ll get back a slug of JSON with the numbers of the scenes. Here’s an example of the response when I do that for my blinds:

{"sceneIds":[26984,2512,61689],"sceneData":[{"id":26984,"networkNumber":0,"name":"RGF5dGltZQ==","roomId":49072,"order":0,"colorId":4,"iconId":0},{"id":2512,"networkNumber":1,"name":"TmlnaHQgVGltZQ==","roomId":49072,"order":1,"colorId":9,"iconId":0},{"id":61689,"networkNumber":2,"name":"QXdheQ==","roomId":49072,"order":2,"colorId":15,"iconId":0}]}

the first three sets of digits are the scene IDs.

You may want to test this using each scene ID with something like this: > http://192.168.1.71/scenes?sceneid=2512 In my case, that was the GET command to close the windows.

I played around a bit with each scene id, until I figured out which scene ID went with which physical position of the blinds.

Now the Device Handler I wrote supports 3 scenes. In my case they were Open, Closed, and Tilt. But of course you can modify this. For your liking.

Slap this code into your device handler, publish it for yourself. Add a device of this type. Then go to the settings and enter the IP address, Port (80), and the scene numbers, and you’re all good to go.

/**
 *  Hunter Douglas Blinds
 *
 *  Copyright 2016 Paul Mullen
 *
 *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 *  in compliance with the License. You may obtain a copy of the License at:
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
 *  on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the specific language governing permissions and limitations under the License.
 *
 */




metadata {
	definition (name: "Hunter Douglass Blinds", namespace: "paullmullen", author: "Paul Mullen", oauth: true) {
		capability "Window Shade"
        
        attribute "ipAddress", "string"
		attribute "openSceneID", "string"
		attribute "closedSceneID", "string"
		attribute "tiltSceneID", "string"
        

	}
    
    preferences {
		input "internal_ip", "text", title: "Internal IP", required: true
		input "internal_port", "text", title: "Internal Port", required: true
		input "internal_open", "text", title: "Internal Open Scene #", required: true
		input "internal_closed", "text", title: "Internal Tilted Scene #", required: true
     	input "internal_tilted", "text", title: "Internal Closed Scene #", required: true
}


	simulator {
		// TODO: define status and reply messages here
	}

	tiles {
		standardTile("scene1Switch", "device.switch", width: 1, height: 1, canChangeIcon: false) {
			state "nc", label: 'Open', action: "open", backgroundColor: "#ffffff"
		}
		standardTile("scene2Switch", "device.switch", width: 1, height: 1, canChangeIcon: false) {
			state "nc", label: 'Close', action: "close", backgroundColor: "#ffffff"
		}
		standardTile("scene3Switch", "device.switch", width: 1, height: 1, canChangeIcon: false) {
			state "nc", label: 'Tilt', action: "presetPosition", backgroundColor: "#ffffff"
		}
        valueTile("Status", "device.status", width: 3, height: 1) {
            state "status", label: '${currentValue}'
        }

		details(["scene1Switch","scene2Switch","scene3Switch","Status"])
        main ("Status")

	}
}



// handle commands
def open() {

	log.debug "Executing 'open'"
    

    try {

		def result = new physicalgraph.device.HubAction(
				method: "GET",
				path: "/api/scenes?sceneid=${internal_open}",
                headers: [
                HOST: "${internal_ip}:${internal_port}"
				]
				)
			sendHubCommand(result)
	 }   catch (e) {
        log.debug e
     }
     sendEvent(name: "status", value: "Open")
     

}

def close() {

	log.debug "Executing 'close'"

    try {

		def result = new physicalgraph.device.HubAction(
				method: "GET",
				path: "/api/scenes?sceneid=${internal_closed}",
                headers: [
                HOST: "${internal_ip}:${internal_port}"
				]
				)
			sendHubCommand(result)
	 }   catch (e) {
        log.debug e
     }
     sendEvent(name: "status", value: "Closed")


    
}

def presetPosition() {

	log.debug "Executing 'presetPosition'"
    
    try {

		def result = new physicalgraph.device.HubAction(
				method: "GET",
				path: "/api/scenes?sceneid=${internal_tilted}",
                headers: [
                HOST: "${internal_ip}:${internal_port}"
				]
				)
			sendHubCommand(result)
	 }   catch (e) {
        log.debug e
     }
     
     sendEvent(name: "status", value: "Tilted")

     
}

It’s not beautiful,but it’s enough to unconfuse someone who started confused.


#2

thanks for this!

worked great, just had to figure out the url, you had it a bit off.

should be http://your_IPaddress/api/scenes/
and to test http://your_IPaddress/api/scenes/?sceneid=38045


(PJ) #3

Many thanks for this, I have this working as a simple remote control to activate the scenes.

Have you any ideas on how to automate the blinds for example based on motion or time. The blinds don’t appear to be available for any automation or apps because they are looking for switches. Can they be linked to a virtual dimmer or switch?


(Yaggayoyo) #4

I second that request.


(Guillaume Boudreau) #5

I created a DeviceHandler that asks for scene names instead of ID. It will find the proper ID by itself using the names you provide in the preferences (for open, close and preset scenes).

It also uses the open and close scenes when it’s used as a switch.

Of note: I was not able to make it work using a internal (LAN) IP address. Not sure if it’s the same for everybody, but for me, I had to open a port on my router to make it work. I also added a token preference on my device handler, which you can use to authenticate incoming HTTP requests if you’d like. Otherwise, your just opening your PowerView Hub to everyone on the internet… Bad idea!

Published my code here:


(Grant Luyt) #6

Hi Guillaume, I’m new to the home automation scene…just to clarify. I want to be able to control my Hunter Douglas PowerView blinds via Alexa… From a hardware perspective, I’ll need a Amazon Echo, Samsung Smartthings hub and a Hunter Douglas PowerView hub?


(James) #7

My blinds have been installed, but had a faulty hub so waiting the unbearably long time for a replacement!

Meanwhile…I came across this. Anything folks have tried?


#8

Do any of the Smart app versions out there work with hub v2?


#9

Here’s a SmartThings LAN-based DTH that controls the Hunter Douglas Powerview hub and exposes devices for shades and scenes: https://github.com/johnvey/smartthings-hd-powerview

The ST community thread is here: [RELEASE] Hunter Douglas PowerView Hub integration

(At this time, this only works with Gen 1 hubs; Gen 2 hubs seem to have changed the API somehow. If any Gen 2 owners want to help, I can update the drivers to work).