2021-01-17 22:20:20 +01:00
# For Developers
## Build
2021-02-13 21:09:30 +01:00
To only build the Bosch Smart Home binding code execute
2021-01-17 22:20:20 +01:00
2022-12-07 21:09:32 +01:00
```shell
mvn -pl :org.openhab.binding.boschshc install
```
2021-01-17 22:20:20 +01:00
## Execute
2022-12-07 21:09:32 +01:00
After compiling a new ``org.openhab.binding.boschshc.jar``
2021-01-17 22:20:20 +01:00
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.
2021-02-13 21:09:30 +01:00
To reload the bundle manually you need to execute in the openhab console:
2021-01-17 22:20:20 +01:00
2022-12-07 21:09:32 +01:00
```shell
bundle:update "openHAB Add-ons :: Bundles :: Bosch Smart Home Binding"
```
2021-01-17 22:20:20 +01:00
or get the ID and update the bundle using the ID:
2022-12-07 21:09:32 +01:00
```shell
bundle:list
```
-> Get ID for "openHAB Add-ons :: Bundles :: Bosch Smart Home Binding"
```shell
bundle:update < ID >
```
2021-01-17 22:20:20 +01:00
## Debugging
2021-02-13 21:09:30 +01:00
To get debug output and traces of the Bosch Smart Home binding code
2022-12-07 21:09:32 +01:00
add the following lines into ``userdata/etc/log4j2.xml`` Loggers XML section.
2021-01-17 22:20:20 +01:00
2022-12-07 21:09:32 +01:00
```xml
<!-- Bosch SHC for debugging -->
< Logger level = "TRACE" name = "org.openhab.binding.boschshc" / >
```
2021-01-17 22:20:20 +01:00
2021-02-13 21:09:30 +01:00
or use the openhab console to change the log level
2022-12-07 21:09:32 +01:00
```shell
log:set TRACE org.openhab.binding.boschshc
```
2021-02-13 21:09:30 +01:00
2021-01-17 22:20:20 +01:00
## Pairing and Certificates
2021-02-13 21:09:30 +01:00
We need secured and paired connection from the openHAB binding instance to the Bosch Smart Home Controller (SHC).
2021-01-17 22:20:20 +01:00
Read more about the pairing process in [register a new client to the bosch smart home controller ](https://github.com/BoschSmartHome/bosch-shc-api-docs/tree/master/postman#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).
2022-12-07 21:09:32 +01:00
The public certificates files are from < https: / / github . com / BoschSmartHome / bosch-shc-api-docs / tree / master / best_practice > .
2021-01-17 22:20:20 +01:00
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.
2022-12-07 21:09:32 +01:00
During pairing the openHAB binding will exchange the self singed certificate with SHC.