0.3.0 • Published 4 years ago
homebridge-http-humidity v0.3.0
homebridge-http-humidity
Supports http/https devices on HomeBridge Platform. This version only supports humidity sensors returning a JSON with the data or the raw data.
This plug-in acts as an interface between a web endpoint and homebridge only. You will still need some dedicated hardware to expose the web endpoints with the humidity information. In my case, I used an Arduino board with Wifi capabilities.
Installation
- Install homebridge using:
npm install -g homebridge - Install this plugin using:
npm install -g homebridge-http-humidity - Update your configuration file. See sample-config.json in this repository for a sample.
Configuration
The available fields in the config.json file are:
urlMandatory Endpoint URL.nameMandatory Accessory name.http_methodOptional HTTP method used to get the humidity (Default: GET)manufacturerOptional Additional information for the accessory.modelOptional Additional information for the accessory.serialOptional Additional information for the accessory.field_nameOptional Field that will be used from the JSON response of the endpoint. Alternatively, if thefield_namecontains an empty string ("field_name": ""), the expected response is directly the current humidity value (Default: humidity).timeoutOptional Waiting time for the endpoint response before fail (Default: 5000ms).authOptional JSON withuserandpassfields used to authenticate the request into the device.update_intervalOptional If not zero, the field defines the polling period in milliseconds for the sensor state (Default is 120000ms). When the value is zero, the state is only updated when homebridge requests the current value.debugOptional Enable/disable debug logs (Default: false).
Example:
"accessories": [
{
"accessory": "HttpHumidity",
"name": "Outside Humidity",
"url": "http://192.168.1.210/humidity?format=json",
"http_method": "GET",
"field_name": "humidity",
"auth": {
"user": "test",
"pass": "1234"
}
}
]The defined endpoint will return a json looking like this:
{
"humidity": 38
}This plugin acts as an interface between a web endpoint and homebridge only. You will still need some dedicated hardware to expose the web endpoints with the relative humidity information. In my case, I used an Arduino board with Wifi capabilities.