@11125 I’m not sure if I can get any command IDs from the API, I’m guessing that the API itself has some sort of User/Group Restrictions and the data you can get from the cloud is sort of limited.
So to start you have to get you device_id and device_pin, which are visible during the first 4heat configuration when you are connecting it to your wifi. Then you need to get a access token like this:
curl --location --request POST 'https://wifi4heat.azurewebsites.net/Token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=password' \
--data-urlencode 'username={{[email protected]}}' \
--data-urlencode 'password={{YOUR_PASSWORD}}'
this will return you json like this:
{"access_token":"xxxxxx","token_type":"bearer","expires_in":9599,"refresh_token":"xxxxxx","userName":"[email protected]",".issued":"DayOfWeek, dd mm yyyy hh:mm:ss GMT",".expires":"DayOfWeek, dd mm yyyy hh:mm:ss GMT"}
Or you can even directly get assign the access_token to a env var:
export access_token=`curl --location --request POST 'https://wifi4heat.azurewebsites.net/Token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=password' \
--data-urlencode 'username={{[email protected]}}' \
--data-urlencode 'password={{YOUR_PASSWORD}}' | jq -r '.access_token'`
also set your deviceID to env var:
export device_id=xxxxxx
export device_pin=xxxxxx
Then you can get your boiler historical data like this for example, although it has around 10min delay until you get the most recent entry. Also the the density is only 5 minutes:
curl --location --request GET 'https://wifi4heat.azurewebsites.net/api/Devices/History?inputModel%5BDeviceId%5D={{$device_id}}&inputModel%5BFrom%5D=2022-01-31&inputModel%5BPeriod%5D=default&inputModel%5BTags%5D%5B0%5D%5BName%5D=209_Temperatura_Esterna&inputModel%5BTags%5D%5B0%5D%5BAggregation%5D=minOfTheDay&inputModel%5BTags%5D%5B1%5D%5BName%5D=209_Temperatura_Esterna&inputModel%5BTags%5D%5B1%5D%5BAggregation%5D=default&inputModel%5BTags%5D%5B2%5D%5BName%5D=209_Temperatura_Esterna&inputModel%5BTags%5D%5B2%5D%5BAggregation%5D=maxOfTheDay' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{$access_token}}'
Get boiler cron:
curl --location --request GET 'https: //wifi4heat.azurewebsites.net/api/devices/cron?deviceId={{$device_id}}&' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{$access_token}}'
This is probably interesting because I can see some command IDs in the response (here you will need also your pin that you had set during the initial setup):
curl --location --request GET 'https: //wifi4heat.azurewebsites.net/api/Devices/FileMap?pin={{device_pin}}&id={{device_ID}}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer {{$access_token}}'
You can get the list of errors/notifications with this one:
curl --location --request GET 'https: //wifi4heat.azurewebsites.net/api/Devices/NotificationErrors/{{$device_id}}?max=50' \
--header 'Content-Type: application/x-www-form-urlencoded'
Get devices summary for your account:
curl --location --request GET 'https: //wifi4heat.azurewebsites.net/api/devices/summary?ids={{device_id}}' \
--header 'Content-Type: application/json'
Get specific device details:
curl --location --request GET 'https: //wifi4heat.azurewebsites.net/api/devices/Details?id={{$device_id}}' \
--header 'Authorization: Bearer {{$access_token}}' \
--header 'Content-Type: application/json'
This is what I’m getting as a current status locally:
["SEL","0"]
["SEL","18","J30001000000000003","J30002000000000000","J30005000000000086","B20813000000000006","B20803000000000001","J30012000000000000","J30015000000000000","J30017000000000056","J30020000000000000","J30026000000000000","J30033000000000022","J30040000000000000","J30044000000000000","B20180000000000065","B20211000000000005","B20211000000000005","B20005000000000050","B20006000000000080"]
Those I can recognize from the app
J30017000000000056 - current water temp (56 C)
B20180000000000065 - target water temp (65 C)
J30033000000000022 - I think this is exhaust depresion (22 Pa)
J30001000000000007 - Extinguishing at the moment