How can i find my Home-ID

The Netatmo API is a set of webservices allowing developers and third parties to access Netatmo device's data.
Post Reply
secundani
Posts: 1
Joined: 16 Jan 2018, 15:42

How can i find my Home-ID

Post by secundani » 15 Feb 2018, 08:40

How do I find the Home ID for my Netatmo Presence?
I do not find it under gethomedata.
thanks and greetings secundani

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

Re: How can i find my Home-ID

Post by Céline » 05 Mar 2018, 16:01

Hi,
The home id in which your camera is setup is returned in the response of gethomedata.
Please check the returned example from https://dev.netatmo.com/resources/techn ... ethomedata
Céline - Netatmo Team :D

ouiouiblog
Posts: 16
Joined: 21 Oct 2017, 23:59

Re: How can i find my Home-ID

Post by ouiouiblog » 10 Apr 2018, 22:19

Hi

I used GetHomeData to retrieve my Home_ID to use the thermostatAPI (Homestatus).

Is the Home_ID static or may it changes ?

When I know my Home-ID may i keep it as a constant in my app or must I request home_ID every time I launch the app ?

If it doesn't change, it means that I do not need anymore the access_token, right ? I just need to stock the Home_ID in my app.

If I don't need access_token, it means that anyone that know my Home_ID may reprogram my thermostat ?

Thanks in advance

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

Re: How can i find my Home-ID

Post by Céline » 11 Apr 2018, 10:52

Hi,

To retrieve your home_id, you need to request HomesData. HomesData will basically return the topology of your homes.
If you don't modify the home topology, the home_id will not be modified. If you are using webhooks, you will be notified of that change.

For all calls, you need the access_token, no one can reprogram your device without being authentified. To provide the token, you need to put it in the bearer (see https://dev.netatmo.com/resources/techn ... tification)

Regards,
Céline
Céline - Netatmo Team :D

ouiouiblog
Posts: 16
Joined: 21 Oct 2017, 23:59

Re: How can i find my Home-ID

Post by ouiouiblog » 11 Apr 2018, 13:48

Thank you for your time,

I may be wrong, but what I understand in the resources is that:
- The token is requested for the Security module (example : https://dev.netatmo.com/resources/techn ... ersonsaway)
Request example :
POST /api/setpersonsaway HTTP/1.1
Host: api.netatmo.com
access_token=ACCESS_TOKEN&home_id=56c881f049c75fe56273x0X0X0&person_id=5715e88cc6aa429x0X0X0X&size=2


- The token is not requested to call homestatus : only Home_ID and Device_types (https://dev.netatmo.com/resources/techn ... homestatus)
Request example :
GET /api.netatmo.com/api/homestatus?home_id=[HOME_ID]


- Neither for Setthermode : only Home_ID, mode and endtime (https://dev.netatmo.com/resources/techn ... tthermmode)
Request example :
/api/setthermmode?home_id=[HOME_ID]&mode=schedule

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

Re: How can i find my Home-ID

Post by Céline » 11 Apr 2018, 13:59

With new requests, sending the token as a parameter no longer works. The old methods such as setpersonsaway are still accepting tokens as parameters.
However, all requests are accepting the authentification with bearer authentification (which is more secure) and we advice you to switch on this new method for all your requests.

More info on it:

Bearer authentication (also called token authentication) is an HTTP authentication scheme that involves security tokens called bearer tokens. The name “Bearer authentication” can be understood as “give access to the bearer of this token.”
You must send the token in the Authorization header when making requests to Netatmo Home API
Authorization: Bearer
The Bearer authentication scheme was originally created as part of OAuth 2.0 in RFC 6750
Céline - Netatmo Team :D

ouiouiblog
Posts: 16
Joined: 21 Oct 2017, 23:59

Re: How can i find my Home-ID

Post by ouiouiblog » 11 Apr 2018, 14:16

Ok, I'm gonna see how it works

Thank you

Post Reply

Return to “Netatmo API”