Will there be a "Bosch Smart Home" binding?

I have a basic setup now that works for my in-wall light switches and also the smart plug:

https://www.bosch-smarthome.com/uk/en/products/smart-system-solutions/smart-plug

What remains to do is the pairing. Iā€™m still using the pre-paired keys I have from using the nodeJS implementation.

Once I have that running, I would appreciate if somebody could test what I have been doing so far :slight_smile:

Code is here:

2 Likes

I have 5 Bosch Twinguard smoke detectors.

https://www.bosch-smarthome.com/de/de/shop?url=produkte/smart-system-solutions/twinguard

Give me a shout when it makes sense to give it a try.

I actually donā€™t have a Twinguard, so I donā€™t think I will be able to add that to the binding myself.

The API description has almost nothing about it either.

Hi Stefan, here you should find all information you need to implement the twinguard:
https://apidocs.bosch-smarthome.com/local/

Just open the dropdown ā€˜Select a definitionā€™ and select Twinguard.

Hope that helps!

2 Likes

This is excellent, thank you very much for sharing @hxmelab.

I just started a new job today, so I wonā€™t have terribly much time to work on this binding until Christmas or so, but Iā€™ll keep on working on it, I promise.

Seeing that the API is so well documented now and having the OpenHap Binding in progress makes me really want to buy more of these cool Bosch Smart Home devices too :slight_smile:

Maybe Iā€™ll get a TwinGuard myself :stuck_out_tongue:

4 Likes

I have a ioBroker running on an raspberrypi, so far the bosch-smart-home-bridge adapter for ioBroker works fine. But i would like to use openHab instead of ioBroker, so i hope there will be a binding soon :slight_smile:

2 Likes

Just to keep you guys in the loop: itā€™s getting there:

Have to work a bit more on the initial bootstrapping, but that is also getting there, hopefully. This is for:

  • In-wall switches
  • TwinGuard
  • Door/Window sensor
  • Soon: Motion sensor
3 Likes

Good work @skaestle! :smiley: - Additional radiator thermostat would be great! If you need testing, let me know!

Great progress @skaestle! When do you estimate the availability of this solution as binding? Wait with a lot of tension for the integration of my sensors and radiator thermostats :slight_smile:

P.S. I would also be happy to assist with the tests ā€¦ :nerd_face:

Itā€™s hard to anticipate, I have most of the code for registering OpenHab with the Bosch Smart Home Controller, but it does not work yet. Might be just a quick fix, or very painful, itā€™s really hard to anticipate :slight_smile:

Just today there was an update of the Controller, which again broke something (little), but thatā€™s another thing I need to fix before you can test it. Will let you know how it goes :slight_smile:

4 Likes

that sounds like a challenge (homely solvable with a quick fix) :crazy_face:
In any case, thank you for the constant interim status - that gives hopeā€¦

Stay healthy and I wish us all a success with this binding :wave:

1 Like

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?

3 Likes

@skaestle Iā€™m very interested. Please let me know if you need somebody to test things :wink: I have some inwall-rollershutters installed.

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.

2 Likes

Oh wow!

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?

Cheers,
Stefan

Steps to register a new client and create the JKS keystore to use it in Bosch SHC add-on:

  • Follow the steps in the BoschSmatHome Github repository to ā€œRegister a New Client to the Bosch Smart Home Controllerā€
  • 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.

4 Likes

Cool, thatā€™s a really nice explanation of the process, better than the one I was using myself :slight_smile:

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 ā€¦

Thanks @GerdZanker for the step-by-step instructions :slight_smile:

I created a small shell script to generate the keystore from the certificates and the private key. Hope it saves some other devs some time:

#!/bin/bash

keystoreName=openHAB.jks

read -p "Please enter a password for the new keystore: " keystorePassword

echo "-----------------------"

# Combine client certificate and private key into PKCS 12 keystore
openssl pkcs12 -export -in "./client-cert.pem" -inkey "./client-key.pem" -name shc_client -out $keystoreName -passout pass:$keystorePassword

echo "Created keystore $keystoreName from client certificate and private key"

echo "-----------------------"

# Import Smart Home certificates
keytool -keystore $keystoreName -storepass $keystorePassword -noprompt -import -alias shc_issuing_ca -file "./Smart Home Controller Issuing CA.pem"
keytool -keystore $keystoreName -storepass $keystorePassword -noprompt -import -alias shc_productive_root_ca -file "./Smart Home Controller Productive Root CA.pem"

echo "-----------------------"

# List certificates
keytool -keystore $keystoreName -storepass $keystorePassword -list

echo "-----------------------"

read -p "Press Enter to exit"
3 Likes

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 :slight_smile: I just have to get warm again with Java :wink:

Hi Christian!

Thanks for being brave enough to try this out already :slight_smile:
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 :slight_smile: 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!)

Happy to help :slight_smile: