-
Notifications
You must be signed in to change notification settings - Fork 7
InstallationWeather
Once charting of the thermostat data is working by following the Web Interface Setup it is possible to add external temperature data obtained from an online weather service.
Several free online weather services are supported. Choose one that meets your requirements...
### UK Met Office DataPoint ###The UK Met Office DataPoint datafeeds provide hourly observations available from ~122 locations around the UK.
Requires registration for a free account. The fair use policy allows for up to 5000 calls per day and 100 calls per minute which should be sufficient for most users.
Service |
metoffice
|
---|---|
API Key | Visit http://register.metoffice.gov.uk/register/datapoint and register for an account (or add a Met Office DataPoint subscription to your existing account). Then visit http://www.metoffice.gov.uk/datapoint/support/API to obtain your API key. |
Location | The location must be specified as a location ID. A complete list can be obtained from http://datapoint.metoffice.gov.uk/public/data/val/wxobs/all/xml/sitelist?key=hourly&key=12345678-1234-1234-1234-123456789ABC where 12345678-1234-1234-1234-123456789ABC should be replaced by the API key as obtained above.
|
The Weather Underground API provides observations from over 22,000 personal weather stations worldwide plus many official weather stations at airports and other locations.
Requires registration for a free 'developer' account. This allows for up to 500 calls per day and 10 calls per minute which should be sufficient for most users.
Service |
wunderground
|
||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
API Key | Visit http://www.wunderground.com/weather/api to create an account to obtain an API Key (sixteen hexadecimal digits). |
||||||||||||||||||
Location | The location can be specified in several ways, including:
|
The Yahoo! Weather RSS Feed provides worldwide weather information.
No registration is required.
Service |
yahoo
|
---|---|
Location | The location must be specified as a WOEID. This can be found by browsing or searching for your city from the Yahoo! Weather home page; the WOEID is the number that appears at the end of the resulting URL.
For example, a search for Cottenham results in the URL |
Once the weather service has been selected, an API key obtained if appropriate (Met Office DataPoint or Weather Underground), and the location obtained in a suitable format, it is possible to test it by running:
~/heatmiser-wifi-read-only/bin/heatmiser_weather.pl -w wunderground -k 0123456789abcdef -g pws:ICAMBSCO1
where wunderground
should be changed to identify the service being used, 0123456789abcdef
should be set to your API key (or omitted if using Yahoo! Weather), and pws:ICAMBSCO1
should be replaced by your location.
This should display the most recent weather observation:
External temperature at 2012-04-29 18:15:52 was 14.0C
## Update the Configuration File ##
Once access to the weather service has been confirmed the configuration options should be added to the `/etc/heatmiser.conf` file:
```nginx
HOST heatmiser
PIN 1234
WSERVICE wunderground
WKEY 0123456789abcdef
WLOCATION pws:ICAMBSCO1
where wunderground
, 0123456789abcdef
and pws:ICAMBSCO1
should be replaced by the service, API key and location used above.
By default the weather service is polled once for every 5 readings of the thermostats, i.e. every 5 minutes. This can be changed by adding a WLOGRATE
entry to the /etc/heatmiser.conf
file specifying the number of thermostat readings per poll of the external temperature. Be careful not to exceed any API limits otherwise access is likely to be blocked.
If your thermostats are configured to display temperatures in Fahrenheit then it is also necessary to add WUNITS F
to the configuration file in order to obtain the external temperature in the same units.
Restart the daemon manually using:
sudo reload heatmiser_daemon
Check the /var/log/heatmiser
file for any errors.
Logging of external temperature data can be checked by reconnecting to MySQL:
mysql -u heatmiser heatmiser
and then viewing the contents of the weather
table:
SELECT * FROM weather;
+---------------------+----------+ | time | external | +---------------------+----------+ | 2012-04-29 18:15:52 | 14.0 | | 2012-04-29 18:20:43 | 14.3 | | 2012-04-29 18:25:34 | 14.5 | | 2012-04-29 18:30:46 | 14.6 | | 2012-04-29 18:35:56 | 14.4 | +---------------------+----------+ 5 rows in set (0.00 sec)
As before, when done disconnect from the MySQL server:
```sql
QUIT;
Opening the web page in a web browser should now show a dashed black line for the external temperature.
If Weather Underground is being used for the external temperature data then it is possible to retrieve historical temperature data. This is useful if the thermostat temperatures have been logged for a while before configuring a weather service to populate the database with corresponding external temperature data.
To avoid using up the daily API call allowance required by the daemon it is recommended to create a second API key at http://www.wunderground.com/weather/api/d/edit.html. Ensure that the Yes, give me FULL access to one of the biggest historical weather databases on the web option is selected when creating the key.
Retrieve the historical temperature data using:
~/heatmiser-wifi-read-only/bin/heatmiser_history.pl -k 0123456789abcdef
where 0123456789abcdef
should be set to your new API key.
Note that this will take a long time to run. Please be very patient. A 6 second delay is inserted between requesting each day's data to avoid exceeding the 10 calls per minute API limit. Adding thousands of new rows to the database will also take a while.
It is safe to re-run the script to ensure that all available historical data has been imported.
Home | Installation | Troubleshooting | Contact | © Copyright 2011-2015 Alexander Thoukydides
Due to Heatmiser's lack of support for their pre-Neo models I have replaced mine with a Nest Learning Thermostat (3rd generation).
- Project Home
- Installation Instructions
- Reference Information
- Acknowledgements
- Contact
- Heatmiser Websites
- Related Projects
- Other Resources