Bosch Smart Home

Thanks for the quick reply and effort.

I want to use the Universal Switch Iike the Philips Hue Dimmer Switch which each button can be configured under Homekit for functions such as adding group of lights/switches for on/off or triggering particular scene.

Will it be easier to handle if I add all the components I want to control to HA? (Philips Hue and Shelly, which has HA integration) and do all my triggering setting in the HA instead of using Homekit. Thank you.

Hi Guys,
Just bought a bunch of Bosch kit.
I was assuming I would have to write some integration code for myself. Was really please to come across your hard work!!
Trying to add this component into Home Assistant.

When I go to
Configuration>Integrations>Add Integration>Bosch SHC> SHC authentication parameters
It asks for the “host” and then fails with the error

Logger: custom_components.bosch_shc.config_flow
Source: custom_components/bosch_shc/config_flow.py:66 
Integration: Bosch SHC ([documentation](https://www.home-assistant.io/integrations/bosch_shc)) 
First occurred: 20:56:58 (1 occurrences) 
Last logged: 20:56:58

Error looking up mDNS entry

I have the following in the configuration.yaml

bosch_shc:
  ip_address: '10.0.0.80'
  ssl_certificate: '/path/ha_clientcert.pem'
  ssl_key: '/path/ha_clientcert.key'
  name: 'Bosch SHC HUB'
pip show boschshcpy
Name: boschshcpy
Version: 0.1.18.dev4
Summary: Bosch Smart Home Controller API Python Library
Home-page: https://github.com/tschamm/boschshcpy
Author: Clemens-Alexander Brust, Thomas Schamm
Author-email: [email protected], [email protected]
License: bsd-3-clause
Location: /usr/lib/python3.8/site-packages
Requires: requests, getmac, zeroconf
Required-by:

I don’t understand mDNS much but even more I don’t understand why it would not simply use the IP address I gave it (is there some way to force that?).

If it makes a difference this is running in a docker container.

Is there something I can do to try and fix this?

Thanks & Regards
Ben

Hi Ben,
mDSN really makes some problems… We currently needed either mDNS or getmac to determine a unique identifier for the SHC. Neither SHC serial nor mac address are communicated via the API.

I assume docker prevents mDNS to acquire the network information. One solution would be to enable mDNS through docker. The “fallback” is using getmac. You can test if the fallback works with a simple example, which should report the mac_address of the SHC given it’s IP. If you get this running inside the docker, the custom_component should work fine:

$ python3                                                                                                                                                            (17-12 22:47)
Python 3.8.4 (default, Jul 14 2020, 15:19:59) 
[Clang 10.0.0 (clang-1000.10.44.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import getmac
>>> getmac.get_mac_address(ip='192.168.xx.xx')
'00:aa:bb:cc:dd:ee'

If this also does not work inside docker, I assume we need an optional parameter which serves as a unique identifier. If someone has a better idea, I would be very happy :slight_smile:
Best, Thomas

Didn’t HA present a new way but mDNS just with the current release last Sunday?

Hi Thomas,
Thanks for the very fast reply.
I gave that a try and it failed to return anything.
I will see if I can have a play with things and get it working and look into if this is something to do with being inside docker.
One question that occurs to me though. If this is just to get a “unique identifier” or even if it really does need to be the Mac address would it not be possible to simply specify this directly in the config?

>>> getmac.get_mac_address(ip='10.0.0.80')
>>> 

Thanks again, at least I know where to start looking. Will let you know how I get on.

Ben

I did not found any reference to an mDNS alternative quickly reading through the release notes.

@ninjabenji: discovery integration gives some advice to use mDNS within docker environment.

When running Home Assistant Core in a Docker container command line option --net=host or the compose file equivalent network_mode: host must be used to put it on the host’s network, otherwise mDNS and UPnP will not work.

Hey Ben, before you try too much, try restarting the Bosch SHC, after that my HA did discover my SHC itself and with zeroconf it did work with no problem.

I will give both of those a try. Thanks

They mentioned it in a talk within the conference. I did recognize it, since they more or less directly mentioned it with the same issues we have here with mDNS. I will try to find where I got it from tomorrow.

The restart failed to fix (but for the effort always worth a try). I will play around with docker tomorrow and see where I get to.

Ok, I checked back what I heard there about mdns. But after reading it I don’t know if this really is relevant to this case.

MULTICAST NAME RESOLUTION

Release 5 uses systemd-resolved to provide DNS services on the operating system level and acts as a multicast name resolution responder. Besides, mDNS systemd-resolved also supports the LLMNR hostname resolution protocol. In practice, this makes discovering a new installation of Home Assistant OS working in most situations, either using http://homeassistant.local:8123 or http://homeassistant:8123 .

It’s working nicely now. Thanks.
The issue was the mDNS not working in docker as you sugested. I struggled to get it working with --networking=host but then found out host networking is not available on Mac OS (I was testing this on my laptop). I moved over to testing on a Linux machine and with the --network=host enabled it started working fine.
Thanks for the help and the hard work creating this :slight_smile:

Hi i work in the Bosch Smart Home Supportcenter. If you want use our products, you will need a bridge. The best solution is, you will use Google Assistent, Siri or Alexa. Our system is closed like iOS on iPhone. But we have Partners like Apple, Google, Phillips Hue, LedVance and Amazon. This Products can trigger our system.

Hopefully this helps

I just strat on Hass World,

My Hass test setup is done a Vm base on debian + venv setup.

Hass version : Home Assistant 2020.12.1

I’m trying to set up my Bosch Smart Home Gateway.

I done about “Official” BSH how to and i manage to create a Postman user using Postman.

On Hass i manage to install this plugin, and my gateway is well discovery.

Now i’m stuck on SSL page.

Plugin speak about public and private key, but Official how to spoke about certificat an key : Who is who ?

On plugin Github dev ask for path : Directory where is store *.pem files : ok
But what is the syntaxe ?

//home/homeassistant/files.pem ?

Some help can be appriciate

Welcome @Deennoo

I assume you generated both files like this:
openssl req -x509 -nodes -days 9999 -newkey rsa:2048 -keyout client-key.pem -out client-cert.pem.

So you have now the public certificate client-cert.pem as well as the private key client-key.pem. In the bosch_shc component, you have to provide absolute path to both files, so /home/homeassistant/client-cert.pem and /home/homeassistant/client-key.pem should be correct. In Postman, those files are named with CRT file as well as KEY file.

Edit: Please do not forget to register the new client, as described here: Register a New Client to the Bosch Smart Home Controller

Regards, Thomas

thx for your answer, i’m done now, i have to use the cert file input i have created on user creation on Postman (and remove the one already set on postman exemple).

1 Like

Hi Thomas,

Thank you very much for your efford! I could follow your instructions to the point where i have to configure the Bosch SHC. Unfortunately this device is not available/discovered although i did youd custom_component installation. Any hints?

best regards

Erik

Hi Erik,
welcome! What’s the kind of setup you’re running your home assistant system? If you use docker, please make sure that you have set the --network=host option set (see comments 134 – 140).

Have you tried adding the Bosch SHC device manually (Settings -> Integration -> Add Integration -> Bosch SHC)? If so, what kind of error do you get?

Regards, Thomas

I´m running it on a pi 3. If i try adding it manually i can´t find Bosch SHC in the list.

Thank you Thomas,

with your help i got it to work. I did not create the \config\custom_components\bosch_shc subdirectory so the device was not installed. I also tried to use an encrypted key like suggested on the bosch git hub which does not work! For this integrations the key must not be encrypted!

Regards, Erik

1 Like