Hunter Douglas PowerView control with Vera and Amazon Echo

I can share the details if anyone is interested.

Not really hard. I use the Amazon Echo / Vera bridge to trigger scenes on Vera. Those scenes just use the URL interface of the Hunter Douglas PowerView hub.

Cool. Have you been able to get Hunter Douglas PowerView hub to work directly with Vera? It seems no one has been able to crack that code.

So, how did you get that to work? What’s the secret, Mike Q?

Yes I have vera talking directly to the PowerView hub. There’s a simple URL interface that you can use to have Vera send a URL to the PowerView Hub via luua code.

The video is showing Echo triggering a scene on Vera. In that scene, Vera sends a URL command to the PowerView hub.

Here’s a quick write up.

You should have already created some scenes on your PowerView hub. I had open and close scenes for all my blinds as well as some partial open scenes.

Find your hub’s IP Address. I found mine by logging into my router and looking at the devices.

Let’s say mine was 192.168.0.255

Once you have the IP, go to http://Let’s say mine was 192.168.0.255/api/scenes.

You’ll see something like this:

{“sceneIds”:[22215,12744,29368,30096,127,29335,41952],“sceneData”:[

{“id”:22215,“name”:“RmFtaWx5IFJvb20gT3Blbg==”,“roomId”:17513,“order”:0,“colorId”:3,“iconId”:0},
{“id”:12744,“name”:“RmFtaWx5IFJvb20gQ2xvc2U=”,“roomId”:17513,“order”:1,“colorId”:9,“iconId”:0},
{“id”:29368,“name”:“RmFtaWx5IFJvb20gUGFydGlhbA==”,“roomId”:17513,“order”:2,“colorId”:8,“iconId”:0},
{“id”:30096,“name”:“TGl2aW5nIFJvb20gT3Blbg==”,“roomId”:51456,“order”:3,“colorId”:3,“iconId”:0},
{“id”:127,“name”:“TGl2aW5nIFJvb20gQ2xvc2U=”,“roomId”:51456,“order”:4,“colorId”:9,“iconId”:0},
{“id”:29335,“name”:“QmVkcm9vbSBPcGVu”,“roomId”:47482,“order”:5,“colorId”:3,“iconId”:0},
{“id”:41952,“name”:“QmVkcm9vbSBDbG9zZQ==”,“roomId”:47482,“order”:6,“colorId”:9,“iconId”:0}]}

There should be an entry for each scene you created with the PowerView app.

Next go to a web browser and try each of the “id” numbers with the following URL.

http://192.168.0.255/api/scenes?sceneid= <—enter a scene id here like below

http://192.168.0.255/api/scenes?sceneid=22215 and see what happens. A blind should open or close or do nothing if it is already in the position the scene is trying to set.
Through trial and error, I figured out what each “id” did and wrote it down.

Next, I created scenes on Vera for each scene I had on the PowerView Hub.

Each scene just consists of some luaa code that essentially sends the same url.

So for the first entry in the table, (id 22215) I created a scene in vera called “open family room”

In that scene I added the following luaa code:

[b]local timeout = 5

