This integration should only use a config flow and config entries.
However, this should only result in a change where you enter your credentials. Just copy the credential information from configuration.yaml to the config flow. The key pair still needs to be stored on the HA-Device, like you assumed. For registering a new key pair, you can either use Postman, or the provided register_client.py script.
OK, thanks for the hint. Postman is running now, and I also created the certifcation files…
But where do I have to import the files postman_collection_json and and postman_environment_json as explained in Step one of the api documentation? Trying to import these files ends with the error “format not recognized”.
Thanks for your help!
Changing brightness should work now. If you disconnect your light physically (e.g. cut the power), SHC should report status Unavailable or Undefined. At least that is what’s happening when I disconnect Hue lights.
Can you check the response either in Postman or with apisummary.py? I would guess the 503 error should be listed there, too.
Hi Toben,
basically you have to follow these steps to add Bosch Smart Home devices to HA.
Install bosch_shc custom component
Generate a certificate/key pair
Register a new client on the SHC device
Configure bosch_shc integration in HA.
1.) To install bosch_shc as custom component, inside your HA configuration directory create a new folder called custom_components. This is the folder that Home Assistant will look at when looking for custom code. Install the custom component there:
Just copy paste the content of the boschshc-hass/bosch_shc folder, available on github, in your config/custom_components directory. As example, you will get the entity.py file in the following path: /config/custom_components/bosch_shc/entity.py.
Afterwards, restart HomeAssistant.
2.) + 3.) Follow the guide for setting up a new certificate/key pair and for registering this certificate on the Bosch SHC step by step. On the first look, this looks a bit complicated, but in the end it’s pretty straight-forward.
As a result, you obtained a generated certificate/key pair which is registered for accessing and controlling the SHC.
4.) For configuration of bosch_shc custom component, follow the steps provided in the Readme.md. During configuration, you have to enter the obtained credentials from step 2.) by providing the path to your public and private keypair of your SSL certificate.
Even if i’m looking at Home-assistant for months it would have been because of your post that i finally created an account to say Thank you for your work.
I was looking for months/years about which solution to select for my thermostat valve.
At some point i was going to be resign and choose between netatmo or Tadoo which both need Cloud connectivity to work all day long…
With your integration i understand that i could buy the bosch bridge and my thermostats valve, denied access to the cloud for the bridge once my setup is on place and it will use local polling through my home-assistant. It seems like a pretty good plan for me as bosch thermostats valve is lower in price than netatmo/tadoo.
I hope to see soon this integration on the core of HA .
I’m going to dig now a bit further within Bosch product line to be 100% sure that “This is the way !”.
today should be the day to switch from using HomeKit to Integrate Bosch components to HA, to your integration.
I got my certificate registered, the custom component in it’s place and after a reboot HA did not discover my SHC automatically, but I could install the integration and config started with asking me for the host. I entered the ip of my shc, but than I always get "HI Thomas, today should be the day to switch from using HomeKit to Integrate Bosch components to HA, to your integration. I got my certificate registered, the custom component in it’s place and after a reboot HA did not discover my SHC automatically, but I could install the integration and config started with asking me for the host.
I entered the ip of my shc, but than I always get “Failed to connect” as a result back. I don’t even get to the part, where I can enter my certificate.
What can I do?
Thank you!
Update: I moved my new HA instance to its’s final place in our Network configuration and now the SHC gets discovered automatically. So it looks like the switch I use in my offices is not configured in an ideal way.
But maybe I can add a comment to your config guide.
I believe it could be helpful to give a little more detail on how to provide the SSL Certificate Public and private key.
What is expected to be entered here: the actual key?
The URL to the key files?
If the later, where to I store them best on my HA instance? And how would the URI look like in that case?
Sorry for bugging you about this, but what might be totally clear to you, is actually puzzling guys like me, with less experience in this matter…
Hope you understand that I mean just well with my comment here, hope to contribute in this way to an integration for many more to use in the future… I will now start figure it out myself…
Cheers,
Kai
PS. Maybe a screenshot with realistic mock data could help a lot… Not sure if I will be able to provide it, as I don’t know when i am correct before submit (and probably won’t get a chance to come back to that step…)
The problem with autodiscovery is, if zeroconf is not available, we won’t get unique information from the SHC. There is an open feature request to provide unique info like e.g. mac address also via Rest API, then the ZeroConf neccessity could be removed.
Good point! What is needed here is the actual path to the certificate keypair on the device running HA. You can place such data in the config directory of your HA instance.
So as an example:
SSL certificate public key: /config/keystore/shc-cert.pem
I thought so myself - but for some reason I always get an “unexpeted error”.
Now I even renamed my keypair to fit EXACTLY your example and put a keystore folder directly into my config folder…
With the same key I can read out component information etc. using postman. So pretty sure the registering my cert did work in general. Do I have to adapt the cert file to the Bosch format?
"-----BEGIN CERTIFICATE-----\r followed by the 2048 bit self signed certificate and \r-----END CERTIFICATE-----"
So using the “/r” marker?
Thanks Thomas!
Update: nope, the \r /r pair is not the solution, that leads to a direct error message “invalid authentication” → I am a little lost what could be the issue here…
I used an encrypted key file as suggested by Bosch when registering my cert at shc. Is this maybe part of the problem? As I am using the unencypted version within my HA instance now?
Yes I did when registering it with shc. But not in HA. So I guess I should re-Register with a not encrypted version. Right? Also something we could add to the setup gude…
I’m facing the same problem as you:
Using Postman I can add a new client to the Bosch SHC:
after fire the command I get status “201 Created” and can find the new device in the app.
After that I switch to HA and enter the path to to the client-cert.pem and key-cert.pem.
After pressing the “submit” button I get “invalid authentification”.
I’m using the same exatcly the same .pem-Files and also take care to remove all carriage returns and add “\r” and I used the
Ok, what I can tell you already: go and use the client-cert.pem and client-key.pem as you got it from openssl. Don’t do any adjustments within these files for HA. That is only needed for registering the cert via postman.
Did your HA Autodiscover your SHC automatically after the reboot? Currently this is necessary to have a chance it will work. But there are also some more issues that Tomas is currently working on.
Might be a good idea to check your logfiles to see at what point your configuration currently fails.
Best wishes,
Kai
Good news, with the latest version - it does work now for me.
Not on the first try - but after sleeping a night and tring it again - with no changes made - I got lucky and my HA accepted to integrate my Bosch SHC.
Now I have to figure out how to use it / integrate it - as there are no entities within this integration… But I am happy to look into that!
Oh and again: Thomas big thanks for your support and creating this in the first place!
Hi, I have no problems with the Cert Setup got that running, but I have a problem with adding the integration.
I added the files to custom_component and now can find it under the integration, but during the setup I get asked for a host, I enter the IP of the Bosch Smart Home, and after some loading I get “Failed to connect”.
The logs show “Error looking up mDNS entry”.
My network setup is currently so that Home Assistant and the Bosch Hub are on different subnets and VLAN’s, so I guess the mDNS call is failing. Is it possible to do this without mDNS (I don’t know much about mDNS, but is it really neccessary once I give it the IP ?).