Skip to content

A smart thermostat built on Flask, Bootstrap, and a Raspberry Pi 3B+

License

Notifications You must be signed in to change notification settings

dylanm312/smartthermostat

Repository files navigation

Pylint

Raspberry Pi Smart Thermostat

This project uses Flask for the backend, Bootstrap for the frontend, and Chart.JS for the data visualizations.

Required Hardware

Installation Instructions

  1. Assemble the hardware however you like. I used standoffs to stack the three components, but you could use a breadboard as well.

  2. Connect the thermostat wires to the relays as follows:

    1. Connect the R wire (either Rh or Rc) to the C terminal on relay 1
    2. Connect all the C terminals on all three relays together
    3. Connect the W wire to the NO terminal on relay 1 (this controls the heat)
    4. Connect the G wire to the NO terminal on relay 2 (this controls the fan)
    5. Connect the Y wire to the NO terminal on relay 3 (this controls the A/C)
  3. Download and extract the source code to a folder of your choosing

  4. Install virtualenv and virtualenvwrapper (skip to step 4 if you have these already).

    pip3 install virtualenv virtualenvwrapper

    You will also need to make some changes to your ~/.bashrc file for virtualenvwrapper to work properly, see here.

  5. Create a virtual environment for the project and switch into it

    mkvirtualenv smarttthermostat
    workon smartthermostat
  6. Install the Python dependencies

    pip3 install -r requirements.txt
  7. Open static/settings.json and set your initial preferred temperature setpoint and tolerance, and indicate whether your home has heating and/or A/C by typing true or false where appropriate. Save the file.

  8. Launch the app

    python3 main.py
  9. Open the web interface to see your thermostat at work! By default, the web server runs on port 5000.

About

A smart thermostat built on Flask, Bootstrap, and a Raspberry Pi 3B+

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published