Giter VIP home page Giter VIP logo

nest-datagraph's Introduction

Nest DataGraph

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 !

Features

  • Polls Nest API to fetch thermostat data
  • Consumptions data are stored in a local database
  • Generates (Google) Charts with your consumptions
  • Select specific date ranges
  • Hover over charts to get the exact timestamp and temperature
  • Verify your Nest Protect devices state
  • And more !

Overview

Installation

Prerequisite

For Docker version:

Docker Setup

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 Key
    • lat - Latitude
    • long - Longitude
    • nest_username - Nest login
    • nest_password - Nest password
    • nest_sn - Nest Thermostat serial number
    • nest_protect - Set true if you Nest Protect product
    • mysql_username - MySQL user
    • mysql_password - MySQL password
    • mysql_hostname = IP or FQDN of your MySQL server
    • mysql_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
    

Classic Setup

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 [email protected]: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 Key
    • owm_city_id - Your city ID (without quote, e.g: 2988507)
    • nest_username - Nest login
    • nest_password - Nest password
    • nest_sn - Nest Thermostat serial number
    • nest_protect - Set true if you Nest Protect product
    • mysql_username - MySQL user
    • mysql_password - MySQL password
    • mysql_hostname = IP or FQDN of your MySQL server
    • mysql_database = Database name
  • Enjoy (and wait a hour) !

Features & Known Issues

You can find and post new features or known issues in the Issues tab.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Report a bug

  1. Create an new issue
  2. Explain with details your issue
  3. Add your configuration (OS, Software version, etc)
  4. (Opt) Attach files
  5. Submit !

Acknowledgements

nest-datagraph's People

Contributors

gchenuet avatar jldeen avatar itsans avatar ryan-jacobs avatar sounil avatar

Stargazers

Trevor Hedley avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.