Sorry I did not see that you are already working on a binding. For the iobroker Adapter I created a library to make the integration easier. I did the same for java.
Sorry if I knew this earlier I could have added you as contributer. Just let me know if it is already too late or if you are still interested. At least the information may help?
Thank you @skaestle for your shared Bosch SHC code. The hardest part for me was to setup the correct keystore content, but after this your add-on works well and I now make use of my Bosch SmartHomeController.
Setup of the keystore is very much incomplete in the addon. I wanted to add code that does this automatically from Java, but couldn’t get it to work so far (because of weird packaging issues with mvn)
Could you describe how you set it up? Did you do it from the command line using the keytool?
use the Java “keytool” or a UI tool like “KeyStoreExplorer” to create a JKS keystore and import the following three keystore entries. Ensure that your key AND the keystore are both using the same password.
your created key and cert from the first step
the Smart Home Controller Productive Root CA
the Smart Home Controller Issuing CA
The two Smart Home Controller CA certs are provided in the Github repo See Host Verification for more details.
Cool, that’s a really nice explanation of the process, better than the one I was using myself
In the long run, of course, it would be nice to have the addon to these steps automatically. The issue I had was that one of the Java dependencies needed (bouncycastle) didn’t play well with the Maven setup that OpenHab is using. It’s likely that I might have done something wrong, since I don’t know Maven very well.
I asked a while ago here on the forums, but nobody seemed to be able to help with this.
Perhaps one way forward is to write a small program to generate the key and register it with the SHC to test if that even works before trying to integrate it in OpenHab …
And of course thanks @skaestle for starting with the binding. I just checked out everything and try to get it to run.
A bit of background about me: I’m a software developer and recent owner of some Bosch Smart Home devices (3 shutter controls and 2 thermostats). Just starting to play around a bit with all this smart home stuff and openHAB. But it feels quite familiar with my background in web devlopment I just have to get warm again with Java
Thanks for being brave enough to try this out already
Note that currently there is neither support for shutter controls nor thermostats, and I have neither of the available at home for testing.
Now that I added support for quite some of the Bosch devices, the workflow is relatively smooth If you feel like helping a bit, I’d be more than happy to assist with writing the binding, and perhaps I’ll even have a bunch of spare cycles to do a skeleton implementation. For that, I’d probably need some of the debug output that the plugin will produce one you fire it up.
Although your devices are not supported, the plugin should be able to connect to the SHC and list all registered devices (and thanks to Gerd probably also the rooms again!)
Yeah, no problem about the missing devices, I already thought about helping with the implementation As you said with the ground work done it shouldn’t be a big problem to add some more.
Just to avoid any confusion, the most recent branch is not the one mentioned above, but this one:
And this commit is an example of the kinds of things that have to be implemented to add a new device:
If somebody understands Maven, I’d be more than glad to try to get the binding compile with bouncycastle That’d be extremely helpful to get generating the keys properly included in the binding.
Already managed to add the shutter control device to openHAB. Right now I’m trying to get the level (open ratio) of the shutter, but I guess it’s too late to get my head around it Will continue tomorrow.
I could use some tips to get a faster workflow:
How to reload a binding when openHAB is running without having to stop and start openHAB?
Is there some documentation about debugging a binding when openHAB runs in a Docker container? Or do I have to run it from an installation to be able to debug the binding? I’m using Visual Studio Code as my IDE, maybe there is a trick as well to get it to connect the debugger.
debugging a binding when openHAB runs in a Docker container
The Java debugger can be attached to running processes on remote machines. Your docker container is such a remote machine and needs to expose the decessary ports. But because openhab runs as an OSGI container it could be more difficult as usual.
Only rough tips. You can find more details on the internet:
Ah, the Internet, I heard about it
Thanks for the tip about the openHAB console. I stumbled upon it and thought it might have an option for it, but I wasn’t sure what to google for.
Getting the debugger to connect always seems to be a bit tricky, but I guess I will get it to work. Thanks for the hint about OSGI, I didn’t know openHAB uses that platform.
Got some time and motivation today as well, so I worked on the Shutter Control Handler/Thing. It already works for getting the current level and for the Up/Down commands to move the shutter up/down. I still have to review some parts and add the command for setting a specific percentage value.
I am working on a branch, so you can easily merge it into the main branch once it is in a good state. I already created a draft for a pull request if we want to discuss the code: https://github.com/stefan-kaestle/openhab2-addons/pull/2
During my work I found some things that don’t seem to be correct. Is it okay if I open some issues in GitHub for those, @skaestle? We can discuss them there one-by-one instead of in this thread. You need to enable the issue tracker in your GitHub fork first (https://softwareengineering.stackexchange.com/a/179470).
Thanks so much for the PR, I’m excited that things are moving forward and patches are flying in! Great work!
I had a look at your PR and all seems good so far, no major issues
It’s very likely that some things are not correct, so please raise them! I did enable the tracker now, so that should be a great place to collect open issues
We are currently preparing a first release, which still might take some time because we have to make some adjustments to meet the openHAB guidelines.
But if you like we could send you a custom build bundle that you could put directly in your addons folder. We would anyway like to have some more testers, so this would be a win-win