Thermostat API has evolved and now supports Valves

The Netatmo API is a set of webservices allowing developers and third parties to access Netatmo device's data.
hamp.quirin@gmail.com
Posts: 3
Joined: 25 Jul 2020, 17:21

Re: Thermostat API has evolved and now supports Valves

Post by hamp.quirin@gmail.com »

Hello Céline,

I try to build a post request in python3 for creating a new hourly schedule and I constantly get error code 21 "Invalid array arg". The access work fine since get home config and the measurements.

What is the correct syntax for the post params?

Below are two sets of post parameters that both do not work. I removed the access token and the home_id for privacy purposes.

Thanks in advance for your support.

Quirin
'https://api.netatmo.com/api/createnewhomeschedule'

Version 1 according to endpoint documentation
<class 'dict'>: {'access_token': <access_token>, 'home_id': '<home_id>', 'name': 'hourly_schedule', 'hg_temp': 6, 'away_temp': 14, 'zones': [{'id': 0, 'name': 'Confort', 'type': 4, 'rooms_temp': [{'room_id': '166007774', 'temp': 21}, {'room_id': '2118449080', 'temp': 21}]}, {'id': 1, 'name': 'Confort', 'type': 4, 'rooms_temp': [{'room_id': '166007774', 'temp': 21}, {'room_id': '2118449080', 'temp': 21}]}, {'id': 2, 'name': 'Confort', 'type': 4, 'rooms_temp': [{'room_id': '166007774', 'temp': 21}, {'room_id': '2118449080', 'temp': 21}]}, {'id': 3, 'name': 'Confort', 'type': 4, 'rooms_temp': [{'room_id': '166007774', 'temp': 21}, {'room_id': '2118449080', 'temp': 21}]}, {'id': 4, 'name': 'Confort', 'type': 4, 'rooms_temp': [{'room_id': '166007774', 'temp': 21}, {'room_id': '2118449080', 'temp': 21}]}, {'id': 5, 'name': 'Confort', 'type': 4, 'rooms_temp': [{'room_id': '166007774', 'temp': 21}, {'room_id': '2118449080', 'temp': 21}]}, {'id': 6, 'name': 'Confort', 'type': 4, 'rooms_temp': [{'room_id': '166007774', 'temp': 21}, {'room_id': '2118449080', 'temp': 21}]}, {'id': 7, 'name': 'Confort', 'type': 4, 'rooms_temp'
....
'type': 4, 'rooms_temp': [{'room_id': '166007774', 'temp': 21}, {'room_id': '2118449080', 'temp': 21}]}, {'id': 166, 'name': 'Confort', 'type': 4, 'rooms_temp': [{'room_id': '166007774', 'temp': 21}, {'room_id': '2118449080', 'temp': 21}]}, {'id': 167, 'name': 'Confort', 'type': 4, 'rooms_temp': [{'room_id': '166007774', 'temp': 21}, {'room_id': '2118449080', 'temp': 21}]}], 'timetable': [{'zone_id': 0, 'm_offset': 0}, {'zone_id': 1, 'm_offset': 60}, {'zone_id': 2, 'm_offset': 120}, {'zone_id': 3, 'm_offset': 180}, {'zone_id': 4, 'm_offset': 240}, {'zone_id': 5, 'm_offset': 300}, {'zone_id': 6, 'm_offset': 360}, {'zone_id': 7, 'm_offset': 420}, {'zone_id': 8, 'm_offset': 480}, {'zone_id': 9, 'm_offset': 540}, {'zone_id': 10, 'm_offset': 600}, {'zone_id': 11, 'm_offset': 660}, {'zone_id': 12, 'm_offset': 720}, {'zone_id': 13, 'm_offset': 780}, {'zone_id': 14, 'm_offset': 840}, {'zone_id': 15, 'm_offset': 900}, {'zone_id': 16, 'm_offset': 960}, {'zone_id': 17, 'm_offset':
....
9300}, {'zone_id': 156, 'm_offset': 9360}, {'zone_id': 157, 'm_offset': 9420}, {'zone_id': 158, 'm_offset': 9480}, {'zone_id': 159, 'm_offset': 9540}, {'zone_id': 160, 'm_offset': 9600}, {'zone_id': 161, 'm_offset': 9660}, {'zone_id': 162, 'm_offset': 9720}, {'zone_id': 163, 'm_offset': 9780}, {'zone_id': 164, 'm_offset': 9840}, {'zone_id': 165, 'm_offset': 9900}, {'zone_id': 166, 'm_offset': 9960}, {'zone_id': 167, 'm_offset': 10020}]}

Version 2 according to description of scheduling
<class 'dict'>: {'access_token': <access_token>, 'home_id': '<home_id>', 'name': 'hourly_schedule', 'hg_temp': 6, 'away_temp': 14, 'zones': [{'id': 0, 'name': 'Confort', 'type': 4, 'rooms': [{'id': '166007774', 'therm_setpoint_temperature': 21}, {'id': '2118449080', 'therm_setpoint_temperature': 21}]}, {'id': 1, 'name': 'Confort', 'type': 4, 'rooms': [{'id': '166007774', 'therm_setpoint_temperature': 21}, {'id': '2118449080', 'therm_setpoint_temperature': 21}]}, {'id': 2, 'name': 'Confort', 'type': 4, 'rooms': [{'id': '166007774', 'therm_setpoint_temperature': 21}, {'id': '2118449080', 'therm_setpoint_temperature': 21}]}, {'id': 3, 'name': 'Confort', 'type': 4, 'rooms': [{'id': '166007774', 'therm_setpoint_temperature': 21}, {'id': '2118449080', 'therm_setpoint_temperature': 21}]}, {'id': 4, 'name': 'Confort', 'type': 4, 'rooms': [{'id': '166007774', 'therm_setpoint_temperature': 21}, {'id': '2118449080', 'therm_setpoint_temperature': 21}]}, {'id': 5, 'name': 'Confort', 'type': 4, 'rooms': [{'id': '166007774', 'therm_setpoint_temperature': 21}, {'id': '2118449080', 'therm_setpoint_temperature': 21}]}, {'id': 6, 'name': 'Confort', 'type': 4, 'rooms': [{'id': '166007774', 'therm_setpoint_temperature': 21}, {'id': '2118449080', 'therm_setpoint_temperature': 21}]}, {'id': 7, 'name': 'Confort', 'type': 4, 'rooms': [{'id': '166007774', 'therm_setpoint_temperature': 21}, {'id': '2118449080', 'therm_setpoint_temperature': 21}]}, {'id': 8, 'name':
....
'Confort', 'type': 4, 'rooms': [{'id': '166007774', 'therm_setpoint_temperature': 21}, {'id': '2118449080', 'therm_setpoint_temperature': 21}]}, {'id': 99, 'name': 'Confort', 'type': 4, 'rooms': [{'id': '166007774', 'therm_setpoint_temperature': 21}, {'id': '2118449080', 'therm_setpoint_temperature': 21}]}, {'id': 100, 'name': 'Confort', 'type': 4, 'rooms': [{'id': '166007774', 'therm_setpoint_temperature': 21}, {'id': '2118449080', 'therm_setpoint_temperature': 21}]}, {'id': 101, 'name': 'Confort', 'type': 4, 'rooms': [{'id': '166007774', 'therm_setpoint_temperature': 21}, {'id': '2118449080', 'therm_setpoint_temperature': 21}]}, {'id': 102, 'name': 'Confort', 'type': 4, 'rooms': [{'id': '166007774', 'therm_setpoint_temperature': 21}, {'id': '2118449080', 'therm_setpoint_temperature': 21}]}, {'id': 103, 'name': 'Confort', 'type': 4, 'rooms': [{'id': '166007774', 'therm_setpoint_temperature': 21}, {'id': '2118449080', 'therm_setpoint_temperature': 21}]}, {'id': 104, 'name': 'Confort', 'type': 4, 'rooms': [{'id': '166007774', 'therm_setpoint_temperature': 21}, {'id': '2118449080', 'therm_setpoint_temperature': 21}]}, {'id': 105, 'name': 'Confort', 'type': 4, 'rooms': [{'id': '166007774', 'therm_setpoint_temperature': 21}, {'id': '2118449080', 'therm_setpoint_temperature': 21}]}, {'id': 106, 'name': 'Confort', 'type': 4, 'rooms': [{'id': '166007774', 'therm_setpoint_temperature': 21}, {'id': '2118449080', 'therm_setpoint_temperature': 21}]}, {'id': 107, 'name': 'Confort', 'type': 4, 'rooms': [{'id': '166007774', 'therm_setpoint_temperature': 21}, {'id': '2118449080', 'therm_setpoint_temperature': 21}]}, {'id': 108, 'name': 'Confort', 'type': 4, 'rooms': [{'id': '166007774', 'therm_setpoint_temperature': 21}, {'id': '2118449080', 'therm_setpoint_temperature': 21}]}, {'id': 109, 'name': 'Confort', 'type': 4, 'rooms': [{'id': '166007774', 'therm_setpoint_temperature': 21}, {'id': '2118449080', 'therm_setpoint_temperature': 21}]}, {'id': 110, 'name': 'Confort', 'type': 4, 'rooms': [{'id': '166007774', 'therm_setpoint_temperature': 21}, {'id': '2118449080', 'therm_setpoint_temperature': 21}]}, {'id': 111, 'name': 'Confort', 'type': 4, 'rooms': [{'id': '166007774', 'therm_setpoint_temperature': 21}, {'id': '2118449080', 'therm_setpoint_temperature': 21}]}, {'id': 112, 'name': 'Confort', 'type': 4, 'rooms': [{'id': '166007774', 'therm_setpoint_temperature': 21}, {'id': '2118449080',
Last edited by hamp.quirin@gmail.com on 26 Jul 2020, 18:25, edited 1 time in total.
hamp.quirin@gmail.com
Posts: 3
Joined: 25 Jul 2020, 17:21

Re: Thermostat API has evolved and now supports Valves

Post by hamp.quirin@gmail.com »

Hello,


so I figured already two errors.
1. the name of the schedule cannot have an underscore
2. the name of a zone must be unique

Still it does not work.
Another question poped up concerning the endpiont https://api.netatmo.com/api/synchomeschedule . How does that work since there is not referral to the "schedule_id" or "schedule_name". Are the zone_ids the references and therefore have to be unique? Can one update also partially zones providiing in the request only a subset of all zones? If yes, how to do with the timetable since only the start through "m_offset" is provided?

The documentation is rather misleading with a referral to Thermostat page that does not exist and an incoherent label definition between "How to define a schedule" description and endpoint documentation.

Would be great to get some support.

Yours sincerely,

Quirin
InTimo
Posts: 86
Joined: 27 Nov 2012, 18:39

Re: Thermostat API has evolved and now supports Valves

Post by InTimo »

Hello .. chance for "API-Update" to modify the temperature by an external module (ex. weather indoor, home coach) .. every 10min read the REAL temperature in room and write automaticaly in the valve "temperature-difference". I'm not alone with this ..
Shadar wrote: 28 Feb 2020, 23:21 OK, Then can I set a " real Temperature" (correction) to a room in order to recalibrate all valves inside this room?

:)
Other question .. why isn't the battery status from the valves reported to HomeKit? And last but not least .. why no "OFF" option???

Timo
Post Reply

Return to “Netatmo API”