-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[hdpowerview] PowerView Gen 3 support #12678
Comments
The fact they havent released the api is not a great sign for any backwards compatability but fingers crossed for the new hub to support the old protocol - be nice if shades automatically updated their postion with the hub when finished moving |
Or it might mean that the API did not change :) |
Likely some bad news unfortunately https://community.home-assistant.io/t/hunter-douglas-powerview-gen-3-integration/424836/3 |
The current (older) API uses plain text over HTTP with no encryption and no authentication. So it is pretty archaic. Therefore my guess is that they will have moved to HTTPS and some form of authentication (perhaps password based or token based). { Note: I had the exact same experience in the last month with the Heatmiser Neohub where the manufacturer migrated from plain text HTTP to a token based web socket connection instead #12915 (comment) and in this case, they kept support for the legacy plain text HTTP but now it requires the user to explicitly switch it on in the App } |
Yea that makes sense - would be good if they added it via firmware to the old hubs too tbh - just make it optional |
PS in my App there is an option 'Receive Early Access Updates' (Opt in to receive early access to firmware updates before official release) ... however I am extremely nervous about whether or not to enable it ... |
IMHO you should try it. 😆 |
Btw, in the linked thread a port scan was made, and port 443 wasn't open. |
LOL |
@jlaur here is another article that answers some of your questions about Gen 2 vs Gen 3 inter-operation.. https://www.slashgear.com/850488/hunter-douglas-smart-blinds-embrace-bluetooth-why-thats-a-big-deal/ |
@jlaur someone made the following post on the HA forum; it's not definitive, but the guy sounds like he knows something.. |
@jlaur I found the following link, which implies that some commercial companies have developed integrations for Gen3 hubs. The web page has an email link, and I have already emailed them asking for information about the Gen 3 API. I will keep you informed if I get any response. https://controlconcepts.net/manufacturers-modules-and-drivers/hunter-douglas/ |
@jlaur the response was as follows..
|
Thanks for stepping in and offering support, @vves. For supporting the Gen 3 gateway we currently lack documentation and/or users (in order to get hands on), since we are currently not in procession of the new gateway. I recently added new TDBU shades to my setup, so I now have 11 shades on a Gen 2 Hub, so for me personally I'm unfortunately nowhere near a Gen 3 upgrade. |
@vves I would also like to thank you for your support; perhaps the best is if you can send us the swagger data (presumably a yaml file?); however alternatively perhaps you can expose one of your hubs via a port forwarding, or vpn connection, so we can talk to it ourselves? |
Thanks for reaching out @vves I do Dev work on the HomeAssistant side and have been working with @andrewfg closely over the last couple of months (great to see collaboration between ‘competing’ platforms) As Andrew suggested if we could get access to the api doco in some alternative way that would be great. While offline development without a hub isn’t great (blindly hoping your code logic works) our only other option is to hope another ‘developer’ gets a gen3 hub installed - I couldn’t afford to spring for new blinds just to help the community out 😂 Again really appreciate the response - I’d personally tried to reach out to Hunter Douglas and had no response. Not sure if you have seen some of our other conversations but one thing that would be insanely helpful is the definition of your shade capability and types. Everything we currently have is community driven and relies solely on someone providing their json output to us. Even just a listing of shades and their capability type would be great for aesthetics but really would be great if some of our ‘guesses’ on capability were substantiated. |
My preference is to use the Gateway Swagger endpoint as the HD dev team is still making minor tweaks to the API. That said, I'll provide static swagger doc here but first I need to cull some private data from swagger. Expect an update by end-of-week. |
@vves many thanks for your support; much appreciated. |
@jlaur as "homework" for this integration, you may want to take a look at the tado binding which uses Swagger CodeGen to parse the Swagger 'yaml' file and auto- generate the respective Java classes for the DTOs and the web service. |
FWIW a Home Assistant user kindly did a screen capture from their Gen 3 hub (see below). It is interesting, but I am still hoping that @vves can post us the yaml file :) @jlaur of immediate interest to me are the following..
|
@andrewfg Even better - I am putting a 'Getting Started with Integrations' document together. A deep integration only needs around 10 total calls. The rest of the API is for internal Hunter Douglas tools and will end up being redacted in the future. |
@vves please don't feel that you need to make that extra effort on account of us. We already have full integration for Gen 1 and Gen 2 hubs so (dare I say it) we are beyond the 'getting started' phase. All we need from you is the extra information concerning how Gen3 hubs differ from Gen 1/2 ones..
Yes. In fact our integration for the Gen 1/2 hubs goes a bit deeper than ten. We use seventeen calls as you can see from the HDPowerViewWebTargets.java code. Albeit some of these are GET/PUT variations on the same uri. |
@andrewfg there are some significant changes in Gen3 as all shade information is now live and event driven instead of requiring polling for shade and scene state. It's these changes that I want to highlight and provide best practices for all integrations - not just openHAB. Coming soon! |
@jlaur the first Pull Request #13352 is ready for your review. This PR changes the architecture by splitting "hub facing" classes into base abstract classes that define the interfaces, and specific implementation classes for V1. This PR should function exaclty as the existing binding since only the code structure has changed. EDIT: I had originally opened #13339 but I abandoned it and closed it because I made a real mess of the GIT commits history. And replaced it with #13352 instead |
@jlaur I made the attached PDF to as an aid to navigate the files in my two PR's .. |
@jlaur a few days ago you asked if we need a completely new Bridge class; the answer is no because when its And if HDPowerViewWebTargetsV1 has been chosen, it in turn produces and consumes ShadeDataV1, ShadePositionV1, SceneV1, and ScheduledEventV1 class instances; whereas if HDPowerViewWebTargetsV3 has been chosen it produces and consumes the respective xxxV3 class instances. |
@andrewfg - Gen 1/2 vs. Gen 3 detection IMHO should happen during discovery or manual bridge configuration, so that after this point there is no need for pinging any bridge to discover own identity. I haven't had much time prioritized for this project lately, so I'll be back with input for some of the other open questions. |
I think choosing during discovery would make sense; actually discovery code is something that I am 'reserving' to do in PR #3.. Nevertheless I am NOT convinced about your suggestion about manual configuration: why ask the user to configure something manually when it can easily be done automatically? Perhaps the compromise solution is a kind of auto-manual approach; if the config param is initially empty, then we ping the hubs and set the config param accordingly? After that the user can (if they have any reason to do so) force override it. By the way, apropos config params: as you know there are currently two params 'polling interval' and 'hard refresh interval' which I am using as follows..
No problemo :) |
Not much to discuss. Discovery is only for managed things, so for file-based configuration you need to be able to provide this information manually. That's also why there is properties/configuration interoperability (can dig up documentation and/or examples later). For sure I don't want my hub "pinged" on each initialization just because I'm not using managed things. |
I don't understand your resistance. The 'ping' is just the get firmare request. And that IS done every time that you initialise the thing. So in reality we are not doing anything different than what happens already. EDIT: this is the code..
|
That's a valid point. But if the firmware request is different between Gen 1/2 and Gen 3, then it will still make one unneeded call for Gen 3 (from code above), unless I'm missing something? |
^ |
So where do you see the problem in storing the hub/gateway type during discovery/manual configuration as opposed to having to rediscover it on each initialization? |
I recommend using mdns (bonjour) to check for Gen3 availability. The Primary gateway and REST interface - if a Gen3 Gateway is online - will always be found at 'powerview-g3.local'. |
I simply don't want to force the user to do manual configuration. |
Thanks @vves for the tip; actually I was indeed planning to do something like that since we already use MDNS to discover Gen 1/2 hubs on '_powerview._tcp.local'. PS my prior discussion with @jlaur is not really about using MDNS or not; but rather about using hard config settings (his suggestion) as opposed to auto-config (mine, and apparently yours too..) |
@jlaur proposed solution as follows..
|
@andrewfg We are on the same page. First time auto-discovery using both mdns addresses is user friendly as (from our experience) most users are not aware of Gen1/2/3 differences or even what generation they have - and then cache what you found and configured for future use to reduce your integrations boot time. |
This is exactly what I proposed, so now it seems all three of us are on the same page. :-) Perhaps the confusion was from the fact that we have both managed and unmanaged things in openHAB. Managed things can be created from discovery and would then according to my proposal be "born" with the Gen version cached. For unmanaged things (configured in files) manual configuration is needed in order for them to have the same information at hand. Thereby they will also have reduced boot time/initialization phase, which was my point. And on top of that, there will be no differences in the logic after creation, so the implementation will be simpler. @andrewfg - we can consider the lack of configured "Gen" version configuration as Gen 1/2. That will provide the backwards compatibility and eliminate any need for detecting Gen version for already configured things. We could simply use 0 for Gen 1/2 and 1 for Gen 3, unless there would ever be any need to distinguish between Gen 1 and 2, @vves? |
Yes. Ok.
Not quite. I suggest the following
|
@jlaur as far as I recall we recently had an issue (see below) where the functionality needed to be different for Generation 1 than Generation 2. And I think you also had something about scene groups not being supported in Generation 1? So we could consider re-factoring those PR's to handle those Gen 1 / 2 differences based on https://community.openhab.org/t/hd-powerview-binding-issue-openhab-3-3-0/136921 |
@andrewfg - the only two differences known so far:
For both of these differences I'm not sure if it's worth distinguishing API version, although we could get a small optimization for Gen 2 out of directly using But that leads back to what should be persisted in bridge config. We have currently two different API's and three different hardware units (Gen 1, Gen 2 and Gen 3). Especially for the Gen 3 unit, the API is likely to evolve over time, so software version might be significant to look at also. However, since software version can change after creation of bridge, we can probably only reliably detect major API version at time of discovery. So we might have to dynamically handle minor differences in API versions after that, for example based on firmware version detected. Now, the question is if we should link configuration directly to hardware version, or if we simply need to have incremental API major version numbering in order to abstract the hardware completely? Gen 4 might be based on the same API as Gen 3, so I'm not sure we'll have benefit of storing "3", and we have no guarantee we'll be able to detect actual hardware version rather than API version. Like "1" and "2" would pretty much refer to the same API version, namely current API. |
^ Probably the users are more aware of what hardware version they have. So the primary user decision point is if they have a gen1, gen2, or gen3 hardware. For that reason I think the config param should reflect the hardware too. The secondary (and for the user hidden) point is the api version that runs on that hardware. As far as I am concerned the gen1 and gen2 hardware both support the V1 api. Albeit with some minor nuances, as you hilighted above. And the gen3 hub supports the V3 api. So to summarise we have three hub hardware versions, (representated by an integer config param), that map to two api versions.
|
@jlaur some background on my two PRs..
So if you are reviewing my code, you may consider whether to bother with looking at PR 1 or whether to jump straight into PR 2. Its up to you.. FYI I myself am already running the full PR 2 code on my V1 operative system. |
@vves just wondering what is the status concerning your revised document? In particular the api call for the binding to register itself with the gateway. |
This issue is created as a placeholder for gathering information about the new PowerView Gen 3 and discussing how to support it. I have requested API documentation from Hunter Douglas. They have responded: "This information has not been released to the general public yet, we are working in beta with selected groups as needed."
What we know so far:
Open questions:
Sources:
The text was updated successfully, but these errors were encountered: