Okay, this is heavily cribbed off Bill's earlier work in this thread. So long as you have the correct python modules installed and available (listed in the import lines at the top), and you enter in your username and password, it will poll your system's data on the Honeywell servers and output a timestamped list of location_id, location, measured temperature and set point. It will poll new data every 60 seconds.
Code:
import requests
import json
import time
USERNAME = 'YOUR USERNAME HERE'
PASSWORD = 'YOUR PASSWORD HERE'
APPLICATIONID = '91db1612-73fd-4500-91b2-e63b069b185c'
url = 'https://tccna.honeywell.com/WebAPI/api/Session'
postdata = {'Username':USERNAME,'Password':PASSWORD,'ApplicationId':APPLICATIONID}
headers = {'content-type':'application/json'}
try:
response = requests.post(url,data=json.dumps(postdata),headers=headers)
except:
print "Failed to connect/authenticate to Honeywell servers"
userData = json.loads(response.content)
userId = userData['userInfo']['userID']
sessionId = userData['sessionId']
url = 'https://tccna.honeywell.com/WebAPI/api/locations?userId=%s&allData=True' % userId
headers['sessionId'] = sessionId
response = requests.get(url,data=json.dumps(postdata),headers=headers)
fullData = json.loads(response.content)[0]
while True:
now = time.strftime('%d-%m-%Y %H:%M:%S')
try:
response = requests.get(url,data=json.dumps(postdata),headers=headers)
except:
print now + " Failed to connect to Honeywell servers"
print "Waiting to retry..."
time.sleep(5)
fullData = json.loads(response.content)[0]
for device in fullData['devices']:
print now,device['deviceID'],device['name'],device['thermostat']['indoorTemperature'],device['thermostat']['changeableValues']['heatSetpoint']['value']
print "Sleeping for 60s..."
time.sleep(60)