Hi Bernhard,
One thing popped up. When calling the (non-pro) API using 'type=bookes' an array of device-id's is returned.
I noticed some 'escaping' of quotes & array. FYI : the Pro-API does not do this.
I'm using the ArduinoJSON library for parsing the returned array of device-id's...somehow this does not work correctly as the .size() member-function always returns 0, even if the JSON string contains this 'escaped' device-id.
For testing this I did a string replace, removing the backslashes & quotes surrounding the array. See below:
Code: Select all
[COMMS] response TEMP (received) {"error":0,"error_text":"","warning":0,"warning_text":"","next_request_ms":10000,"epower_0_state":1,"epower_1_state":0,"used_for_devices":"[\"U85iFFgAG0Z7wrql0\"]"}
[COMMS] response TEMP (corrected) {"error":0,"error_text":"","warning":0,"warning_text":"","next_request_ms":10000,"epower_0_state":1,"epower_1_state":0,"used_for_devices":["U85iFFgAG0Z7wrql0"]}
When doing this I can successfully parse the json-array.
Not sure how the JSON is being constructed/serialised on the server...but maybe this article could be of help :
https://arduinojson.org/v6/issues/cannot-get-values/
For now I can fix this locally but maybe it's a good idea to solve this on the server.
Regards, Jos