tadoº is a german based company which offers a smart thermostat solution. They also have an API to control this solution.
This Sprint Boot kotlin application showscases how you can use the tado API v2 which is available at https://my.tado.com/api/v2.
When you start the application, it runs a scheduled task which every minute prints information like the current heating power, current temperature and current humidity for every room (zone) in your home.
Generated kotlin client for the tado API.
It uses the openapi-generator-maven-plugin
to generate the client code based on the
tado OpenAPI spec maintained here https://github.com/kritsel/tado-openapispec-v2/
Spring boot application which executes some tado API calls upon application start-up.
It also implements the OAuth 2.0 authentication mechanism to authenticate to the API.
You need to have a tado account which is linked to a tado Home.
The username and password of this account need to be supplied as arguments to the program, as they are needed to authenticate to the API.
On Windows the spring-boot.run.jvmArguments
part needs to be surrounded by quotes
Replace the placeholders with your account details.
mvn -pl tado-demo -am spring-boot:run -D"spring-boot.run.jvmArguments"="-Dtado.username=<username> -Dtado.password=<password>"
Replace the placeholders with your account details.
mvn -pl tado-demo -am spring-boot:run -Dspring-boot.run.jvmArguments="-Dtado.username=<username> -Dtado.password=<password>"
Navigate to tado-demo > src > main > kotlin > tadodemo > Application and run
the main
method.
The first run will be unsuccessful as you will be missing some necessary arguments. Edit the run configuration and add this part to the VM options (replace the placeholders with your account details):
-Dtado.username=<username> -Dtado.password=<password>
This application is developed on a company managed Windows machine, where the company manages the certificates in the Windows keystore.
This set-up requires that some specific system properties need to be set to instruct the program to use the Windows truststore instead of the Java one.
When you happen to be in a similar situation, you can add this extra JVM argument:
-DuseWindowsTrustStore=true