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.