security API documentation, please fix

The Netatmo API is a set of webservices allowing developers and third parties to access Netatmo device's data.
Post Reply
jcovett
Posts: 2
Joined: 25 Dec 2019, 18:56

security API documentation, please fix

Post by jcovett » 25 Dec 2019, 19:05

Dear Netatmo

I have two Netatmo Presence and am implementing their API. It works, but their documentation is broken at https://dev.netatmo.com/apidocumentatio ... y#setstate
This page will not load the parameters for the setstate endpoint; and the Try-it-out functionality does not work; I tried multiple browsers.
If anyone can tell me the details of how to turn monitoring on I'd be grateful.
I have sent a support request about this more than a week ago, but the documentation isn't fixed yet. Netatmo, please correct the documentation so I can fully use your product.

Céline
Posts: 38
Joined: 20 Nov 2017, 18:17

Re: security API documentation, please fix

Post by Céline » 02 Jan 2020, 17:33

Hi jcovett,

We have a small problem with the documentation of this particular endpoint. We'll remove it while we fix it properly.

To help you in the meantime, here are some info on the request.

The SetState enpoint allows to:
• Set outdoor camera floodlight mode to Auto/On.
• Set indoor and outdoor camera monitoring to On/Off.

To use it, you will need write scopes, either write_camera or write_presence

The endpoint is : https://api.netatmo.com/api/setstate

This method expects parameters to be passed as a JSON string in the POST request body contrary to the other methods. That means that all the info should in the body.

You can control the outdoor camera floodlight from ON to AUTO and the monitoring from ON to OFF.

If the security code option in Netatmo Security app is enabled, a security code will be requested to suspend the monitoring (use pincode field). The boolean use_pin_code returned by the gethomedata call can be used to know if a pincode is required to turn On a given camera.

Request example:

Code: Select all

{
    "home": {
        "id": "xxxxxxxxxxxxx",
        "modules": [
            {
                "id": "70:xx:xx:xx:xx:xx",
                "floodlight": "auto"
            }
        ]
    }
}
BR,
Céline
Céline - Netatmo Team :D

jcovett
Posts: 2
Joined: 25 Dec 2019, 18:56

Re: security API documentation, please fix

Post by jcovett » 05 Jan 2020, 11:56

Céline thanks for your reply. However, I'm not there yet:

Are you sure about the 'write_presence' scope? This page (https://dev.netatmo.com/apidocumentation/oauth) does not mention it, but it does mention access_presence (I used 'read_presence access_presence write_presence' and did get a token, so it seems okay...)
And I assume the key value pair for monitoring is "monitoring": "on/off", am I right?

But the more difficult problem for me is when I try to POST your request example, obviously with my own id's, it returns error code 10 'missing home id'. In fact I tried a URL parameter ?home_id=5c4b744ab0xxxxxx together with that post and it return error code 11 '"Cannot read property 'modules' of undefined".

I know that my id's are correct since other api-call succeed, and I'm not using the pin code option. Can I ask you to double check the example code in your own environment and let me know if I'm doing anything wrong? (I could send you a Postman snippet but not via this public forum).

Thanks!

Post Reply

Return to “Netatmo API”