Skip to content

PJCzx/homebridge-thermostat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.