Originally posted by zcapr17
View Post
Beginners guide to graphing Evohome temperatures using python and plot.ly
Collapse
X
-
-
-
Hi Bill,
Thanks for posting all this really helpful information. I managed to get it all set-up successfully apart from the easy, but critical piece of creating a Plot.ly account! Not quite sure what's going wrong or whether it's simply a problem with the Plot.ly website, but I've tried a few different browsers and the Sign Up page seems to have a script error and just hangs . Anyway, it was still really interesting to see the data returned by the python scripts and I was so impatient that I thought I'd try a different solution to capture my data. I ended up installing Domoticz and setting up Evohome within it. I've set up a script to poll the Honeywell server every 5mins and after about 2 days of data it's really interesting to see how the system achieves the set-points and the rates at which different rooms cool down. Not quite sure what I'll do with all this information, but it's great to play.
Thanks,
Dan
Comment
-
-
Hi Dan
I didn't have any problems signing up, maybe they were under maintenance or something?
I did manage to change the script to stop it opening a browser tab for each zone (all 12 of them!) and managed to configure a dashboard to see them all together - like you say not sure what I will do with it, but I like seeing all the flat lines in zones when not being used (in my mind that's where I am finally saving money!!)
Not looked at Domoticz. It may be better? How did you configure that?
cheers
Bill
Comment
-
-
Originally posted by Bill M View PostNot looked at Domoticz. It may be better? How did you configure that?
I followed the instructions in the 'Scripting for RFG100' section of the Domoticz guide for Evohome:
I'm running Domiticz on a windows machine so I set-up a scheduled task to run 'evo-update.py' every 5min which pulls the Evohome data from the Honeywell website. Here's a screenshot of the kinds of graphs which are shown within Domoticz.
Dan
Comment
-
-
Thanks for this guide, Bill, it helped me get up and running sending data to an ELK stack pretty quickly. One thing to note, however: as of around midday today the old rs.alarmnet.com URLs stopped working. I changes the URLs in the scripts I based off your material to the tccna.honeywell.com URLs and everything worked as normal.
Comment
-
-
Originally posted by WiteWulf View PostThanks for this guide, Bill, it helped me get up and running sending data to an ELK stack pretty quickly. One thing to note, however: as of around midday today the old rs.alarmnet.com URLs stopped working. I changes the URLs in the scripts I based off your material to the tccna.honeywell.com URLs and everything worked as normal.
I'm new here and trying to get a py script to work with evohome. I have tried several urls but none work. Could someone please post a simple script to compare Temperature Setpoint versus Actual Temperature? Would be much appreciated. Thanks Keith
Comment
-
-
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)
Comment
-
-
Originally posted by WiteWulf View PostOkay, 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.
If the system you are using for graphing polls more often or polls separately for each zone you should probably implement local caching of data like the evohome-munin plugin does:
Munin plugin for monitoring room/zone temperatures controlled by the Evohome of Honeywell - Infern1/evohome-munin
Since each response contains the data for every zone once you query the server for one zone you can pull the data for the other zones from local disk from the 4 minute cache (in the above example) without re-querying the server.Last edited by DBMandrake; 3 May 2016, 09:15 PM.
Comment
-
-
Originally posted by WiteWulf View PostOkay, 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)
Im getting this error now
/data/data/com.hipipal.qpyplus/files/bin/qpython-android5.sh "/storage/emulated/0/com.hipipal.qpyplus/scripts3/.last_tmp.py" && exit
storage/emulated/0/com.hipipal.qpyplus/scripts3/.last_tmp.py" && exit <
/data/data/com.hipipal.qpyplus/files/lib/python2.7/site-packages/requests-2.10.0-py2.7.egg/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/l...missingwarning.
SNIMissingWarning
/data/data/com.hipipal.qpyplus/files/lib/python2.7/site-packages/requests-2.10.0-py2.7.egg/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/l...latformwarning.
InsecurePlatformWarning
/data/data/com.hipipal.qpyplus/files/lib/python2.7/site-packages/requests-2.10.0-py2.7.egg/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/l...latformwarning.
InsecurePlatformWarning
/data/data/com.hipipal.qpyplus/files/lib/python2.7/site-packages/requests-2.10.0-py2.7.egg/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/l...latformwarning.
InsecurePlatformWarning
03-05-2016 23:53:32 1648402 20.0 19.5
03-05-2016 23:53:32 1648405 Traceback (most recent call last):
File "/storage/emulated/0/com.hipipal.qpyplus/scripts3/.last_tmp.py", line 41, in <module>
print now,device['deviceID'],device['name'],device['thermostat']['indoorTemperature'],device['thermostat']['changeableValues']['heatSetpoint']['value']
UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 1: ordinal not in range(128)
1|u0_a249@gts28lte:/ $
Comment
-
-
Originally posted by DBMandrake View PostPolling the Honeywell servers every 60 seconds is too often. This may lead to the server throttling or blocking your requests. The generally accepted (unofficial) minimum time between requests for those using the API for graphing is 5 minutes. Temperatures don't change that fast that polling more often is useful, especially when the API rounds temperatures to 0.5 degrees. (A 0.5 degree change every 60 seconds is a lot faster than you'll ever see)
If the system you are using for graphing polls more often or polls separately for each zone you should probably implement local caching of data like the evohome-munin plugin does:
Munin plugin for monitoring room/zone temperatures controlled by the Evohome of Honeywell - Infern1/evohome-munin
Since each response contains the data for every zone once you query the server for one zone you can pull the data for the other zones from local disk from the 4 minute cache (in the above example) without re-querying the server.
Comment
-
-
Originally posted by DBMandrake View PostYou'll need to update your version of Python on your system - what OS are you running this on ?
A lot of TLS changes have happened in the last year that break compatibility with old TLS/SSL implementations, this includes out of date versions of Python.
Keithflynn > See if there's a more up to date version of QPython available, or else run it in "proper" Python on a RasPi or something...
Comment
-
-
Here's a thought, would it be possible to put together a website that ran this.
You would create a read-only account on your EvoHome, give those credentials to the website, give it your plot.ly details and the it would just sit and poll every 5 minutes and push to plot.ly ?
Would just need a username/password for an account and then enter your details.
This would save us all trying to spin all these up ourselves.
Roy.
Comment
-
-
Originally posted by roydonaldson View PostHere's a thought, would it be possible to put together a website that ran this.
You would create a read-only account on your EvoHome, give those credentials to the website, give it your plot.ly details and the it would just sit and poll every 5 minutes and push to plot.ly ?
Would just need a username/password for an account and then enter your details.
This would save us all trying to spin all these up ourselves.
Roy.
Comment
-
Comment