Hello
I am trying to get some data from the Tado unofficial API to get the operation, insideTemp and setPointTemp.
I have found I can use the URL:
https://my.tado.com/mobile/1.9/getCurrentState?password=XXXXX&username=XXXXX@XXXXX.XXX
However using sendHttpGetRequest() every other response is unauthorized - so I found I have to use curl:
var response = executeCommandLine("curl@@https://my.tado.com/mobile/1.9/getCurrentState?password=XXXXX&username=XXXXX@XXXXX.XXX@@-H@@Referer: https://my.tado.com/", 5000)
This fetches the string every time without a fault. However the response also contains the execution times so I can’t use the JSONPATH transformation:
var Mode = transform("JSONPATH", "$.operation", response)
var Temp = transform("JSONPATH", "$.insideTemp", response)
var SetTemp = transform("JSONPATH", "$.setPointTemp", response)
Here is a typical response:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 635 100 635 0 0 3602 0 --:--:-- --:--:-- --:--:-- 3587
{"success":true,"operation":"HOME","preheating":false,"preheatingTargetOperation":null,"autoOperation":"HOME","operationTrigger":"SYSTEM","insideTemp":20.29,"setPointTemp":20,"controlPhase":"STEADY","currentUserPrivacyEnabled":false,"currentUserGeoStale":null,"deviceUpdating":false,"homeId":XXXXX,"heatingOn":false,"internetGatewayType":"GW02","internetGatewayConnected":true,"heatingMuscleType":"BU01","heatingMuscleConnected":true,"insideTemperatureSensorType":"RU01","insideTemperatureSensorConnected":true,"settingsEnabled":true,"fallbackOperation":false,"helpUrl":"https://support.tado.com/hc/","pendingDeviceInstallation":false}