Needing help: Hunter Douglass / Powerview Shades

Trying to convert this ST app and drivers to Hubitat. I can get the newly-created app to discover all my scenes and blinds, but it does not create any child apps as it does with ST. I feel that's the issue, probably listed somewhere in the porting guide, but I can't comprehend everything in it.

This is my first try at making/converting my own code. Thought it would be pretty straight forward since the PowerView is just a simple HTTP server, but perhaps not. Wondering if anyone has any advice (or has already done this themselves). Thanks!

The little bit of porting that I've done was easy but it was just two drivers.
The big thing to watch out for is big heavy apps coming over from ST doing things that HE wasn't designed for.
That guide was all I needed.
I searched for the individual errors before finding the guide unfortunately...

This app wouldn't create a child app. It creates child devices though. You would also need to import those child devices.

Then add the app and go through the configuration.

Look in the logs for any errors you see.

Oops, yes, that's what I meant to say. I added the driver codes, then the app code, installed the app. No errors in the logs :frowning: Anything else I should be looking for? There are a few "debug" things in the logs..

Three drivers and one app here. Not sure if that qualifies for big heavy, it's my first attempt. It's both the largest and smallest i've ever attempted :slight_smile:

1 Like

How have you made out? Any hold-ups?

no luck as of yet. still not sure what is actually breaking. will report back if i find anything

Feel free to pm me a copy of what you're trying to convert. I'll take a stab at it.

If you do, a github link or zip file of the code in Dropbox or something would be best.

1 Like

If you see no errors then the logic isn't even getting to the point of adding.

From what I remember it discovers everything and then gives you a drop down and you select what to create.

In the code look for the 'addchild' word. This is the line that actually will create the switches. Look at the logic around it. You can also add some log.debug lines to help you troubleshoot.

1 Like

Thanks Gavin. I'll give that a try. That's probably where it's breaking.

Any luck getting this up and running?

Unfortunately I had to put this one on the back burner for a few months. Will probably pick it up again in April. Let us know if you try tackling it as well.

FYI - I have the port from ST almost finished on this. I have the scenese working and just need to port the device handler for the individual shades. Should be soon.

Awesome! Happy to test scenes if you'd like - I only use scenes with my setup.

Ok, give this a try, let me know if it works for you.

1 Like

It's discovering all the scenes and shades correctly. When creating a virtual device, I select the scene driver, but I'm not seeing where to assign that device to one of the scene selected in the app. ALso seeing the below error. THough... I have yet to delete the app from ST, so perhaps PowerView doesn't like two devices trying to telnet in at the same time?

errorjava.lang.NullPointerException: Cannot get property 'hubMAC' on null object on line 99 (installed)

Turns out the API to power view is sending really simple HTTP requests. So, for example, the request:

http://192.168.1.77/api/scenes?sceneid=39568

Activates scene id 39568. So, it doens't matter how many devices are hitting the powerview hub.

You shouldn't have to assign the devices manually. When you run the app, it creates the devices and assigns them to their drivers automatically.

1 Like

@rsteve I found a mistake that I introduced right before putting on github. When I reloaded the app, it wasn't making the devices. I fixed it and reloaded mine and it works.

There is also a problem that I fixed, but it created a new one. After starting the app for the first time, put in your IP address of your powerview and press enter, it should say "searching for shades", then right click and hit relead on your browser, it should list them. Pick your scenese and submit within a minute. I'll try to fix that better, later on.

If you are still getting that error, comment out state.hubMAC = parent.hubMAC on line 99 in the driver. I do not believe the MAC is necessary (mine is null, but doesn't throw an error).

1 Like

Ha! I had the same weird timeout issue when I was trying to do it myself. Cool, will try again tomorrow. Thanks so much!

Ok I'm addicted :slight_smile: decided to stay up and play with it some more. Works perfectly now! I'll report back once my sample size is larger after adding automation. Thanks so much!!