I am trying to change my thermostat's schedule via Netatmo API, but I fail to do so with Postman.
As I understand, to create a new schedule we have to call /api/createnewschedule with POST arguments :
Code: Select all
access_token
device_id
module_id
zones
timetable
name
It shows a JSON-like array, embedded in parentheses as an example, but API answers me an error (error code 21 : "Invalid Array arg").
For example, I try to send this post request on api.netatmo.com/api/createnewschedule with the following data :
Code: Select all
access_token: myaccesstoken
device_id: 70:ee:50:0b:19:16
module_id: 04:00:00:0b:32:76
zones: ({"id": 0,"temp": 17,"type": 0},{"id": 1,"temp": 16,"type": 1},{"id": 3,"temp": 17,"type": 8},{"id": 4,"temp": 16,"type": 5},{"id": 2,"temp": 12,"type": 2},{"id": 5,"temp": 7,"type": 3}↵)
timetable: ({"id":2,"m_offset":0},{"id":1,"m_offset":360},{"id":2,"m_offset":180},{"id":2,"m_offset":1440},{"id":1,"m_offset":1800},{"id":2,"m_offset":2520},{"id":2,"m_offset":2880},{"id":1,"m_offset":3240},{"id":2,"m_offset":3960},{"id":2,"m_offset":4320},{"id":1,"m_offset":4680},{"id":2,"m_offset":5400},{"id":2,"m_offset":5760},{"id":1,"m_offset":6120},{"id":2,"m_offset":6840},{"id":2,"m_offset":7200},{"id":1,"m_offset":7560},{"id":2,"m_offset":8280},{"id":2,"m_offset":8640},{"id":1,"m_offset":9000},{"id":2,"m_offset":9720})
name: testSchedule
Code: Select all
{
"error": {
"code": 21,
"message": "Invalid array arg"
}
}
I suspect my zones and timetable parameters are not well formated for the API, but how should I do then ?
Thank you