local status, result = luup.inet.wget(“http://192.168.0.19/api/scenes?sceneid=41952”, timeout)
[/b]

And that’s about it. Now in vera you can launch that scene and your blind will open.

I used the Amazon Echo Philips Hub emulator that people are using here to control lights to control blinds as well.

The Philips Hub Emulator will have an entry for each scene and when Amazon recognizes the command, will execute the associated scene which will send the URL request to the PowerView hub and you’ll have voice control.

[quote=“mike Q, post:1, topic:190379”]- YouTube

I can share the details if anyone is interested.

Not really hard. I use the Amazon Echo / Vera bridge to trigger scenes on Vera. Those scenes just use the URL interface of the Hunter Douglas PowerView hub.[/quote]

Thanks for sharing this video. If I may ask, how you do like this PowerView system? It seems to provide far more shade and blind options than what Lutron’s Serena does, and I am trying to decide which way to commit. I was online searching for user review and the only one I could easily find was from AVSforum and the user did not seem very happy. He had concerns about security, but also about having to have additional repeaters all over his house because of poor range and about inconsistent responses to commands by some shades. Thanks in advance for any and all input on this inquiry.

I like the PowerView system. Having to have the repeaters is a minor issue. They are small and can be put in innocuous places. I have one in each room that has a blind and I don’t have any dropped signals. The phone app is pretty much crap. It’s got a clunky interface and I never us it. I don’t really need to open my blinds from any place on the planet anyway. Having them controllable from Echo is really all I need.

Mike Q - thanks for the code snippet. I’ve been using it successfully on a Veraplus with my HD Powerview shades for a few months. Other than some “ghosts” that activate the shades at random times occasionally, it works great!

I’ve got a question though. Having 8 shades, I’ve got 16 scenes (1 ea open and close). Is there a way to combine the code so that multiple the shades can operate from one scene? I’ve tried the obvious - adding the entire code again after the the last line, so it looks like this:

local timeout = 5

local status, result = luup.inet.wget(“http://192.168.0.xx/api/scenes?sceneid=41952”, timeout)

local timeout = 5

local status, result = luup.inet.wget(“http://192.168.0.xx/api/scenes?sceneid=44730”, timeout)

Sometimes it activates the first scene, sometimes the second scene, but never both scenes.

The reason for the whole exercise is that through the yearly cycle, I need the shades to open and close at different times, probably about 4 different sets of activity. Having 16 scenes in each set will make it difficult to activate/deactivate scenes. If I could combine them, it would make it much easier to switch over to a different set. (I live in a solar house and the window shades are critical to the effectiveness of the heating/cooling)

Any idea what the capacity of the VeraPlus is to store scenes?

I’m doing exactly what you describe for controlling multiple shades.

example below. I’ve never had it fail. Is it possible you need more signal repeaters? I ended up with 1 repeater in every room and 2 in one of my larger rooms. The only time I’ve seen inconsistent behavior was when the PowerHub signal wasn’t making it to the blinds. You can watch on the hub and see each scene activate. The blue light will flash in rapid succession followed by a slight pause then rapid flash, etc… each rapid flash is a scene activating.

Another option would be to create specific scenes that control multiple shades on the PowerView app. Then you would activate just once scene on Vera. However I suspect your problem is really signal integrity from PowerView Hub to the blinds. Do you ever see scenes not activate when you initiate them from Vera (other than the multi-scene scenario)?

local timeout = 5

local status, result = luup.inet.wget(“http://vera/api/scenes?sceneid=22215”, timeout)
local status, result = luup.inet.wget(“http://vera/api/scenes?sceneid=30096”, timeout)
local status, result = luup.inet.wget(“http://vera/api/scenes?sceneid=29335”, timeout)
local status, result = luup.inet.wget(“http://vera/api/scenes?sceneid=38011”, timeout)

Mike, thanks for the reply.

If I read your suggestion correctly, then here’s your suggestion:

1 - In Vera, I should create an individual scene for each shade opening or closing (16 scenes total). No timing, etc. using the luup code that calls the individual shade open or close scene in the Powerview hub. Basically duplicating the same action calls in both hubs.

2 - In Vera, create a scene that uses Luua code to call multiple vera scenes, per your example, depending on which shades I want open.

So if I wanted to open all the shades in a sequence, not at the same time, how would I put a delay between the individual calls in the luup code? (I’ve got some power supply restraints that require the shades to NOT operate all at the same time)

local timeout = 5

local status, result = luup.inet.wget(“http://vera/api/scenes?sceneid=22215”, timeout)
DELAY 1 minute
local status, result = luup.inet.wget(“http://vera/api/scenes?sceneid=30096”, timeout)
DELAY 1 minute
local status, result = luup.inet.wget(“http://vera/api/scenes?sceneid=29335”, timeout)
DELAY 1 minute
local status, result = luup.inet.wget(“http://vera/api/scenes?sceneid=38011”, timeout)

This raises the question, couldn’t I just put the delay in the luup code that I use to call the PowerView scenes per the following example?

local timeout = 5

local status, result = luup.inet.wget(“http://192.168.0.xx/api/scenes?sceneid=41952”, timeout)
DELAY 1 minute
local status, result = luup.inet.wget(“http://192.168.0.xx/api/scenes?sceneid=44730”, timeout)

As far as repeaters go, I’ve got one in each room, no more than 12’ LOS (line of sight) from each shade. The PV hub itself is in another room, distant from the shades, but it does seem to work consistently as long as I’m not screwing around with Vera. I’ve got another, much closer location I could put the PV hub, but it is on the other side of a wall that has a microwave (about 18" direct line through the stud wall) and I would be concerned that the microwave might interfere with it and/or the VeraPlus hub.

On a HD specific subject, do you have any shades that occasionally drop out and stop responding? I’ve got one that seems to have a problem at least once a week. I don’t know what causes it, but my solution was to have the shade system power supply plugged into a Zwave appliance module. I can turn that off (thereby powering down all the shades, but not the PV hub), wait 10 seconds, turn the Zwave module back on and the specific shade returns to responsiveness. (BTW I’ve got that Zwave module plugged into a UPS, so that when I lose power I can still operate my shades)

thanks for any help!

I’ve not done anything with delays but I bet you could do it like this:

For each blind you’d have a call to luup.call_delay. You’d make a function (OpenBlindWithDelay) that gets called each time the countdown timer fires. This is the second parameter of luup.call_delay. In this case it’s 60 seconds, 120 seconds, 180 seconds… add as many as you need.

The third parameter is the scene ID for your PV Hub that you want to execute. In the OpenBlindWithDelay function, we’ll issue the http request to the PV Hub for the scene that gets passed as the first parameter to OpenBlindWithDelay.

I haven’t tested this but I suspect it should work. Let me know if it gives you any issue and I can make a test scene on my system and see what happens.

luup.call_delay(OpenBlindWithDelay, 60, 22215)
luup.call_delay(OpenBlindWithDelay, 120, 30096)
luup.call_delay(OpenBlindWithDelay, 180, 29335)

function OpenBlindWithDelay(scene)
local timeout = 5
local status, result = luup.inet.wget(“http://yourip/api/scenes?sceneid=” … scene, timeout)
end

As for the HD issue with blinds not working. I had one blind early on that stopped working and I thought the motor went bad. The HD installer ordered me a new motor, popped it in an everything worked. Then the new motor stopped working and I started to suspect it wasn’t the motor. I popped the old motor back in and to my surprise it worked. What I’ve found is that when there is a power failure, the blind no longer knows what it’s position is. Was it 10% open, 90%, 100%? When this happens, the blind stupidly just stops working. I’ve also found that you can reset the blind and fix the issue by installing the PV app on a phone and doing the following:

You’ll need to have all your blinds setup in the app.

Goto the “shades” menu.
On this menu select “advanced”
You’ll get additional options:
“Recalibrate Shade”
“Clear Shade Memory”

Select “Clear Shade Memory” then select “Recalibrate Shade”

Hope this helps,

Mike

Well Mike, the code didn’t seem to be liked by vera. The blue status bar up top shows:
“ERROR: Error in lua for scenes and events”

Here’s the code I’m using, with my scene numbers and API filled in. What’s weird is that when I call the scene the problematic blind closes, yet none of the scenes I’ve called in the code has anything to do with the problematic blind scene, which is listed as PV scene ID 1683!

luup.call_delay(OpenBlindWithDelay, 60, 33275)
luup.call_delay(OpenBlindWithDelay, 120, 32515)
luup.call_delay(OpenBlindWithDelay, 180, 61689)

function OpenBlindWithDelay(scene)
local timeout = 5
local status, result = luup.inet.wget(“http://192.168.x.x/api/scenes?sceneid=” … scene, timeout)
end

BTW, I’m not familiar with LUUA, LUUP or similar languages. I dabbled in “BASIC” many years ago, so it took me a while to figure out that defining a function AFTER you’ve called it is the way it works in this language. Thanks for your help with this.

As far as the problematic shade, my solution, cutting off power via a zwave appliance switch, seems to work and I can do it remotely or on a timed basis, thereby solving the issue when I’m away from home. The next time the shade acts up, I’ll try your PV app approach and see what happens.

I did notice that the problematic shade has a PV scene ID that is a very small number (1683), could that have any bearing on the shade’s weirdness? Just a thought.

thanks

I got carried away with the … it’s only …

I’m not a LUUA coder either. I work in C, Assembly and sometimes C++. The only LUUA I’ve done is to do thinks with Vera. Some day I should really sit down and educate myself fully.

Try the revised code:

luup.call_delay(OpenBlindWithDelay, 60, 33275)
luup.call_delay(OpenBlindWithDelay, 120, 32515)
luup.call_delay(OpenBlindWithDelay, 180, 61689)

function OpenBlindWithDelay(scene)
local timeout = 5
local status, result = luup.inet.wget(“http://192.168.x.x/api/scenes?sceneid= scene, timeout)
end

Well Mike, I tried your edit (removed one of the periods before scene) and there was no movement of the shades. I watched the PV hub for the tell-tale flashing blue light, but it did not flash, just the steady blue light.
Though I no longer see Vera respond with an ERROR message.

Looking around I found, according to

http://wiki.micasaverde.com/index.php/Luup_Lua_extensions

the second parameter that is sent to the function is a string, not a number. Could that have anything to do with the non-responsiveness?

thanks again for your help

OK, I actually made a scene and tried the code as opposed to just posting it here without trying. ;D

This works. The problem is the BOTH first and last parameters are strings.

Also, the function called by call_delay should technically return 0 for success. It seemed to work without it but I added it just to be correct.

luup.call_delay(“OpenBlindWithDelay”, 60, “33275”)
luup.call_delay(“OpenBlindWithDelay”, 120, “32515”)
luup.call_delay(“OpenBlindWithDelay”, 180, “61689”)

function OpenBlindWithDelay(scene)
local timeout = 5
local string = “http://192.168.x.x/api/scenes?sceneid=” … scene

 local status, result = luup.inet.wget(string, timeout)

 return 0

end

BINGO!! Thanks so much! The test run ran perfectly. The shades came down perfectly in sequence. I’ll expand to code to include all 8 of the shades.

One further question - in doing my search for this ability, I ran into a number of comments about internal timers and having Vera reset itself and lose the timing of a currently running scene. Would that be an issue here if I was to have a time span of say an hour from start to end? My southern shades open up at about 20 minutes after sunrise, but my eastern shades, because of a solar obstruction, need to open about an hour later. Do I run the risk of Vera loosing track of where it is in the sequence?

Thanks again!

Cool. Glad it worked.

The only time you need to worry about Vera resetting on delays is with Sleep() and I believe Wait(). These are blocking events and will cause Vera to think your luua code caused something to go off in the weeds.

call_delay spawns a worker thread and is not blocking the luua engine from execution.

In short, no, you don’t need to worry about Vera resetting.

Take Care,

Mike

I’ve started to replace all the individual shade scenes with “master” scenes. I’m now having difficulty deactivating the old scenes - getting “Failed to save system configuration” error from Vera. Not sure what that’s about, but I’ll do my research on the forum and come up with a solution. Don’t want to “wear out my welcome” with you.

Thanks again Mike

I have a VeraLite running UI5 and a VeraPlus that is in the box. I tried upgrading to UI7 and transferring over to the VeraPlus and so much was broken I just gave up on the VeraPlus.

One of the issues that made me give up on UI7/VeraPlus is the “Failed to save system configuration”. Apparently the LUUA parser on UI7 is buggy and there’s a bunch of characters that you cannot have in your LUUA code or it causes the parser to choke.

Are you on VeraPlus or UI7?

Mike - I’m running a VeraPLus and UI17. (had a WINK, but abandoned it because of it’s cloud scene execution)

I discovered that if I change the lines in the luup code in the particular scene I want to disable to all comments (adding the “–” in front of the code lines), I am now able to disable the scenes. Go figure!

I’m keeping the disabled Window Shade scenes in Vera until I feel comfortable that the delay code is going to be stable, probably a week. Any idea of how I can check the amount of unused memory I’ve got in VP?