HVAC Thermostat data graph
This is a php-based code that provides a web-interface to graph data collected from thermostat. This works for “Radio Thermostat CT80”, I don’t see why it wouldn’t work for any other unit. As long as the thermostat provides a RESTful API, the collection scripts can be tailored to fit your own. The workflow is simple, you provide the IP address or hostname of you thermostat. RESTful API calls executed by means of a cron job on the host server to read from the Thermostat, the collected data is stored in a local SQLite database. The graph uses Chart.js to display the collected data read from the database.
You may choose to host the code on your own webserver without Docker. Simply copy the content of hvac/web/src/
and ignore the rest.
Pre-requisites
- git
- docker
- docker-compose
Installation
-
Clone this:
git clone https://github.com/adlytaibi/hvac
cd hvac
-
SSL certificates
mkdir web/sslkeys
-
Self-sign your own certificates: (modify
web
to match your server)openssl req -x509 -nodes -newkey rsa:4096 -keyout web/sslkeys/host.key -out web/sslkeys/host.pem -days 365 -subj "/C=CA/ST=Ontario/L=Ottawa/O=Home/OU=Automation/CN=web"
-
-
docker-compose
docker-compose up -d
-
The login page can be accessed using the URL below:
https://<IP_address>
(or if accessing from the same guest https://localhost)
Needed PHP modules are checked as well as ability to write to the database directory.
-
If you’re ready to connect to your Thermostat, enter the hostname or IP address:
-
Or you can try out the application with randomly generated data in a demonstration mode:
-
Data points will be generated for the number of months selected. The time to process depends on how powerful your server is.
-
Monthly view
averages are calculated for inside/outside temperatures and humidity -
Selecting a month will take you to a
Weekly view
with average values per week -
Selecting a week will take you to a
Daily view
with average values for per day -
Selecting a day will take you to an
Hourly view
which represents raw values as they were collected as well as showing the heating/cooling runtime of the HVAC system -
At any time you can jump to
Today's view
with the home button. You can quickly jump to next/previous days -
Finally, the demonstration data can be deleted when you’re done staring at it. This will bring you back to the setup view as in (5).
-
Cron file is conveniently provided here
hvac/web/cron/hvac
to run from the Docker host. Drop the Docker section of the command if you’re running without Docker.