1

I am looking into options to make rest client to turn on/off nest thermostat from the using web service.

I found API to read the device info, but didn't get API to change settings or turn on and off the device.

Is there any REST/SOAP Api to turn on and off NEST Devices?

Vishal Anand
  • 46
  • 1
  • 6

2 Answers2

1

There is a REST api for the NEST. The documentation can be seen here

For a thermostat you might not be able to turn it off directly, however setting temperature low enough should emulate off. For example by setting:

{ target_temperature_c : 1.0 }
CodeTower
  • 6,293
  • 5
  • 30
  • 54
  • I have tried the URL : https://developer-api.nest.com/devices?auth=c.fDDv3tz8QmAD and payload for PUT is { thermostats: { -9YM4vnWILB00k6-6ZvKLO3x5G6L0jmH: { target_temperature_f: 72, target_temperature_high_f: 75, target_temperature_low_f: 68 }, -9YM4vnWILCBr8k9BP9XRu3x5G6L0jmH: { target_temperature_f: 70, target_temperature_high_f: 75, target_temperature_low_f: 68 }, -9YM4vnWILAYKHU3sLJkme3x5G6L0jmH: { target_temperature_f: 71, target_temperature_high_f: 75, target_temperature_low_f: 68 } } } The response is 400 { error: "Invalid content sent" } – Vishal Anand Jul 07 '15 at 04:44
0

can you format your payload and the response you're getting in the text so its easier to see?

You should PUT to:

https://developer-api.nest.com/devices/thermostats/<thermostatID>?auth=<token>

and your payload should be:

{"target_temperature_f":78}

Or if you want to turn the system off your payload should be:

{"hvac_mode":"off"}
urman
  • 596
  • 2
  • 9