ioBroker / AdapterRequests

This Place is used to track the status of new Adapter-Requests.
248 stars 36 forks source link

Bosch Smart Home Adapter (not Home Connect) #126

Closed saepfle closed 4 years ago

saepfle commented 5 years ago

Hello,

Adapter for Bosch Smart Home is ready: https://github.com/holomekc/ioBroker.bshb

This ioBroker adapter request is about the brand and products from Bosch "Smart Home Systems": grafik This is mostly cloud independete which means all logic is in their central gateway. The central gateway can speak 868 mhz (Homematic and Homematic IP protocol - but the firmware is blocking original Homematic products), Zigbee and more.

And Bosch "Home Connect" which is for e.g. kitchens and wash mashines from the the Bosch company BSH. For Home Connect already exists an adapter request: https://github.com/ioBroker/AdapterRequests/issues/26

Bosch Smart Home also started to integrate some of the "Home Connect" products.

Feedback here in the Forum: https://forum.iobroker.net/topic/25370/aufruf-bosch-smart-home

steckenpferd commented 5 years ago

The official API is since 01.05.2019 online https://developer.bosch.com/web/bosch-thermotechnology-device-api/tryout/product/api

TA2k commented 4 years ago

looks similar like the bsh home connnect when I get an account with a device I can maybe port the bsh to bosch smart home

holomekc commented 4 years ago

I created a small java application which simulates the smartphone application. I checked what the android app does and basically it works like this:

Benefit:

Issue:

The bigest issue is that I am currently on vacation and I have no access to my pc...

If you are interested in this please remind me in about 2-3 weeks. I hope I can find some time to upload it.

Apollon77 commented 4 years ago

Java or JavaScript?

holomekc commented 4 years ago

It is in Java because it was easier for me to create the same behavior as the android app. If i have some time i can check how much effort it is to do the same via javascript / nodejs

Apollon77 commented 4 years ago

I think if you can provide the code this also could hel a developer

holomekc commented 4 years ago

Hi everybody I did some testing and I could get the pairing done in node js (via openssl)

I wrote one small library which is simply creating a bridge to Bosch Smart Home Controller and I also started with a ioBroker adapter to check how it all comes together. It is all far from done but I just want to give you some feedback.

Here some images:

image

image

Tasks

I am quite bussy at the moment so I am pretty sure it will take some more time. Especially the polling part makes me nuts because the request which I could make so far are very costly.

btw. nothing on github yet. I will change that as soon as possible and when it is not in a messy state

steckenpferd commented 4 years ago

If you need some test persons release it on github ;-)

laest commented 4 years ago

Hi everybody I did some testing and I could get the pairing done in node js (via openssl)

I wrote one small library which is simply creating a bridge to Bosch Smart Home Controller and I also started with a ioBroker adapter to check how it all comes together. It is all far from done but I just want to give you some feedback.

Here some images:

image

image

Tasks

  • [x] Pairing with Bosch Smart Home Controller
  • [x] Extract devices / channels / states
  • [x] Get and set values
  • [ ] check ioBroker installation on windows due to openssl dependency
  • [ ] check polling options (poll all again. Or use json-rpc which seems to be part. Could not figure out yet how it is working)
  • [ ] improve iobroker adapter by removing all template stuff which I forgot
  • [ ] cleanup and remove some mess I made
  • [ ] everything else I forgot

I am quite bussy at the moment so I am pretty sure it will take some more time. Especially the polling part makes me nuts because the request which I could make so far are very costly.

btw. nothing on github yet. I will change that as soon as possible and when it is not in a messy state

Wow, looks pretty promising to me! I also got a Bosch Smart Home Heating with an 7000iW heating, the SmartControll Thermostat (with integrated Gateway) as well as the Smart Home Thermostats.

