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...
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 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
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.
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.
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)
@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).
Ok I'm addicted 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!!