Homebridge plugin to control a HTTP-based RGB device.
Supports RGB HTTP(S) devices on the HomeBridge Platform and provides a readablecallback for getting and setting the following characteristics to Homekit:
This fork differs from the original jnovack/homebridge-better-http-rgb in the following ways:
npm install -g homebridge
sudo npm install -g homebridge-http-rgb-push
Note: See Installing packages globally when you experiencepermission problems.
To uninstall homebridge-better-http-rgb, simply run:
sudo npm uninstall -g homebridge-http-rgb-push
"accessories": [
{
"accessory": "HttpPushRgb",
"name": "RGB Led Strip",
"service": "Light",
"timeout": 3000,
"switch": {
"status": "http://localhost/api/v1/status",
"powerOn": "http://localhost/api/v1/on",
"powerOff": "http://localhost/api/v1/off"
},
"brightness": {
"status": "http://localhost/api/v1/brightness",
"url": "http://localhost/api/v1/brightness/%s"
},
"color": {
"status": "http://localhost/api/v1/set",
"url": "http://localhost/api/v1/set/%s",
"brightness": true
}
}
]
"accessories": [
{
"accessory": "HttpPushRgb",
"name": "Single Color Light",
"service": "Light",
"switch": {
"status": "http://localhost/api/v1/status",
"powerOn": "http://localhost/api/v1/on",
"powerOff": "http://localhost/api/v1/off"
}
}
]
"accessories": [
{
"accessory": "HttpPushRgb",
"name": "Single Color Light",
"service": "Light",
"switch": {
"status": "http://localhost/api/v1/status",
"powerOn": "http://localhost/api/v1/on",
"powerOff": "http://localhost/api/v1/off"
},
"brightness": {
"status": "http://localhost/api/v1/brightness",
"url": "http://localhost/api/v1/brightness/%s"
}
}
]
"accessories": [
{
"accessory": "HttpPushRgb",
"name": "Single Color Light",
"service": "Light",
"switch": {
"status": "http://localhost/api/v1/status",
"powerOn": "http://localhost/api/v1/on",
"powerOff": "http://localhost/api/v1/off"
},
"color": {
"status": "http://localhost/api/v1/set",
"url": "http://localhost/api/v1/set/%s"
}
}
]
This normally will not occur, however, you may not want your application todisplay a "brightness" slider to the user. In this case, you will want toremove the brightness component from the config.
Following configuration is a real world example for a accessory that combines a shelly switch / relay with a hue light bulb. ON/OFF-Signals will be sent to the shelly switch. On the other hand, changes to brightness / color are going to the hue bulb.
"accessories": [
{
"accessory": "HttpPushRgb",
"name": "Full RGB Device with advanced SET / GET Handling",
"service": "Light",
"timeout": 3000,
"switch": {
"notificationID": "47110815",
"status": {
"url": "http://192.168.0.110/status",
"bodyRegEx": "\"ison\":true"
},
"powerOn": "http://192.168.0.110/relay/0?turn=on",
"powerOff": "http://192.168.0.110/relay/0?turn=off"
},
"brightness": {
"status": {
"url": "http://192.168.0.120/api/<apikey>/lights/6/",
"bodyRegEx": "\"bri\":([0-9]+)"
},
"url": {
"url":"http://192.168.0.120/api/<apikey>/lights/6/state",
"body": "{\"bri\": %s}"
},
"http_method": "PUT",
"max": 254
},
"color": {
"status": {
"url": "http://192.168.0.120/api/<apikey>/lights/6/",
"bodyRegEx": "\"bri\":([0-9]+)"
},
"url": {
"url":"http://192.168.0.120/api/<apikey>/lights/6/state",
"body": "{\"xy\": [%xy-x,%xy-y]}"
},
"brightness": false,
"http_method": "PUT"
}
}
]
"accessories": [
{
"accessory": "HttpPushRgb",
"name": "JSON body matching",
"service": "Light",
"switch": {
"status": {
"url": "http://localhost/api/v1/status",
"bodyRegEx": "\"switch\":\s*\"on\""
}
"powerOn": "http://localhost/api/v1/on",
"powerOff": "http://localhost/api/v1/off"
}
}
}
]
Key | Description | Default |
---|---|---|
accessory |
Must be "HttpPushRgb" | |
name |
The name of your RGB accessory. It will appear in the Home app | "RGB Light" |
service |
"Light" or "Switch" |
|
timeout (optional) |
Time (in milli seconds) until the accessory will be marked as "Not Responding" if it is unreachable. | 10000 |
http_method (optional) |
The HTTP method used for set requests only. Get HTTP requests are fixed to 'GET' for now. | "GET" |
username (optional) |
Username if http authentication is enabled on the RGB device. | |
password (optional) |
Password if http authentication is enabled on the RGB device. | |
notificationID (optional) |
Identifier to use when device sends push notifications. See Push notifications | |
notificationPassword (optional) |
Password to use when device sends push notifications. | |
switch |
A switch object | - |
brightness |
A brightness object | - |
color |
A color object | - |
Key | Description |
---|---|
status |
URL to get RGB current state (1 or 0 ) or a status object. |
powerOn |
URL to set the on state of the RGB device |
powerOff |
URL to set the off state of the RGB device |
Key | Description |
---|---|
url |
URL to retrieve switch status |
bodyRegEx |
Regular expression. When matched switch is considered "on". |
Key | Description |
---|---|
status |
URL to get RGB current brightness or a brightness status object. |
url |
URL to set the current brightness of the RGB device or a brightness url object. |
http_method (optional) |
The brightness specific HTTP method for set requests. If omitted defaults to http_method as specified in the root structure |
max (optional) |
This value specifies the maximum Integer for brightness. For example, Philips Hue returns 254 when brightness is at 100 % (default: 100) |
Key | Description |
---|---|
url |
URL to retrieve brightness status |
bodyRegEx (optional) |
Regular expression to extract the brightness out of a response body. Example: "bri":([0-9]+) |
Key | Description |
---|---|
url |
URL to set brightness status |
body |
relevant, if the http_method is PUT/POST. this body is sent to the url. you can use a placeholder (%s ) within the body. example: {"bri": %s} |
Key | Description |
---|---|
status |
URL to get RGB current colour (HEX value) or a color status object. |
url |
URL to set the RGB colour value (HEX value) or a color url object. |
brightness |
Whether or not the plugin should include brightness data in color HEX data (true or false ). When true brightness will be controllable in HomeKit but will be changed through changing RGB values. |
http_method (optional) |
The brightness specific HTTP method for set requests. If omitted defaults to http_method as specified in the root structure |
Key | Description |
---|---|
url |
URL to retrieve color status |
bodyRegEx (optional) |
Not yet supported |
Key | Description |
---|---|
url |
URL to set color status |
body |
relevant, if the http_method is PUT/POST. this body will be sent to the url. you can use following placeholders: %s (hex-rgb), %xy-x , %xy-y . Example: {"xy": [%xy-x,%xy-y]} or {"rgb": "%s"} |
All .status
urls expect a 200 HTTP status code.
switch.status
Can be configured to parse the body to determine the switchstatus. When the specified switch.status.bodyRegEx
matches the body theswitch is considered to be in the on status. If this parameter is left outswitch.status
expects 0
for Off, and 1
for On.
All other .status
urls expect a body of a singlestring with no HTML markup.
brightness.status
expects a number from 0 to 100.color.status
expects a 6-digit hexidemial number.This accessory supports push notification from the physical device viahomebridge-http-notification-server. This allows the device to modify theswitch's status by pushing the new status instead of Homebridge pulling it.This can be realized by supplying the notificationID
as part of this accesory's configuration.Your device should then push the On
characteristic
towards the notification server.E.g. a POST request towards http://<homebridge-host>:<notification-server-port>/<notificationID>
with the followingbody:
{
"characteristic": "On",
"value": true
}
To get more details about the push configuration have a look at the notification server'sREADME.
英文原方: https://pushmodule.slact.net/protocol.html 简单的HTTP推协议 1 介绍 1.1目的 本协议的初衷是提供一种HTTP客户端透明长连接的支持,在服务端连接大部分时间都是空闲的,也不会被中继传递。 1.2 一般性的说明 略 1.3 术语 本规范使用一系列的名词来指代协议中的碰到的对象
homebridge-http-rgb-bulb Supports HTTP/HTTPS devices on Homebridge Platform. This plugin requires/uses a simple interface with the enpoint (only a set color URI and a get color URI). I decided to crea
ESP32 RGB LED for homebridge This is a project made for homebridge-better-http-rgb on HomeBridge. HTTP server implemented from lwip-allnetworks. Sample HomeBridge config: { "bridge": { "name
homebridge-fake-rgb An homebridge plugin that create an Fake RGB Bulb HomeKit accessory Installation Follow the instruction in homebridge for the homebridge server installation. The plugin is publishe
homebridge-gpio-rgb-ledstrip RPi GPIO based LED Strip plugin for Homebridge Due to all the changes and updated that have occured in Homebridge since the original release of this plugin, i decided to r
homebridge-http-lightbulb Plugin homebridge-http-lightbulb is a Homebridge plugin with which you can configureHomeKit light bulbs which forward any requests to a defined http server. This comes in han
homebridge-http-switch Plugin homebridge-http-switch is a Homebridge plugin with which you can configureHomeKit switches which forward any requests to a defined http server. This comes in handy when y