Can you make any predictions about the ability of your script to manipulate the "is-temperature" of the room where the thermostat is installed? One of my thermostats is in a not optimal spot so the measured is-temperature is way higher than the actual room temperature which drives me crazy since there is no way to control the temperature in a good way. As far as I know there is still no option to set an offset to the thermostat. So I actually have to set the target-temperature of the thermostat to max (30°C) in order to get the living room heated.

Would be awesome if it would be possible to measure the room temperature via an external sensor an overwrite the thermostat's "is-temperature" value :)

Keep up the good work! If you need another tester, just message me ;)

holomekc commented 4 years ago

Puhhh it took some time but here we go: https://github.com/holomekc/ioBroker.bshb

I was able to get the json-rpc stuff running. For me it looks good. But I could need some feedback if there are issues with other devices and so on.

When you configure the adapter you need to make sure that the directory for client certificate directory is created and has the corresponding access rights for iobroker user.

If you have any questions regarding configuration please let me know

@laest For temperature you can use: ...roomClimateControl_hz_x.RoomClimateControl.setpointTemperature or setpointTemperatureForLevelComfort. And btw you can specify an offset in the smartphone app -3.5 - +3.5

laest commented 4 years ago

And btw you can specify an offset in the smartphone app -3.5 - +3.5

Okay interesting. I am using the Bosch EasyControll App V. 2.6.0 on iOS (German App Store) but did not find any offset-settings for the Smart Thermostats in the app. The only offset I can set is for the SmartControl Room Thermostat that also is the Bridge/Hub in my case (-2.0°C - +2.0°C). Can you show me a screenshot or explain the exact spot in the app, where you can specify the offset for the Thermostats? Would be awesome :)

Thanks for sharing you script, will try to install it as soon as I got some time and give feedback ;)

holomekc commented 4 years ago

@laest Morning I think I got your question wrong sorry. Is temperature and offset is shown here: image I could not change any of these values. Not sure yet why. I think is temperature cannot be change but at least the offset value should be configurable

Edit: I thought you are using the Bosch Smart Home App. In this app it is located here: Verwaltung -> Geräte -> Heizkörper-Thermostate -><Geräte> ->Angleichung einstellen

laest commented 4 years ago

Good Morning!

ah that would have been to easy if you could just manipulate the thermostats is-temperature with the value of another temperature-sensor :D Anyway, if the offset would be configurable that would be a good first fix for my problem :)

I am not 100% sure, but I think the Bosch Smart Home app does not work with the EasyControl Thermostat since I don't use the Bosch Smart Home Bridge. The EasyControl has a built-in Bridge/Hub that just works for the Heating-Products of Bosch's Smart Home sensors. But I will give the Smart Home App a try :) Thanks for your investigations!

PS: This is the EasyControl CT200 I am talking about: https://www.amazon.de/BOSCH-EasyControl-Touch-Screen-Anbindung-7736701341/dp/B07BRQ4TXY/ref=asc_df_B07BRQ4TXY/?tag=googshopde-21&linkCode=df0&hvadid=308536284447&hvpos=1o1&hvnetw=g&hvrand=16690339762318913128&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9042671&hvtargid=pla-556464873810&psc=1&th=1&psc=1&tag=&ref=&adgrpid=62082040955&hvpone=&hvptwo=&hvadid=308536284447&hvpos=1o1&hvnetw=g&hvrand=16690339762318913128&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9042671&hvtargid=pla-556464873810

holomekc commented 4 years ago

@laest Ah ok. Well I think this is something different. I took a quick look to EasyControl App and the authentication looks different (OIDC). Does the app requires an internet connection or is it enough when you are connected to your local network (to test that you need to tell your router to disconnect from internet)

You do not have the Bosch Smart Home Controller which is in the picture at the top of this adapter request? I would recommend to contact me via email otherwise we would spam this issue

holomekc commented 4 years ago

I destroyed something yesterday at night. I will upload a fix soon

steckenpferd commented 4 years ago

Puhhh it took some time but here we go: https://github.com/holomekc/ioBroker.bshb

I was able to get the json-rpc stuff running. For me it looks good. But I could need some feedback if there are issues with other devices and so on.

