To be able to access the Bosch API via HA, you have to use the smart home controller with an integrated Eyes camera. assuming the camera is already supported by the plugin
Hey, is there any progress on this?
Would be awesome! =)
Hey @cabrust,
thank you for your effort creating the integration. I’ve tested it with some Bosch thermostats and it works mostly fine.
It is Very helpful to see the valve position, setpoint and current temperature side by side. This is something that the Bosch app is missing.
As for the bugs I’ve encountered: There seems to be no reconnect mechanism when the connection to the controller drops (it did an upgrade in my case). Also, after reconfiguring rooms or adding devices this is not reflected in HA.
A restart fixes both things.
Anyway, thanks again and keep up the good work
Hi can you show us how you bring it to work?
Sure,
I followed the official guide from Bosch to get the postman collection to work:
Once you have added the new client to the controller, you can copy that certificate and key to HA.
THen I added the custom component from cabrust’s git repo and added the following config:
bshlocal:
ip_address: 192.168.1.50
certificate: /ssl/shc-cert.pem
key: /ssl/shc-key.pem
With the IP being the IP of the Bosch controller and the cert/key referencing the files created earlier.
I try it, thanks.
I have all done in Postman. I have register a new Client to my controller and all works in Postman. Can see my termostates and rooms…
But i can not integrate the bshlocal component to Home Assistant.
I have to put this: https://github.com/cabrust/bshlocal-home-assistant
in my Custom Components Folder right?
an i add this to my Configuration.yaml
bshlocal:
ip_address: 192.168.1.50 ++change to my IP++
certificate: /ssl/shc-cert.pem
key: /ssl/shc-key.pem
What is the IP adres for then?
IP of the Bosch Smart Home Hub.
I have to put this: https://github.com/cabrust/bshlocal-home-assistant
in my Custom Components Folder right?
Yes, so the folder structure is homeassistant\custom_components\bshlocal
Did you check the logs? It should say something if the custom component is not found.
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/setup.py”, line 170, in _async_setup_component
hass, processed_config
File “/config/custom_components/bshlocal/init.py”, line 32, in async_setup
controller_ip=controller_ip, certificate=certificate, key=key
File “/usr/local/lib/python3.7/site-packages/bshlocal/session.py”, line 27, in init
self._enumerate_devices()
File “/usr/local/lib/python3.7/site-packages/bshlocal/session.py”, line 34, in _enumerate_devices
raw_devices = self._api.get_devices()
File “/usr/local/lib/python3.7/site-packages/bshlocal/api.py”, line 89, in get_devices
return self._get_api_result_or_fail(api_url, expected_element_type=“device”)
File “/usr/local/lib/python3.7/site-packages/bshlocal/api.py”, line 41, in _get_api_result_or_fail
result = self._requests_session.get(api_url, headers=headers)
File “/usr/local/lib/python3.7/site-packages/requests/sessions.py”, line 543, in get
return self.request(‘GET’, url, **kwargs)
File “/usr/local/lib/python3.7/site-packages/requests/sessions.py”, line 530, in request
resp = self.send(prep, **send_kwargs)
File “/usr/local/lib/python3.7/site-packages/requests/sessions.py”, line 643, in send
r = adapter.send(request, **kwargs)
File “/usr/local/lib/python3.7/site-packages/requests/adapters.py”, line 449, in send
timeout=timeout
File “/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py”, line 672, in urlopen
chunked=chunked,
File “/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py”, line 376, in _make_request
self._validate_conn(conn)
File “/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py”, line 994, in validate_conn
conn.connect()
File “/usr/local/lib/python3.7/site-packages/urllib3/connection.py”, line 360, in connect
ssl_context=context,
File "/usr/local/lib/python3.7/site-packages/urllib3/util/ssl.py", line 358, in ssl_wrap_socket
context.load_cert_chain(certfile, keyfile)
File “/usr/local/lib/python3.7/site-packages/urllib3/contrib/pyopenssl.py”, line 458, in load_cert_chain
self._ctx.use_certificate_chain_file(certfile)
File “/usr/local/lib/python3.7/site-packages/OpenSSL/SSL.py”, line 924, in use_certificate_chain_file
_raise_current_error()
File “/usr/local/lib/python3.7/site-packages/OpenSSL/_util.py”, line 54, in exception_from_error_queue
raise exception_type(errors)
OpenSSL.SSL.Error: [(‘PEM routines’, ‘get_name’, ‘no start line’), (‘SSL routines’, ‘use_certificate_chain_file’, ‘PEM lib’)]
Thats the Log File.
So, I assume you checked the path and file names that you provided in the config.
For postman, the certificate had to be converted to single line format. Don’t use that file but the original certificate file that openssl spat out.
Thats it i use the modified certificate files. Now all is ok. Thnaks for your Help
Hi Clemens,
I finally managed to find some spare time to merge both repositories into one. In the end, I refactored most of my work and moved it over to match yours, as I preferred your approach for setting up a connection to the SHC more.
For the time being, the hass component is still missing.
I invited you via github.
Cheers, Thomas
AFAIK, there is neither a HA component nor a publicly available API for accessing the Bosch Smart Camera. Using the SmartHome Controller, you can get access to control the light, privacy mode and notifications of the Eyes camera. At the moment, you won’t be able to access the recorded or live images.
Thanks! I accepted the invitation. The component at https://github.com/cabrust/bshlocal-home-assistant should still be more or less compatible, except for the package name
Feel free to message me, would love to have the integration and participate in testing. Have windows sensors and heating control.
HI,
do I need to do anything special to open the ports on the Bosch Controller or something else? I followed the guide, but always get no response. Tried to get public information and create a new client. Both did not work as expected. Would be glad to get some advice, as I am a bit lost.
Greetings
No you do not need to open ports. You just need to be on the same network as your controller.
Make sure you adapt the postman environment to match your information, especially host ip, admin password and so on. It is described in the link above.
Oh crap, sorry for disturbing. I checked mac addresses and found out I labled my Ikea Gateway and my Bosch Gateway wrong in my router. Thanks for the fast reply.