NEST Thermostat API -
i trying develop ios app using newly published nest api bit lost native documentation.
question:i access token not know thermostat endpoint query , update "away" state
any pointers appreciated ..
i'm presuming intend use rest query , update away state since mentioned "endpoint"? if not other alternative use firebase api. documented in introduction section
to away status you'll need query structure/s
curl -v -l https://developer-api.nest.com/structures?auth=<auth_token> the response shows away state in addition thermostats/smoke co alarms in structure.
{ "g-9y-2xkhpbh1mgkvaqxogjikob9mkow1hhyyqk2vaunck8a731jbg": { "away": "home", "country_code": "us", "name": "home", "smoke_co_alarms": [ "0nbm7-qfolwhmldz2coikq7hrjoe1jye" ], "structure_id": "g-9y-2xkhpbh1mgkvaqxogjikob9mkow1hhyyqk2vaunck8a731jbg", "thermostats": [ "gm6z9jpsku6_ua8afd6wra" ], "time_zone": "america/los_angeles" } } to update away state need use put http verb:
curl -v -l -x put "https://developer-api.nest.com/structures/g-9y-2xkhpbh1mgkvaqxogjikob9mkow1hhyyqk2vaunck8a731jbg?auth=<auth_token>" -h "content-type: application/json" -d '{"away":"away"}' note id used in path parameter structure id returned in response.
hope helps nagesh
Comments
Post a Comment