When you configure the adapter you need to make sure that the directory for client certificate directory is created and has the corresponding access rights for iobroker user.

If you have any questions regarding configuration please let me know

@laest For temperature you can use: ...roomClimateControl_hz_x.RoomClimateControl.setpointTemperature or setpointTemperatureForLevelComfort. And btw you can specify an offset in the smartphone app -3.5 - +3.5

FYI - I created a Topic in the IoBroker Forum https://forum.iobroker.net/topic/25370/aufruf-bosch-smart-home

steckenpferd commented 4 years ago

https://github.com/holomekc/ioBroker.bshb the link is not working anymore?

holomekc commented 4 years ago

Hi. Leider musste ich auf Anfrage den Adapter wieder entfernen.

Am 01.10.2019 um 07:22 schrieb steckenpferd notifications@github.com:

 https://github.com/holomekc/ioBroker.bshb the link is not working anymore?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

Franklin67 commented 4 years ago

Hmm, warum musste der den entfernt werden? Wer hat denn was dagegen gehabt?

holomekc commented 4 years ago

Hallo zusammen. Sorry für die späte Meldung. Ich versuche es mal kurz zusammenzufassen. Ich habe einen Hinweis per Email erhalten, dass die AGBs der Bosch Smart Home App Reverse Engineering ausschließen. Diese Klausel konnte ich finden und obwohl es dieses Jahr Änderungen zur Lockerung von Reverse Engineering gab bin ich mir nicht sicher, ob ich das Recht habe den Adapter zu veröffentlichen.

Daher habe ich schnell alles offline genommen und versucht/versuche das zu klären. Bei Bosch selber kann ich nicht die passenden Kontakte erreichen (es gab nur eine ausweichende Nachricht und dann nichts mehr), Recherche im Internet ist sich nicht einig ob es nach neuem Recht in den AGBs verboten werden kann bzw. melden/wollen die Anwälte die ich finden konnte sich nicht mit dem Thema auseinandersetzen.

Bei der Home Connect app gibt es eine solche Klausel nicht. Ich würde den Adapter gerne veröffentlichen, da die Software von Bosch an sich nicht schlecht ist, aber so gut wie nichts erlaubt. Ich mag das nur nicht mit Ungewissheit tun.

Für Feedback, Hinweise bin ich natürlich dankbar.

Franklin67 commented 4 years ago

hallo,

vielen Dak erst einmal für die Info, warum du den Adapter aus dem Netz genommen hast. Ich kann das gut verstehen.

Wenn Bosch damit Probleme hat verstehe ich aber nicht so ganz warum es dann die Seite developer.bosch.com gibt? Kennst du die? Dort gibt es auch eine E-Mail Adresse an die man sich wenden kann. Hier die Adresse

support.iot.ecosystem@bosch.com

Aber vielleicht kennst du das ja schon alles Wenn nicht wäre das vielleicht noch mal ein Ansatzpukt.

Gruß, Frank

