-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[siemenshvac] Initial contribution - interface (OZW672) #14263
base: main
Are you sure you want to change the base?
Conversation
dc1076f
to
737f2f3
Compare
Hello, Not sure to understand the error message on the build. |
Hope the rebuild helps, don't see anything obvious wrong with the POM etc. You might want to look at the readme.md and the i18n files as they seem to be just the placeholders. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Partial review
...ain/java/org/openhab/binding/siemenshvac/internal/Metadata/SiemensHvacMetadataDataPoint.java
Outdated
Show resolved
Hide resolved
...ain/java/org/openhab/binding/siemenshvac/internal/Metadata/SiemensHvacMetadataDataPoint.java
Outdated
Show resolved
Hide resolved
...ain/java/org/openhab/binding/siemenshvac/internal/Metadata/SiemensHvacMetadataDataPoint.java
Outdated
Show resolved
Hide resolved
...ain/java/org/openhab/binding/siemenshvac/internal/Metadata/SiemensHvacMetadataDataPoint.java
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.siemenshvac/src/main/resources/OH-INF/binding/binding.xml
Outdated
Show resolved
Hide resolved
...ain/java/org/openhab/binding/siemenshvac/internal/type/SiemensHvacThingTypeProviderImpl.java
Outdated
Show resolved
Hide resolved
...n/java/org/openhab/binding/siemenshvac/internal/type/SiemensHvacChannelTypeProviderImpl.java
Outdated
Show resolved
Hide resolved
...a/org/openhab/binding/siemenshvac/internal/type/SiemensHvacChannelGroupTypeProviderImpl.java
Outdated
Show resolved
Hide resolved
...c/main/java/org/openhab/binding/siemenshvac/internal/network/SiemensHvacRequestListener.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Partial review.
Hello Gael, Thanks for your review. Laurent. |
bc727ff
to
66445a4
Compare
I also manage to fix the build. Laurent. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Second review
...c/main/java/org/openhab/binding/siemenshvac/internal/Metadata/RuntimeTypeAdapterFactory.java
Outdated
Show resolved
Hide resolved
...ain/java/org/openhab/binding/siemenshvac/internal/Metadata/SiemensHvacMetadataDataPoint.java
Outdated
Show resolved
Hide resolved
...ain/java/org/openhab/binding/siemenshvac/internal/Metadata/SiemensHvacMetadataDataPoint.java
Outdated
Show resolved
Hide resolved
...ain/java/org/openhab/binding/siemenshvac/internal/Metadata/SiemensHvacMetadataDataPoint.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/openhab/binding/siemenshvac/internal/network/SiemensHvacConnectorImpl.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/openhab/binding/siemenshvac/internal/network/SiemensHvacConnectorImpl.java
Outdated
Show resolved
Hide resolved
...a/org/openhab/binding/siemenshvac/internal/type/SiemensHvacChannelGroupTypeProviderImpl.java
Outdated
Show resolved
Hide resolved
...n/java/org/openhab/binding/siemenshvac/internal/type/SiemensHvacChannelTypeProviderImpl.java
Outdated
Show resolved
Hide resolved
.../org.openhab.binding.siemenshvac/src/main/resources/OH-INF/i18n/siemenshvac_xx_XX.properties
Outdated
Show resolved
Hide resolved
2b83f89
to
0c8f02f
Compare
0c8f02f
to
da5d4b8
Compare
@lo92fr Amazing binding - thank you ! I tested it with an OZW672.01 connected to a RVP350 and the only issue I found was that Enumeration channels are auto-discovered as Number - for example: |
Hello Freichen, Not sure what are the good way to fix this. |
Hello Gaël, @clinique : I'm not sure what are the current state of this pull request. |
81d5e7d
to
992ebe1
Compare
Hello, Can some one can give an update about the integration of this pull request in main stream. Thanks, |
I've commit a fix for this, should be working as excepted now. |
Hello Gaël, Hello Freichen, Any update on this ? Laurent. |
Signed-off-by: Laurent ARNAL <laurent@clae.net>
Hello Jacob (@jlaur ), I commit a bunch of fixes this morning about your last review. Laurent. |
Signed-off-by: Laurent ARNAL <laurent@clae.net>
Signed-off-by: Laurent ARNAL <laurent@clae.net>
Hello @freichen, I don't know if you see my last message (#14263 (comment)). Thanks, |
Signed-off-by: Laurent ARNAL <laurent@clae.net>
result = result.replaceAll("\\p{M}", ""); | ||
} | ||
|
||
result = result.replaceAll("[^a-zA-Z0-9_]", "_").toLowerCase(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might have made a mistake in a previous suggestion based on the logic being replaced rather than the naming convention:
result = result.replaceAll("[^a-zA-Z0-9_]", "_").toLowerCase(); | |
result = result.replaceAll("[^a-zA-Z0-9-]", "-").toLowerCase(); |
(not sure if "-" needs to be escaped, i.e. "[^a-zA-Z0-9\-]")
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> | ||
|
||
<!-- Bridge Thing Type --> | ||
<bridge-type id="ozw672"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking about #14263 (comment) on my way to work and to provide some additional context. I then came also to think about the bridge type id. If the binding also works with OZW772.x, or might be brought to work with that as well, probably this id is too specialized. I'm thinking about two possible scenarios:
- OZW772.x is very different code-wise and a new bridge type would have to be introduced.
- OZW772.x is very similar code-wise, and it can be tweaked to work with the same bridge type, perhaps with some different configuration.
If actually it is expected to be similar, it would be strange to create a bridge type ozw672
for a OZW772.
My proposal in this case would be to rename to a more generic name, perhaps the common denominator "ozw"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really sure on that, as I don't have documentation about Ozw772, and don't have access to this physical device to do some test. But I except that the code should be identical between the two devices.
Today, in the binding, the only specific part is in bridge initialization / discovery where we test the modelName, and initialize an OZW672. Notes that in current configuration, we will not currently support Ozw772 because we don't have an SiemensHvacOZW772BridgeThingHandler override the SiemensHvacBridgeBaseThingHandler, and so we have no way to init the addon for this device.
So I think we can go two way :
- Scenario 1: Keep like this for first version of the addon.
- Scenario 2: extends the discovering and bridge initialization to handle OZW772, adding an SiemensHvacOZW772BridgeThingHandler override, and see if someone has the device to do some testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It sounds like you would expect OZW772 to be similar rather than different. The implementation and support can always be changed, but the modelling cannot without breaking backwards compatibility.
So I would propose to keep the current implementation, but generalize the bridge type id: ozw672
→ ozw
. I think in the long run it will then be easier to add support for OZW772 with less duplication (i.e. separate bridge definitions, handlers, etc.). It won't hurt to also rename SiemensHvacOZW772BridgeThingHandler
etc., but strictly it's not necessary as it can always be refactored without breaking anything.
...src/main/java/org/openhab/binding/siemenshvac/internal/network/SiemensHvacConnectorImpl.java
Outdated
Show resolved
Hide resolved
...java/org/openhab/binding/siemenshvac/internal/handler/SiemensHvacBridgeBaseThingHandler.java
Outdated
Show resolved
Hide resolved
offline.waiting-bridge-initialization = Waiting bridge initialization, reading metadata in background | ||
|
||
offline.baseurl-mandatory = baseUrl is mandatory on configuration ! | ||
offline.error-gateway-init = Error occurs during gateway initialization: %s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
offline.error-gateway-init = Error occurs during gateway initialization: %s | |
offline.error-gateway-init = Error occurred during gateway initialization: {0} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix on next commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One space too much slipped in between the words "occurred" and "during".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix on next commit
bundles/org.openhab.binding.siemenshvac/src/main/resources/OH-INF/i18n/siemenshvac.properties
Outdated
Show resolved
Hide resolved
...vac/src/main/java/org/openhab/binding/siemenshvac/internal/network/SiemensHvacConnector.java
Outdated
Show resolved
Hide resolved
.../java/org/openhab/binding/siemenshvac/internal/metadata/SiemensHvacMetadataRegistryImpl.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
LocalDateTime parsedDate = LocalDateTime.parse(value.getAsString(), | ||
formatterBuilder.toFormatter(Locale.FRENCH)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this product only for the French market, or why do you need hardcoded French Locale here? Can you configure the OZW webserver language - if yes, how will such a change affect this method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it's a mistake, the product is international.
And you're right, changing the language on gateway side will influenced the result.
Mainly on formatter like this one "EEEE, d. LLLL yyyy HH:mm[:ss]" where the first part EEEE will be localized regarding the language setting of the gateway.
I take a look on how i can Handle this a better way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've modify the code of TypeConverter to add the Local information as a parameter of fromBinding function.
This information is take from the MetadataRegistry which already contains the current user used to connect the API.
I handle there the language retrivial, and locale initialization.
Current gateway is supporting a bunch of different language: English,Deutsch,Francais,Italiano,Nederlands,Polski,Cesky,Magyar,Espanol,Dansk,Svenska,Suomi,Portugues,Russkij,Turkce,Slovensky;
I will certainly need to do more test to verify that formatter are ok for all this language.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, that's a lot of languages to support. This reminds me of writing an integration for the old Miele@home Homebus API where essential information was provided as localized strings. It was a tremendous work to support that for the 4-5 languages supported by the gateway.
You might want to add to the README that depending on the configured language, there might be some issues which can then be reported (I suppose). You might want to prioritize to fully test and support at least a few of those languages besides French, for example English and German (considering the home of both Siemens and openHAB 😄).
Hello @jlaur, I do a first pass on your review of May 15. I still have to review the point about unit handling (your comment "For UoM support you would need to add dimension, i.e."). Laurent. |
Signed-off-by: Laurent ARNAL <laurent@clae.net>
Signed-off-by: Laurent ARNAL <laurent@clae.net>
fix locale initialization handling review dimension initialization for NumberType Fix TimeOfDay converter Signed-off-by: Laurent ARNAL <laurent@clae.net>
Hello @jlaur, I push the modification to handle UoM this morning. The addon now support the following dimensions on number: Laurent. |
Signed-off-by: Laurent ARNAL <laurent@clae.net>
|
||
Mainly, it will first discover the gateway. | ||
Currently test was done with the OZW672.x series. | ||
No test was conduct using the OZW772.x series, the code will currently not handing initialization of OZW772 gateway. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No test was conduct using the OZW772.x series, the code will currently not handing initialization of OZW772 gateway. | |
No test was conducted using the OZW772.x series, the code will currently not handle initialization of an OZW772 gateway. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix on next commit
Mainly, it will first discover the gateway. | ||
Currently test was done with the OZW672.x series. | ||
No test was conduct using the OZW772.x series, the code will currently not handing initialization of OZW772 gateway. | ||
You can request support to the community forum is you have the gateway model and want it to be supported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can request support to the community forum is you have the gateway model and want it to be supported. | |
You can request support in the community forum, if you have the gateway model and want it to be supported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix on next commit
No worries, family is first priority. I will try to catch up in the next days.
Awesome! |
Signed-off-by: Laurent ARNAL <laurent@clae.net>
fix initialization code to support OZW772 Signed-off-by: Laurent ARNAL <laurent@clae.net>
Signed-off-by: Laurent ARNAL <laurent@clae.net>
Title
Add a binding for siemens Hvac interface (OZW672)
Description
This pull request is about adding a binding for siemens Hvac interface OZW672 (https://hit.sbt.siemens.com/RWD/app.aspx?rc=FR&lang=fr&module=Catalog&action=ShowProduct&key=BPZ:OZW672.01)
The OZW672 is a ethernet bridge for the LSB bus of Hvac device.
It implements a web interface that enable reading and setting of differents hvac parameters.
OZW672 also support a REST api.
This binding use this REST api to integrate OZW672 into openhab.
Testing
The binding support autodiscovery of the OZW672 interface using upnp.
After a few minutes, you should see the OZW672 bridge into your Inbox.
If not, power off and up OZW672.
You can also add the bridge manually.
After adding the bridge, you will have to go to bridge parameters, setting the password for the OZW672, and then restart openhab.
On restart, OZW672 will do autodiscovery phase from you installation during initialization.
This can be a little long : ~2 to 5 minutes depending of your installation.
After OZW672 bridge come up again, go back again to the "things" page of openhab.
Click on the add button, then click on the "siemensHvac" binding, and on the next page click on the "scan" button.
After a few second, openhab should list all you devices connect to the LSB bus.
If you have a simple home Hvac installation, it will generally find only one device.
Most common name for this device are something like "RVS41xxx.yyy".
This device represents the main controler inside your Hvac device.
After you add this RVS to your system, you can go into it, and Channels tabs will expose all your hvac settings.
Structure of the Channels should be the same as the one on the LCD screen of your Hvac device.
You may have a lot more of items that on your LCD screen because the device exposte all items, even the one for "specialist" guys.