Giter Club home page Giter Club logo

homebridge-pi-thermostat's Introduction

Homebridge Pi Thermostat Plugin

This is a homebridge plugin to make a Raspberry Pi connected with a Relay Board and DHT22 Temperature and Humidity Sensor into a smart thermostat that can be controlled via the Home app on iOS using Homekit.

Raspberry Pi Thermostat showing Wiring

For those who want to create their own thermostat using Raspberry Pi, here is a blog post that goes through the details of where to buy the parts, how to assemble it and what software to install to get this to work.

Installation

  • Install nodejs and other dependencies for homebridge to work
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs libavahi-compat-libdnssd-dev
  • Install BCM2835 for temperature sensor to work
wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.52.tar.gz
tar zxvf bcm2835-1.52.tar.gz
cd bcm2835-1.52
./configure && make && sudo make check && sudo make install
  • Install homebridge and this plugin
sudo npm install -g --unsafe-perm homebridge homebridge-pi-thermostat
  • Add the accessory config to your homebridge config file located at this path ~/.homebridge/config.json.
{
  "bridge": {
    "name": "Homebridge",
    "username": "CC:22:3D:E3:CE:30",
    "port": 51826,
    "pin": "031-45-154"
  },
  "description": "",
  "accessories": [
    {
      "accessory": "Thermostat",
      "name": "Pi Thermostat",
      "fanRelayPin": 26,
      "heatRelayPin": 21,
      "coolRelayPin": 20,
      "temperatureSensorPin": 4,
      "minimumOnOffTime": 120000,
      "blowerTurnOffTime": 80000,
      "startDelay": 10000,
      "temperatureCheckInterval": 10000
    }
  ],
  "platforms": []
}
  • Start it up by running homebridge command.

Configuration

Relay Pins

You can change the pin to turn on and off the relay switch for the Fan, Heat and Cool setting.

"fanRelayPin": 26,
"heatRelayPin": 21,
"coolRelayPin": 20,

Temperature Sensor Pin

You also can change the pin for the DHT22 temperature sensor.

"temperatureSensorPin": 4,

Timing

The system has a minimum on off time which is in miliseconds and is the minimum time it keeps the Heat or Cool turned on and off so that it does not damage the heating or cooling system by turning on and off very quickly.

"minimumOnOffTime": 120000,

The system also has a blowerTurnOffTime which is the time it takes to turn off the blower after Heat or Cool is turned off.

"blowerTurnOffTime": 80000,

The interval for checking the temperature of the room can also be set and defaults to 10 seconds.

"temperatureCheckInterval": 10000

Screenshots

homebridge-pi-thermostat's People

Contributors

ankurp avatar

Watchers

James Cloos 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.