How to login :
curl -c cookie-jar.txt -X POST -k -i 'https://ha110-1.overkiz.com/enduser-mobile-web/enduserAPI/login' -F 'userId=MYEMAIL' -F 'userPassword=MYPASSWORD'
I use this curl request in a NodeRed ‘Exec’ node.
How to get all data :
curl -b cookie-jar.txt -X GET 'https://ha110-1.overkiz.com/enduser-mobile-web/enduserAPI/setup/devices'
This command will output a huge JSON file.
Save it locally and then open it a JSON parser, for instance: http://json.parser.online.fr/
You don’t really care about the first chapter ‘Location’, of the second chapter ‘gateways’.
What is the most important is the third chapter ‘Devices’, this where you will find everything.
Have a look at all of them. Check their name, their attributes, data to identifiy what you are looking for.
For instance you will be able to identify each ‘zone’ of your heating system, and for each zone you will find parameters for the ‘eco’ temperature, the ‘comfort’ temperature, you also find parameter for the current temperature and so on. I can not detail anymore because it will be different for each system. This is where you have to spend some time.
When you have identify which data you are looking for, use a NodeRed JSON parser node connected to the output of the following request. The most complicated part is done. You now have a JSON object containing all the data retrieved from cozytouch cloud.
You can easily access some specific data using function like this : msg.payload[9].states[8].value;
if you want to retrieve the 9th parameter value of the 10th device (remember that all list start with a 0).
You can easily store the retrieved data in a HA variable and use it for automation or Lovelace display.
Another very interesting possibility is the ‘commands’. In the JSON file, have a look at the ‘definition / commands’ chapter of each device. You will find which commandes are available for each device.
Example : how to force the refresh of values for 2 devices :
curl -b cookie-jar.txt -X POST -H "Content-type: application/json" -d '{"actions":[{"deviceURL":"io://0823-4256-4307/11076269#8","commands": [{"name": "refreshPassAPCHeatingProfile"}, {"name": "refreshTargetTemperature"}, {"name": "refreshDerogationRemainingTime"}]}, {"deviceURL":"io://0823-4256-4307/11076269#10","commands": [{"name": "refreshPassAPCHeatingProfile"}, {"name": "refreshTargetTemperature"}, {"name": "refreshDerogationRemainingTime"}]}]}' 'https://ha110-1.overkiz.com/enduser-mobile-web/enduserAPI/exec/apply'
Another example : how to set one heater in ‘comfort’ mode
curl -b cookie-jar.txt -X POST -H "Content-type: application/json" -d '{"actions":[{"deviceURL":"io://0823-4256-4307/11076269#10","commands": [{"name": "setPassAPCHeatingMode","parameters":["comfort"]}]}]}' 'https://ha110-1.overkiz.com/enduser-mobile-web/enduserAPI/exec/apply'
How to set the ‘comfort’ temperature of a device to 21.2°C :
curl -b cookie-jar.txt -X POST -H "Content-type: application/json" -d '{"actions":[{"deviceURL":"io://0823-4256-4307/11076269#8","commands": [{"name": "setComfortHeatingTargetTemperature","parameters":[21.2]}]}]}' 'https://ha110-1.overkiz.com/enduser-mobile-web/enduserAPI/exec/apply'
As i said, I don’t have any developper skill. So I found out the easiest way to do this (for me) was to use Node Red. I use :
- ‘Template’ node : to set the curl commands
- ‘Exec’ node : to execute the previous command
- ‘json’ node : to convert the curl output to json
- ‘function’ node : to extract the interesting values from the JSON object
- ‘call service’ node : to store retrieved values into HA variables