* #72 changed use units of measure for the twinguard humidity and purity values all other QuantityTypes in bindingcode are fine * #77 changed title of binding to Bosch Smart Home Replaced the SHC occurrences with Smart Home, to avoid technical names. * #62 Try to restart long polling when it fails before taking the thing offline * #62 Run subscribe request on a new thread instead of using the thread of the previous long polling http request This might be the reason why the subscribe request does never finish or finishes with a timeout * #74 Run the whole long polling response handling in a new thread to not get timeout from HTTP client * #74 Schedule initial access when long polling fails unexpected We need to try to reconnect again and again (with 15 seconds between the requests) as the controller may have been restarted (update, manual restart,...). This is already done by the initial access, so I reuse that mechanism. * Use direct formatting of logger.trace instead of String.format * #76 Use i18n texts instead of raw translations for status messages about failed long polling * #76 Use logger.debug instead of logger.warn for long poll error as it is handled now * #78 defined api-version each HTTP request will use now the defined "avp-version=2.1" for request to the smart home controller * logging bundle version removed the old static version string access OSGi bundle version information instead * #75 improved initial access - added isOnline check and isAccessPossible now failed in case HTTPStatus is an error - same HTTPStatus check done to all blocking send() request calls - using i18n strings for all bridge updateStatus calls - skipped the 'controller' and use only 'Bosch Smart Home' in descriptions - added more @Nullable annotations * added newline Signed-off-by: Gerd Zanker <gerd.zanker@web.de> Signed-off-by: Christian Oeing <christian.oeing@slashgames.org>
2.0 KiB
For Developers
Build
To only build the Bosch Smart Home binding code execute
mvn -pl :org.openhab.binding.boschshc install
Execute
After compiling a new org.openhab.binding.boschshc.jar
copy it into the addons
folder of your openHAB test instance.
For the first time the jar is loaded automatically as a bundle.
It should also be reloaded automatically when the jar changed.
To reload the bundle manually you need to execute in the openhab console:
bundle:update "openHAB Add-ons :: Bundles :: Bosch Smart Home Binding"
or get the ID and update the bundle using the ID:
bundle:list
-> Get ID for "openHAB Add-ons :: Bundles :: Bosch Smart Home Binding"
bundle:update <ID>
Debugging
To get debug output and traces of the Bosch Smart Home binding code
add the following lines into userdata/etc/log4j2.xml
Loggers XML section.
<!-- Bosch SHC for debugging -->
<Logger level="TRACE" name="org.openhab.binding.boschshc"/>
or use the openhab console to change the log level
log:set TRACE org.openhab.binding.boschshc
Pairing and Certificates
We need secured and paired connection from the openHAB binding instance to the Bosch Smart Home Controller (SHC).
Read more about the pairing process in register a new client to the bosch smart home controller
A precondition for the secured connection to the Bosch SHC is a self singed key + certificate. The key + certificate will be created and stored with the public Bosch SHC certificates in a Java Key store (jks).
The public certificates files are from https://github.com/BoschSmartHome/bosch-shc-api-docs/tree/master/best_practice.
File copies stored in src/main/resource
.
All three certificates and the key will be used for the HTTPS connection between this openHAB binding and the Bosch SHC.
During pairing the openHAB binding will exchange the self singed certificate with SHC.