Coder Social home page Coder Social logo

homebridge-thermostat's Introduction

homebridge-thermostat

Homebridge plugin to control a web-based thermostat

Installation

  1. Install homebridge
  2. Install this plugin: npm install -g homebridge-thermostat
  3. Update your config.json file (See below).

Configuration example

"accessories": [
     {
       "accessory": "Thermostat",
       "name": "Thermostat",
       "apiroute": "http://myurl.com"
     }
]

Structure

Key Description
accessory Must be Thermostat
name Name to appear in the Home app
apiroute Root URL of your Thermostat device (excluding the rest of the requests)
temperatureDisplayUnits (optional) Whether you want °C (0) or °F (1) as your units (0 is default)
currentHumidity (optional) (true or false) Whether to include currentRelativeHumidity as a field in /status (false is default)
targetHumidity (optional) (true or false) Whether to include targetRelativeHumidity as a field in /status and be able to set it via /targetRelativeHumidity (false is default)
heatOnly (optional) (true or false) Whether the thermostat only supports heating (true) or heating and cooling (false) (false is default)
maxTemp (optional) Upper bound for the temperature selector in the Home app (30 is default)
minTemp (optional) Lower bound for the temperature selector in the Home app (15 is default)
timeout (optional) Time (in milliseconds) until the accessory will be marked as "Not Responding" if it is unreachable (5000 is default)
http_method (optional) The HTTP method used to communicate with the thermostat (GET is default)
username (optional) Username if HTTP authentication is enabled
password (optional) Password if HTTP authentication is enabled
model (optional) Appears under "Model" for your accessory in the Home app
serial (optional) Appears under "Serial" for your accessory in the Home app
manufacturer (optional) Appears under "Manufacturer" for your accessory in the Home app

API Interfacing

Your API should be able to:

  1. Return thermostat info when it recieves /status in the JSON format like below:
{
    "targetHeatingCoolingState": INT_VALUE_0_TO_3,
    "targetTemperature": FLOAT_VALUE,
    "currentHeatingCoolingState": INT_VALUE_0_TO_2,
    "currentTemperature": FLOAT_VALUE
}

Note: You can also add the currentRelativeHumidity and targetRelativeHumidity fields individually or together above if enabled in the config.json (read Structure)

  1. Set targetHeatingCoolingState when it recieves:
/targetHeatingCoolingState/{INT_VALUE_0_TO_3}
  1. Set targetTemperature when it recieves:
/targetTemperature/{INT_VALUE}
  1. If enabled in config.json (read Structure), set targetRelativeHumidity when it recieves:
/targetRelativeHumidity/{FLOAT_VALUE}

HeatingCoolingState Key

Number Name
0 Off
1 Heat
2 Cool
3 Auto

Heatmiser Support

Folder 'heatmiser' contains a contributed example of the API. It supports Heatmiser wireless thermostats, as long as https://github.com/thoukydides/heatmiser-wifi is installed and working.

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.