This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Nest Thermostat
#2
First, you need to get auth token, after that it's pretty simple with HTTP requests.
Nest docs:
https://developer.nest.com/documentation...ick-guide/

Here's a short code sample:
Code:
function request()
  local auth, url, res, stat, hdrs

  require('json')
  require('ssl.https')

  auth = '...'

  url = 'https://developer-api.nest.com/devices.json?auth=' .. auth
  res, stat, hdrs = ssl.https.request(url)

  if stat == 307 then
    res = ssl.https.request(hdrs.location)
  end

  return json.decode(res)
end

res, data = pcall(request)
log(data)
Reply


Messages In This Thread
Nest Thermostat - by Erwin van der Zwart - 25.01.2016, 19:57
RE: Nest Thermostat - by admin - 26.01.2016, 07:35
RE: Nest Thermostat - by Erwin van der Zwart - 29.01.2016, 23:20

Forum Jump: