This is a Java API for heaters with a KM200 gateway.
Heaters of theses brands may use this gateway (according to /system/brand
):
Bosch, Junkers, Buderus, Nefit, Sieger, Tata, Dakon, Elm, Boulter, Vulcano, Worcester, British Gas, IVT, Geminox, Neckar, Zeus, Milton
This package is available in Maven central:
<dependency>
<groupId>de.malkusch.km200</groupId>
<artifactId>km200</artifactId>
<version>2.1.3</version>
</dependency>
To use the API you'll need the uri, gateway password, private password and the salt.
The private password is the one you configure yourself when you connect via the app to your heater. If you forgot your password you can start the "reset internet password" flow in the menu of your heater and then reassign a new password in the app.
The gateway password is constant and needs to be read out from the menu of your heater (information/internet/login data).
I didn't include the salt, because I remember slightly reading somewhere else that Bosch might step in
legally to prevent the publication. So you will have to find the salt on your own, either by searching the internet
or decompiling the app.
The format is the hexadecimal representation (e.g. 12a0b2…
). Here's an incomplete list of projects in the internet
where you could find the salt:
Additionally I found this project which seems to use different salts, depending on the heater's brand.
With this library you can access well known endpoints of your KM200 (e.g. /gateway/DateTime
for your heater's time).
The list of endpoints varies between installations, therefore you have to explore your KM200 yourself. Some endpoints
are writeable (e.g. /gateway/DateTime
) which you can update with this library as well.
Setup a KM200 instance:
var uri = "http://192.168.0.44";
var gatewayPassword = "1234-5678-90ab-cdef";
var privatePassword = "secretExample";
var timeout = Duration.ofSeconds(5);
var salt = "1234567890aabbccddeeff11223344556677889900aabbccddeeffa0a1a2b2d3";
var km200 = new KM200(uri, timeout, gatewayPassword, privatePassword, salt);
Read and update the heater's time:
// Read the heater's time
var time = km200.queryString("/gateway/DateTime");
System.out.println(time);
// Update the heater's time
km200.update("/gateway/DateTime", LocalDateTime.now());
Explore all endpoints:
km200.endpoints().forEach(System.out::println);
Code wise this API is thread safe, it is highly recommended to not use it concurrently. Your KM200 gateway itself is not thread safe. In order to protect users from wrong usage, this API will serialize all requests, i.e. concurrent requests will happen sequentially.
The encryption and decryption was extracted from the OpenHAB project which itself is under the Eclipse Public License 2.0. For simplicity I chose to use the same license for this project.