This project try to fill the biggest Nest Thermostat gap, data history using Python and LAMP stack.
It allow you to browse your Nest thermostat history data with some pretty charts, analyze your consumption and keep a eye on your environment.
Feel free to create a pull request, open an issue or fork it !
For Docker version:
If you want to use Nest Datagraph with Docker, please follow these steps:
Fill the frontend/conf/settings.ini
file with your configuration:
timezone
- Your timezone (Ex: 'Europe/Paris')units
- Choose your temperature units (C or F)api_key
- DarkSky API Keylat
- Latitudelong
- Longitudenest_username
- Nest loginnest_password
- Nest passwordnest_sn
- Nest Thermostat serial numbernest_protect
- Set true if you Nest Protect productmysql_username
- MySQL usermysql_password
- MySQL passwordmysql_hostname
= IP or FQDN of your MySQL servermysql_database
= Database name(Opt) Edit the docker-compose.yml file to specify your ENV variables.
Build Docker image:
docker-compose build
Run Project
docker-compose up -d
Do both build and run in one command:
docker-compose -f "docker-compose.yml" up -d --build
This example is based on Debian Jessie with NGinx/PHP-FPM web server and MariaDB database engine.
Update your package lists and any pending updates before starting:
sudo apt-get update
sudo apt-get upgrade -y
Install required packages:
sudo apt-get install nginx php5-fpm php5-mysql php5-curl mariadb-server mariadb-client git python-pip python-dev build-essential
pip install -r setup/requirements.txt
Clone the repository:
cd /opt && git clone git@github.com:gchenuet/nest-datagraph.git
Setup NGinx Virtual Host:
sudo cp /opt/nest-datagraph/setup/nginx/nest-datagraph.conf /etc/nginx/sites-available/
sudo ln -s /etc/nginx/sites-available/nest-datagraph.conf /etc/nginx/sites-enabled/nest-datagraph.conf
Modify the server_name
parameter with your FQDN in nest-datagraph.conf :
vim /etc/nginx/sites-enabled/nest-datagraph.conf
Reload NGinx
sudo service nginx reload
Create a new MySQL user:
CREATE USER '[username]'@'localhost' IDENTIFIED BY '[password]';
GRANT ALL PRIVILEGES ON * . * TO '[username]'@'localhost';
Create the database and grant permissions:
CREATE DATABASE nest_datagraph;
GRANT ALL PRIVILEGES ON nest_datagraph.* TO '[username]'@'localhost';
Import the DB schema:
sudo mysql -h <HOST> -u <USER> -p<PASSWORD> nest_datagraph < /opt/nest-datagraph/setup/db/nest-datagraph.sql
Open the crontab and add the line at the end of the file:
crontab -e
0 * * * * /usr/bin/python /opt/nest-datagraph/backend/poller.py
Fill in variables with your parameters in frontend/conf/settings.ini
:
timezone
- Your timezone (Ex: 'Europe/Paris')units
- Choose your temperature units (C or F)owm_id
- OpenWeatherMap API Keyowm_city_id
- Your city ID (without quote, e.g: 2988507)nest_username
- Nest loginnest_password
- Nest passwordnest_sn
- Nest Thermostat serial numbernest_protect
- Set true if you Nest Protect productmysql_username
- MySQL usermysql_password
- MySQL passwordmysql_hostname
= IP or FQDN of your MySQL servermysql_database
= Database nameEnjoy (and wait a hour) !
You can find and post new features or known issues in the Issues
tab.
(git checkout -b my-new-feature)
(git commit -am 'Added some feature')
(git push origin my-new-feature)