-
-
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
[Netatmo][WIP] OH3 revamp - step 1 #9486
Conversation
Signed-off-by: clinique <[email protected]>
7119afd
to
54453ef
Compare
Signed-off-by: clinique <[email protected]>
Signed-off-by: clinique <[email protected]>
Signed-off-by: clinique <[email protected]>
The amount of changes is massive, this will require a lot of courage to start a review. |
I agree. Swagger removal had loads of impacts but will help keeping the binding in sync with the API and also lightened a lot the size of the binding. |
@clinique, I noticed the channels for Min/Max channels for week and month have been removed from the documentation. I hope this is accidental, and are actually there. This was functionality that existed in both the OH 1 and OH 2 bindings. |
@robnielsen : dedicated min and max channels have been removed and replace by the ability to add channels with configuration : |
And for the ones still using files? |
Configurable channels is possible with things files.
|
@clinique, when you are ready for somebody to test, let me know. I have indoor, outdoor, and rain modules. |
@robnielsen : you'll find latest testable version here. First notable change you'll identify, there is no more any "API Bridge" thing. Netatmo Account setting is done at binding level. |
Hi, I made a smoke test as well (based on the version linked by @clinique . Michael |
I don't want to use the API, if there isn't an API bridge anymore how do I configure it via the file? |
The same way it is done for other binding configurations (coming to my mind while writing Network binding). |
@demichve jar updated, you can download and test. |
@mdillmann Hi, thank you for updating it. Now I can build and start it again. @clinique But there is already a next new bug which causes that I can't continue. My doorbell and Presence camera is found on discovery / scan, but no home thing anymore. And the Bridge is missing at these two things. When I create the home thing manually (and by finding the home id via dev.netatmo.com) there is a crash: "java.lang.ClassCastException: class org.openhab.binding.netatmo.internal.api.dto.NAHomeWeather cannot be cast to class org.openhab.binding.netatmo.internal.api.dto |
Discovery section of the binding changed a lot, but looking at the code it seems missing to retrieve home-topology for security. Thus it creates modules like NOC but not the proper NAHome object for security. Meanwhile I changed the discovery as well to skip rooms which have no energy-equipment (rooms are currently only used for Therm/Valve, security-modules like NDB and NOC only need the proper home-object) |
Signed-off-by: Gaël L'hopital <[email protected]>
Correction on handling measurable channels Favorite weather stations detections enhanced. Signed-off-by: Gaël L'hopital <[email protected]>
Hi, thank you for your answers and fixes. Now the discovery was completely broken in my environment. ;-) Users which just have a Presence camera got an (empty) NAHomeWeather thing and not a NAHomeSecurity and the Presence camera was also not discovered anymore. The problem is NAHomeDeserializer. I fixed/improved that with this commit within my branch, see below. But I think the concept of parsing exactly 1 NAHome object isn't working. What is with users which have both Weather and Security or also Energy things? It isn't correct to just parse 1 home object in that case. NAHomeDeserializer should also get improved to check more generic for configured things, maybe give all things a category (Weather, Energy and Security) and check by this category instead of checking specific types within NAHomeDeserializer. |
Thanks for your updates @Novanic , I take that in account. FYI in Netatmo API houses holding Weather stations are really dinstinct from those holding Security module and those containing Energy module (in my own API answer, I've got 4 distinct houses). So global behaviour seems good while I agree with your modifications. |
Signed-off-by: Gaël L'hopital <[email protected]>
@clinique Ah, ok, when the API delivers separated homes, the approach may work. Now I checked the Presence support before porting the doorbell support and there seems to be more bugs. :-( The channels of the Presence aren't working. I see the NAWelcome object within the Debugger but only "type", "id", "name" and "setupDate" is set. "vpnUrl" for example is not set which causes that for example the live picture url can't get determined. The version seems still to be very unstable/uncompleted, I think it's very risky to do a complete rewrite of the binding without any automated tests and without the ability to test with all devices. I think there are many bug fixes left. :-( |
Hi @clinique, just found some time to compile the latest version and do a quick test. Unfortunately my weather modules are not discovered anymore. In the debug log I see a call |
@clinique Could you also please cherry-pick the thing-action for NAroom from the other branch ? https://github.com/clinique/openhab-addons/pull/5/commits/91f5458af971fa48d8f7e9733ea7d2e70ecbf831 Should apply (besides the two logger statements in AuthenticationApi.java that I incorrectly put into that commit) |
Normally not, favorites are discovered in a second pass, so you should not be hurt :-/ On my side, I have one favorite and it works well :-/ |
Come on @Novanic , we were completely stuck with the previous version based on swagger lib. This PR is used since many months by many people, including me and still the only left known bug one week ago was with the token refresh system. I had to drop all unit tests as they were targetted to previous architecture of the binding. I've started to rewrite some in the past days. I've tested as much as I could with the modules I own (even bought an home coach yesterday to proceed further). With your help, altogether, we'll achieve this. Thanks. |
Signed-off-by: Gaël L'hopital <[email protected]>
@Novanic : done.
|
@clinique, when I try
|
Hi @clinique, for thing-actions I am to blame, not @Novanic :-) Main problem currently is, that I can't build (same as @robnielsen) when I use your branch due to the same karaf conflicts. I always need to apply manually/cherry pick from this PR to my base which builds happyly on OH-snapshot. |
Ok, let me try to clear this issue with mvn:install. First of all, I need to reproduce it. |
This PR replaces PR openhab#9486 Signed-off-by: Gaël L'hopital <[email protected]>
Thanks @clinique for the effort ! |
This PR replaces PR openhab#9486 Signed-off-by: Gaël L'hopital <[email protected]>
This PR replaces PR openhab#9486 Signed-off-by: Gaël L'hopital <[email protected]>
This PR replaces PR openhab#9486 Signed-off-by: Gaël L'hopital <[email protected]> Signed-off-by: clinique <[email protected]>
This PR replaces PR openhab#9486 Signed-off-by: Gaël L'hopital <[email protected]> Signed-off-by: clinique <[email protected]>
This rework of the Netatmo binding was initiated in order to remove external dependencies (swagger, okio, okhttp...), it ended as a complete rework of it.
Latest testable version here.