-------- Ursprüngliche Nachricht -------- Von: holomekc notifications@github.com Datum: 13.10.19 21:44 (GMT+01:00) An: ioBroker/AdapterRequests AdapterRequests@noreply.github.com Cc: Franklin67 frankw_67@hotmail.com, Comment comment@noreply.github.com Betreff: Re: [ioBroker/AdapterRequests] Bosch Smart Home Adapter (not Home Connect) (#126)

Hallo zusammen. Sorry für die späte Meldung. Ich versuche es mal kurz zusammenzufassen. Ich habe einen Hinweis per Email erhalten, dass die AGBs der Bosch Smart Home App Reverse Engineering ausschließen. Diese Klausel konnte ich finden und obwohl es dieses Jahr Änderungen zur Lockerung von Reverse Engineering gab bin ich mir nicht sicher, ob ich das Recht habe den Adapter zu veröffentlichen.

Daher habe ich schnell alles offline genommen und versucht/versuche das zu klären. Bei Bosch selber kann ich nicht die passenden Kontakte erreichen (es gab nur eine ausweichende Nachricht und dann nichts mehr), Recherche im Internet ist sich nicht einig ob es nach neuem Recht in den AGBs verboten werden kann bzw. melden/wollen die Anwälte die ich finden konnte sich nicht mit dem Thema auseinandersetzen.

Bei der Home Connect app gibt es eine solche Klausel nicht. Ich würde den Adapter gerne veröffentlichen, da die Software von Bosch an sich nicht schlecht ist, aber so gut wie nichts erlaubt. Ich mag das nur nicht mit Ungewissheit tun.

Für Feedback, Hinweise bin ich natürlich dankbar.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/ioBroker/AdapterRequests/issues/126?email_source=notifications&email_token=AEU67R4X7UZPX2PPQ63KXG3QON3CLA5CNFSM4F7VYLN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBC6KWY#issuecomment-541451611, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEU67R65JDDGBQCTPAMXWOLQON3CLANCNFSM4F7VYLNQ.

Thomas-Doc commented 4 years ago

Hallo zusammen, soweit Bosch Smart home auf open source basiert, ist der diesbezügliche Code von Bosch veröffentlicht (sowohl für den Hub als auch für die smart-home-app).

"Hier können Sie die Quellcodes der freien Softwarekomponenten im Smart Home Controller herunterladen"

Außerdem kann man auch einen leeren USB-Stick an den Controller anschließen, dann spuckt er auch einiges aus.

https://www.bosch-smarthome.com/de/de/open-source-software

Außerdem sollte man sich vielleicht doch mit der Bosch iot-Suite und hier speziell mit der Gateway Software beschäftigen. Dafür gibt es auch eine freie Lizenz. Diese Software ist wiederum Grundlage für zahlreiche andere Protokolle (und Hersteller), u.a. eben auch bosch home connect (was hier weniger interessiert). Das Ganze übersteigt aber bei weitem meine Kenntnisse.

https://www.bosch-iot-suite.com/service/gateway-software/

Hingewiesen sei noch auf eine Bosch-Ankündigung, für bosch smart home eine SDK "in Kürze" zur Verfügung zu stellen "coming soon". https://developer.bosch.com/smart-home/sdk

Sicher ist es unzulässig, die Bosch-Software durch reverse engeneering komplett einfach zu kopieren. Aber die bloße Analyse der Schnittstelle zur eigenständigen Programmierung einer eigenen Software sehe ich eigentlich als unkritisch. Sonst gäbe die Offenlegung der Schnittstellen auch keinen Sinn (siehe auch Beitrag von Franklin67). Microsoft musste ja auch seine Windows-Schnittstellen offenlegen, damit andere Software dafür entwickeln können. Wobei natürlich das Betriebssystem Windows mit Bosch nicht ganz vergleichbar ist ...

Grüße Thomas

jogibear9988 commented 4 years ago

Lt. Wikipedia:

Viele Firmen untersagen das Reverse Engineering ihrer Produkte durch entsprechende Lizenzbedingungen. Die Analyse von Protokollen ist davon rechtlich nicht betroffen, weil dabei die Software selbst gar nicht Gegenstand der Untersuchung ist

Thomas-Doc commented 4 years ago

So sehe ich das auch.

Die Passage in den AGB heißt: Es ist Ihnen nicht gestattet, die App zu kopieren, zu verteilen oder anderweitig Dritten zur Verfügung zu stellen (einschließlich der Vermietung, Verpachtung, Leihgabe oder Unterlizenzierung) oder auf eine sonstige, dem bzw. den jeweiligen Urhebern vorbehaltene Weise zu verwenden. Sie sind nicht berechtigt, den Programmcode der App oder Teile hiervon zu verändern, rückwärts zu entwickeln (Reverse Engineering), zu dekompilieren, zu disassemblieren oder den Quellcode auf andere Weise festzustellen sowie abgeleitete Werke hiervon zu erstellen. Ausgenommen von dieser Einschränkung sind OSS-Komponenten, deren Lizenz verlangt, dass der Endkunde diese für den eigenen Gebrauch oder für Debugging-Zwecke rückwärts entwickeln darf. Die Bestimmungen der §§ 69d, 69e UrhG bleiben hiervon jedoch unberührt.

Durch die Analyse des Netzwerkverkehrs wird aber m.E. der Code der App gar nicht berührt. Die AGBs können und sollen verhindern, dass jemand fremdes Eigentum kopiert oder in seinem Projekt verwertet. Das alles geschieht bei einer Analyse des Netzwerkverkehrs nicht.

Das UrHG ist hier ganz eindeutig auf unserer Seite (§ 69d und insbesondere § 69e, Ausführungen zur Analyse zur Herstellung der Interoperabilität mit anderen Programmen, hier also iobroker):

(1) Die Zustimmung des Rechtsinhabers ist nicht erforderlich, wenn die Vervielfältigung des Codes oder die Übersetzung der Codeform im Sinne des § 69c Nr. 1 und 2 unerlässlich ist, um die erforderlichen Informationen zur Herstellung der Interoperabilität eines unabhängig geschaffenen Computerprogramms mit anderen Programmen zu erhalten, sofern folgende Bedingungen erfüllt sind:

  1. Die Handlungen werden von dem Lizenznehmer oder von einer anderen zur Verwendung eines Vervielfältigungsstücks des Programms berechtigten Person oder in deren Namen von einer hierzu ermächtigten Person vorgenommen;
  2. die für die Herstellung der Interoperabilität notwendigen Informationen sind für die in Nummer 1 genannten Personen noch nicht ohne weiteres zugänglich gemacht;
  3. die Handlungen beschränken sich auf die Teile des ursprünglichen Programms, die zur Herstellung der Interoperabilität notwendig sind.
Apollon77 commented 4 years ago

Also mit so einer Argumentation könnte man ja mal die E-Mail beantworten ... Mit der Bitte doch mal die exakte Grundlage des "Verbots" bzw der Anwendung der Reverse-Engineering Regeln auf die Analyse des Netzwerkverkehrs und NICHT der App darzulegen

Thomas-Doc commented 4 years ago

Die Bestimmungen der §§ 69 c bis 69 e im Urheberrechtgesetz sind eindeutig (bitte selbst nachlesen!) und auch Bosch erklärt in den AGB ausdrücklich, dieses Recht anzuerkennen (also die Entwicklung von Fremdprogrammen und die hierzu notwendige Analyse des Netzverkehrs zuzulassen). Ich halte es deshalb für völlig ausgeschlossen, dass ein Konzern wie Bosch offiziell interveniert. Das kann sich Bosch gar nicht erlauben. Das wohl eher private Vorpreschen einzelner Bosch-Mitarbeiter kann - je nach Formulierung - durchaus den Straftatbestand der Nötigung erfüllen, wenn über den bloßen (falschen) Hinweis auf das Verbot der Entwicklung eigener Kommunikationsprogramme hinaus auch noch mit Strafbarkeit oder Strafverfolgung gedroht wird.

holomekc commented 4 years ago

Hallo. Danke für die vielen Informationen! Ich werde mir das am Wochenende noch einmal im Detail durchlesen.

Ich habe Bosch auch noch einmal über die oben genannte Email kontaktiert. Die erste Antwort war sehr enthusiastisch: thanks for contacting Bosch,

This is great, thanks for wanting to make a contribution and get the permissions, it's exactly what we want for the Bosch developer community!

I would recommend to contact Smart Home product group directly, and if you are not able to get feedback, you can reply to this email again or question on the developer community, and we will see if we can still help:

Dann habe ich erklärt dass ich das bereits getan habe und nur eine ausweichende Antwort erhalten habe. Dann kam nicht viel mehr als: sorry about that.

Auf meine letzte Mail kam bisher leider nichts mehr.

Thomas-Doc commented 4 years ago

Du hast jedenfalls alles richtig gemacht und gut dokumentiert, dass du aktiv den Kontakt mit der Fa. Bosch gesucht hast. Da kann eigentlich nichts passieren. Da die Fa. Bosch zudem in ihren AGB ausdrücklich auf die §§ 69 d, e UrhG hinweist, die ja die Entwicklung eigener Software inklusive einer Schnittstelle zur Bosch-Software explizit erlaubt, so sehe ich hier keinerlei weitere Probleme. Was sollte Bosch dir auch sonst noch schreiben? Sie freuen sich, wenn Entwickler eigene Software zur Bosch-Software schreiben, damit ist doch alles gesagt.

Interessant wäre allenfalls noch, wer der Urheber der ersten Email war (Bosch-Mitarbeiter? sonstiger "guter Freund"?). Falls diese erste Email eine offizielle Mail war, die rechtliche Konsequenzen androhte, so sollte man diese vielleicht auch noch beantworten mit dem Hinweis auf die Bestimmungen der (neugefassten) § 69 c-e UrhG. Das Ganze würde ich aber sehr gelassen sehen, da die Neufassung des UrhG genau diesen Fall der Entwicklung eigener Software im Zusammenspiel mit vorhandener Software explizit regelt. Die erste Mail wird m.E. eher von einem juristisch völlig Ungebildeten stammen, der sich wichtig machen wollte.

holomekc commented 4 years ago

Hallo zusammen. Sorry das ich mich jetzt erst melde. Es gab eine offizielle Bestätigung. Ich darf das Programm nun online stellen.

Die github Projekte sind wieder verfügbar: https://github.com/holomekc/bosch-smart-home-bridge & https://github.com/holomekc/ioBroker.bshb

Den Rest mache ich gleich auch noch. Danke für die Hilfe!

schlabbe86 commented 4 years ago

Hallo, erst mal ein großes Dankeschön für deine Mühen. Könntest du vlt. noch für einen Noob wie mich erklären, was ich bei Client certificate directory eintragen muss? Danke im Voraus Viele Grüße

holomekc commented 4 years ago

Hi. Ich schaue mal das ich das in der Anwendung selber besser beschreibe.

Der Wert muss ein existierender Ordner sein der von ioBroker erreichbar ist. Bspw. /home/iobroker/certs

Den Ordner certs aber vorher erstellen: cd /home/iobroker mkdir certs sudo chown iobroker:iobroker certs sudo chmod 744 certs Oder sogar: sudo chmod 700 certs

Ich hoffe das hilft weiter. Falls du windows anstelle von linux verwendest dann noch einmal bitte anschreiben, denn dann müssen wir das anders machen.

saepfle commented 4 years ago

Da Adapter Live kann der Issue geschlossen werden.

Weiter gehts würde ich sagen im Forum: https://forum.iobroker.net/topic/25370/aufruf-bosch-smart-home

@holomekc Wenn du mal mehr Zeit hast - der wäre noch super https://github.com/ioBroker/AdapterRequests/issues/63

lab-at-nohl commented 4 years ago

Hi, ich wollte Dir gratulieren. Natürlich hast du nur geltendes Recht genutzt, deine Handlung war vom Urheberrecht gar nicht betroffen. Da du die App wohl nicht dekompiliert hattest, sondern einfach nur den (vorgesehenen) Ablauf zwischen den Geräten beobachtet hast, warst du noch unter der Schwelle von § 69e UrhG -- hat Bosch gut erkannt. Allerdings sind diese Fälle der Erkundung von Schnittstellen echt selten. Und natürlich gratuliere ich auch Bosch, deren Produkte für mich jetzt kaufbar werden.

Alwiz79 commented 4 years ago

Bosch scheint grad etwas umzudenken. Kürzlich wurde die API ganz offiziell veröffentlicht: https://github.com/BoschSmartHome