{"id":29771512,"url":"https://github.com/homebridge-plugins/homebridge-http-lightbulb","last_synced_at":"2025-10-17T19:00:13.647Z","repository":{"id":23211547,"uuid":"98437574","full_name":"homebridge-plugins/homebridge-http-lightbulb","owner":"homebridge-plugins","description":"Powerful http lightbulb for Homebridge: https://github.com/homebridge/homebridge","archived":false,"fork":false,"pushed_at":"2023-03-02T21:16:39.000Z","size":324,"stargazers_count":23,"open_issues_count":8,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-25T22:49:12.737Z","etag":null,"topics":["hap","homebridge","homebridge-http","homebridge-plugin","homekit","http","http-lighbulb","http-light","javascript","light","lightbulb","mqtt","mqtt-smarthome","notifications","regex"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/homebridge-plugins.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"Supereg"}},"created_at":"2017-07-26T15:20:12.000Z","updated_at":"2025-08-21T06:00:21.000Z","dependencies_parsed_at":"2024-10-03T13:14:29.045Z","dependency_job_id":"babbb901-7f51-4a8e-adca-46f60e20f1e2","html_url":"https://github.com/homebridge-plugins/homebridge-http-lightbulb","commit_stats":null,"previous_names":["bauer-andreas/homebridge-http-lightbulb","homebridge-plugins/homebridge-http-lightbulb"],"tags_count":34,"template":false,"template_full_name":null,"purl":"pkg:github/homebridge-plugins/homebridge-http-lightbulb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homebridge-plugins%2Fhomebridge-http-lightbulb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homebridge-plugins%2Fhomebridge-http-lightbulb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homebridge-plugins%2Fhomebridge-http-lightbulb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homebridge-plugins%2Fhomebridge-http-lightbulb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/homebridge-plugins","download_url":"https://codeload.github.com/homebridge-plugins/homebridge-http-lightbulb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homebridge-plugins%2Fhomebridge-http-lightbulb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279401658,"owners_count":26163296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-17T02:00:07.504Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hap","homebridge","homebridge-http","homebridge-plugin","homekit","http","http-lighbulb","http-light","javascript","light","lightbulb","mqtt","mqtt-smarthome","notifications","regex"],"created_at":"2025-07-27T06:39:52.046Z","updated_at":"2025-10-17T19:00:13.620Z","avatar_url":"https://github.com/homebridge-plugins.png","language":"JavaScript","funding_links":["https://github.com/sponsors/Supereg"],"categories":[],"sub_categories":[],"readme":"# homebridge-http-lightbulb Plugin\n\n[![npm](https://img.shields.io/npm/v/homebridge-http-lightbulb?style=for-the-badge)](https://www.npmjs.com/package/homebridge-http-lightbulb)\n[![npm](https://img.shields.io/npm/dt/homebridge-http-lightbulb?style=for-the-badge)](https://www.npmjs.com/package/homebridge-http-lightbulb)\n[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/Supereg/homebridge-http-lightbulb/Node-CI?style=for-the-badge)](https://github.com/Supereg/homebridge-http-lightbulb/actions?query=workflow%3A%22Node-CI%22)\n[![GitHub issues](https://img.shields.io/github/issues/Supereg/homebridge-http-lightbulb?style=for-the-badge)](https://github.com/Supereg/homebridge-http-lightbulb/issues)\n[![GitHub pull requests](https://img.shields.io/github/issues-pr/Supereg/homebridge-http-lightbulb?style=for-the-badge)](https://github.com/Supereg/homebridge-http-lightbulb/pulls)\n\n\n`homebridge-http-lightbulb` is a [Homebridge](https://github.com/nfarina/homebridge) plugin with which you can configure \nHomeKit light bulbs which forward any requests to a defined http server. This comes in handy when you already have home \nautomated equipment which can be controlled via http requests. Or you have built your own equipment, for example some sort \nof lightning controlled with an wifi enabled Arduino board which than can be integrated via this plugin into Homebridge.\n\n## Installation\n\nFirst of all you need to have [Homebridge](https://github.com/nfarina/homebridge) installed. Refer to the repo for \ninstructions.  \nThen run the following command to install `homebridge-http-lightbulb`\n\n```\nsudo npm install -g homebridge-http-lightbulb\n```\n\n## Updating the light bulb state in HomeKit\n\nAll characteristic from the _'lightbulb'_ service have the permission to `notify` the HomeKit controller of state \nchanges. `homebridge-http-lightbulb` supports two concepts to send state changes to HomeKit.\n\n### The 'pull' way:\n\nThe 'pull' way is probably the easiest to set up and supported in every scenario. `homebridge-http-lightbulb` requests the \nstate of the light in an specified interval (pulling) and sends the value to HomeKit. \nHowever the pull way is currently only supported for the _'On'_ characteristic!  \nLook for `pullInterval` in the list of configuration options if you want to configure it.\n\n### The 'push' way:\n\nWhen using the 'push' concept, the http device itself sends the updated value to `homebridge-http-lightbulb` whenever \nvalues change. This is more efficient as the new value is updated instantly and `homebridge-http-lightbulb` does not \nneed to make needless requests when the value didn't actually change.  \nHowever because the http device needs to actively notify the `homebridge-http-lightbulb` there is more work needed \nto implement this method into your http device. \n\n#### Using MQTT:\n\nMQTT (Message Queuing Telemetry Transport) is a protocol widely used by IoT devices. IoT devices can publish messages\non a certain topic to the MQTT broker which then sends this message to all clients subscribed to the specified topic.\nIn order to use MQTT you need to setup a broker server ([mosquitto](https://github.com/eclipse/mosquitto) is a solid \nopen source MQTT broker running perfectly on a device like the Raspberry Pi) and then instruct all clients to \npublish/subscribe to it.\n\n#### Using 'homebridge-http-notification-server':\n\nFor those of you who are developing the http device by themselves I developed a pretty simple 'protocol' based on http \nto send push-updates.   \nHow to implement the protocol into your http device can be read in the chapter \n[**Notification Server**](#notification-server)\n\n## Configuration:\n\nThe configuration can contain the following properties:\n\n##### Basic configuration options:\n\n- `accessory` \\\u003cstring\\\u003e **required**: Defines the plugin used and must be set to **\"HTTP-LIGHTBULB\"** for this plugin.\n- `name` \\\u003cstring\\\u003e **required**: Defines the name which is later displayed in HomeKit\n\n* `onUrl` \\\u003cstring | [urlObject](#urlobject)\\\u003e **required**: Defines the url (and other properties when using \n    an urlObject) which is called when you turn on the light bulb.\n* `offUrl` \\\u003cstring | [urlObject](#urlobject)\\\u003e **required**: Defines the url (and other properties when using \n    an urlObject) which is called when you turn off the light bulb.\n* `statusUrl` \\\u003cstring | [urlObject](#urlobject)\\\u003e **required**: Defines the url (and other properties when using \n    an urlObject) to query the current power state from the light bulb. By default it expects the http server to \n    return **'1'** for ON and **'0'** for OFF leaving out any html markup.  \n    You can change this using `statusPattern` option (see below).\n* `statusPattern` \\\u003cstring\\\u003e **optional** \\(Default: **\"1\"**\\): Defines a regex pattern which is compared to the \n    body of the http response from the `statusUrl`. When matching the status of the light bulb is set to ON otherwise OFF.  \n    [More about regex pattern](https://www.w3schools.com/jsref/jsref_obj_regexp.asp).\n\n- `brightness` \\\u003cobject\\\u003e **optional**: Defines everything related to the _'Brightness'_ characteristic:\n    - `setUrl` \\\u003cstring | [urlObject](#urlobject)\\\u003e **required**: Defines the url (and other properties when using\n        an urlObject) which is called when you set a new brightness level. The brightness is sent in the given unit.  \n        When including **%s** in the url and/or body it will be with the brightness to set.\n        Have a look at [placeholders](#placeholders-in-seturl-properties).\n    - `statusUrl` \\\u003cstring | [urlObject](#urlobject)\\\u003e **required**: Defines the url (and other properties when using \n        and urlObject) to query the current brightness level from the light bulb. By default it expects the http server \n        to return the brightness level in percent (range from 0-100). This can be changed with the `unit` property below.\n    - `unit` \\\u003cstring\\\u003e **optional** \\(Default: **\"percent\"**\\): Defines unit expected from the http server. The following \n        are available:\n        - **\"percent\"**: Using percent to calculate brightness level\n        - **\"rgb\"**: Using rgb style (range of 0-254) to calculate brightness level\n    - `statusPattern` \\\u003cstring\\\u003e **optional** \\(Default: **\"([0-9]{1,3})\"**): Defines a regex pattern with which the \n        brightness is extracted from the body of the http response from the `brightness.statusUrl`. The group which should\n        be extracted can be configured with the `brightness.patternGroupToExtract` property.\n    - `patternGroupToExtract` \u003c\\number\\\u003e **optional** \\(Default: **1**\\): Defines the regex group of which the brightness \n        is extracted.\n    - `withholdPowerUpdate` \u003c\\boolean\\\u003e **optional** \\(Default: **false**\\): The Home App has the quirk that when setting\n        brightness it also send a request to turn the lamp on immediately afterwards. This may be annoying behaviour for\n        some people. When this property is to to **true** the plugin prevents those requests.  \n        It only lets pass requests:\n        - (a) when brightness set to 0%. The http device will receive an 'off' requests\n        - (b) when the device is powered off and the brightness is set to something greater than 0%. The device will \n            receive an 'on' requests\n\n* `hue` \\\u003cobject\\\u003e **optional**: Defines everything related to the _'Hue'_ characteristic:\n    * `setUrl` \\\u003cstring | [urlObject](#urlobject)\\\u003e **required**: Defines the url (and other properties when using\n        an urlObject) which is called when you set a new hue.  \n        When including **%s** in the url and/or body it will be replaced with the hue to set.\n        Have a look at [placeholders](#placeholders-in-seturl-properties).\n    * `statusUrl` \\\u003cstring | [urlObject](#urlobject)\\\u003e **required**: Defines the url (and other properties when using \n        and urlObject) to query the current hue from the light bulb.\n    * `unit` \\\u003cstring\\\u003e **optional** \\(Default: **\"hsv\"**\\): Defines unit expected from the http server. The following \n        are available:\n        - **\"hsv\"**: Using standard representation of hue in the HSV system (0-360 degree)\n        - **\"zigbee\"**: Using a presentation which is popular in Zigbee bridges like the Phillips Hue bridge.\n            The representation of 0-360 is mapped to a range of 0-65535.\n    * `statusPattern` \\\u003cstring\\\u003e **optional** \\(Default: **\"([0-9]{1,3})\"** [**\"/([0-9]{1,5})/\"** when using zigbee unit]): \n        Defines a regex pattern with which the hue is extracted from the body of the http response from the \n        `hue.statusUrl`. The group which should be extracted can be configured with the \n        `hue.patternGroupToExtract` property.\n    * `patternGroupToExtract` \u003c\\number\\\u003e **optional** \\(Default: **1**\\): Defines the regex group of which the hue \n        is extracted.\n\n- `saturation` \\\u003cobject\\\u003e **optional**: Defines everything related to the _'Saturation'_ characteristic:\n    - `setUrl` \\\u003cstring | [urlObject](#urlobject)\\\u003e **required**: Defines the url (and other properties when using\n        an urlObject) which is called when you set a new saturation level.  \n        When including **%s** in the url and/or body it will be replaced with the saturation to set.\n        Have a look at [placeholders](#placeholders-in-seturl-properties).\n    - `statusUrl` \\\u003cstring | [urlObject](#urlobject)\\\u003e **required**: Defines the url (and other properties when using \n        and urlObject) to query the current saturation level from the light bulb.\n    - `unit` \\\u003cstring\\\u003e **optional** \\(Default: **\"percent\"**\\): Defines unit expected from the http server. The following \n        are available:\n        - **\"percent\"**: Using percent to calculate saturation level\n        - **\"rgb\"**: Using rgb style (range of 0-254) to calculate saturation level\n    - `statusPattern` \\\u003cstring\\\u003e **optional** \\(Default: **\"([0-9]{1,3})\"**): Defines a regex pattern with which the \n        saturation is extracted from the body of the http response from the `saturation.statusUrl`. The group which should\n        be extracted can be configured with the `saturation.patternGroupToExtract` property.\n    - `patternGroupToExtract` \u003c\\number\\\u003e **optional** \\(Default: **1**\\): Defines the regex group of which the saturation \n        is extracted.\n\n* `colorTemperature` \\\u003cobject\\\u003e **optional**: Defines everything related to the _'ColorTemperature'_ characteristic:  \n    _Although the HAP documentation states, that when using `colorTemperature`, `hue` and `saturation` must not \n    be defined, using all three in combination works perfectly fine.  \n    When selecting something in the color selector the color is sent via the `Hue` and `Saturation` characteristics. \n    When selecting something in the temperature selector the temperature is sent via the `ColorTemperature` characteristic.  \n    If `colorTemperature` is not specified, the color temperature is sent via the `Hue` and `Saturation` characteristics._\n    * `setUrl` \\\u003cstring | [urlObject](#urlobject)\\\u003e **required**: Defines the url (and other properties when using\n        an urlObject) which is called when you set a new color temperature. The color temperature is sent in the given unit.  \n        When including **%s** in the url and/or body it will be replaced with the color temperature to set.\n        Have a look at [placeholders](#placeholders-in-seturl-properties).\n    * `statusUrl` \\\u003cstring | [urlObject](#urlobject)\\\u003e **required**: Defines the url (and other properties when using \n        and urlObject) to query the current color temperature from the light bulb. By default it expects the http server \n        to return the brightness level in mired. This can be changed with the `unit` property below.\n    * `unit` \\\u003cstring\\\u003e **optional** \\(Default: **\"mired\"**\\): Defines unit expected from the http server. The following \n        are available:\n        * **\"mired\"**: Using mired (more specifically _microreciprocal degree_) to calculate color temperature\n        * **\"kelvin\"**: Using Kelvin to calculate color temperature\n    * `minValue` \\\u003cnumber\\\u003e **optional** \\(Default: **50**\\): Defines the minimum supported temperature in the \n        given `unit`. The defaut is **50** mired or **20.000** Kelvin.\n    * `maxValue` \\\u003cnumber\\\u003e **optional** \\(Default: **400**\\): Defines the maximum supported temperature in the \n        given `unit`. The fault is **400** mired or **2.500** Kelvin.\n    * `statusPattern` \\\u003cstring\\\u003e **optional** \\(Default: **\"([0-9]{2,3})\"** \\[**\"([0-9]{4,5})\"** when using Kelvin\\]): Defines a regex pattern with which the \n        color temperature is extracted from the body of the http response from the `colorTemperature.statusUrl`. \n        The group which should be extracted can be configured with the `colorTemperature.patternGroupToExtract` property.\n    * `patternGroupToExtract` \u003c\\number\\\u003e **optional** \\(Default: **1**\\): Defines the regex group of which the color temperature \n        is extracted.\n\n##### Advanced configuration options:\n\n* `auth` \\\u003cobject\\\u003e **optional**: If your http server requires authentication, you can specify your credential in this \nobject. It uses those credentials for all http requests and thus overrides all possibly specified credentials inside \nan urlObject for any characteristic.  \nThe object can contain the following properties:\n    * `username` \\\u003cstring\\\u003e **required**\n    * `password` \\\u003cstring\\\u003e **required**\n    * `sendImmediately` \\\u003cboolean\\\u003e **optional** \\(Default: **true**\\): When set to **true** the plugin will send the \n        credentials immediately to the http server. This is best practice for basic authentication.  \n        When set to **false** the plugin will send the proper authentication header after receiving an 401 error code \n        (unauthenticated). The response from the http server must include a proper `WWW-Authenticate` header.  \n        Digest authentication requires this property to be set to **false**!\n\n- `statusCache` \\\u003cnumber\\\u003e **optional** \\(Default: **0**\\): Defines the amount of time in milliseconds a queried value \n   of the _On_ characteristic is cached before a new request is made to the http device.  \n   Default is **0** which indicates no caching. A value of **-1** will indicate infinite caching.\n- `brightnessCache` \\\u003cnumber\\\u003e **optional** \\(Default: **0**\\): Same as above, but for the _Brightness_ \n    characteristic\n- `hueCache` \\\u003cnumber\\\u003e **optional** \\(Default: **0**\\): Same as above, but for the _Hue_ characteristic\n- `saturationCache` \\\u003cnumber\\\u003e **optional** \\(Default: **0**\\): Same as above, but for the _Saturation_ \n    characteristic\n- `colorTemperatureCache` \\\u003cnumber\\\u003e **optional** \\(Default: **0**\\): Same as above, but for the \n    _ColorTemperature_ characteristic\n\n* `pullInterval` \\\u003cinteger\\\u003e **optional**: The property expects an interval in **milliseconds** in which the plugin \npulls updates from your http device. For more information read [pulling updates](#the-pull-way).  \n(This option is currently only supported for the _'On'_ characteristic!)\n* `mqtt` \\\u003c[mqttObject](#mqttobject)\\\u003e **optional**: Defines all properties used for mqtt connection ([More on MQTT](#using-mqtt)).  \n    For configuration see [mqttObject](#mqttobject).\n\n- `debug` \\\u003cboolean\\\u003e **optional**: If set to true debug mode is enabled and the plugin prints more detailed information.\n\nIn the [Examples](#examples) section are some example configurations to get you started.\n\n##### Experimental configuration options\n\nThe options in this section are all part of some experimental features and can change in any update.  \n\nI'm currently experimenting with allowing setting and querying device status with mqtt alongside http. \nSo that you are for example able to manage the ON characteristic fully over mqtt and the color and \nbrightness values over http. Currently this is only supported for the ON characteristic but I'm planning\nto add this for any combination of characteristics and in the long run also to get added into my \nhomebridge-http-switch plugin if everything works well.\n\n\n* `setPowerTopic` \\\u003cstring | object\\\u003e **optional**: Defines the mqtt topic to which a message is published when you\n    turn the light on or off. \n    * `topic` \\\u003cstring\\\u003e **required**:\n    * `qos` \\\u003cnumber\\\u003e **optional** \\(Default: **0**\\):\n    * `retain` \\\u003cboolean\\\u003e **optional** \\(Default: **false**\\):\n    * `dup` \\\u003cboolean\\\u003e **optional** \\(Default: **false**\\):\n    * `payloadFormatter` \\\u003cfunction body\\\u003e **optional**:\n* `getPowerTopic` \\\u003cstring | object\\\u003e **optional**: Defines the mqtt topic which is subscribed to in order\n    to receive updates of the current power state of the light.\n    * `topic` \\\u003cstring\\\u003e **required**:\n    * `qos` \\\u003cnumber\\\u003e **optional** \\(Default: **0**\\):\n    * `messagePattern` \\\u003cstring\\\u003e **optional**:\n    * `patternGroupToExtract` \\\u003cnumber\\\u003e **optional** \\(Default: **1**\\):\n\n##### Placeholders in `setUrl` properties\nOn every set there are the following placeholders available which will be replaced with the respective value.  \nNote that for example when the `setUrl` for the brightness characteristic is called, `%s` will be replaced with the \n**new** value and `%brightness` will be replaced with the **current**/**old** value.  \nThe value for the placeholders will be supplied in the specified unit.\n\n- `%s` will always be replaced with the **new** value which will be set for the current characteristic\n- `%brightness` - current brightness level\n- `%hue` - current hue\n- `%saturation` - current saturation\n- `%colorTemperature` - current color temperature (case sensitise)\n\n#### UrlObject\n\nA urlObject can have the following properties:\n* `url` \\\u003cstring\\\u003e **required**: Defines the url pointing to your http server\n* `method` \\\u003cstring\\\u003e **optional** \\(Default: **\"GET\"**\\): Defines the http method used to make the http request\n* `body` \\\u003cany\\\u003e **optional**: Defines the body sent with the http request. This is usually a string for maximum flexibility with [placeholders](#placeholders-in-seturl-properties). If the value is not a string, it will be\nconverted to a JSON string automatically.\n* `strictSSL` \\\u003cboolean\\\u003e **optional** \\(Default: **false**\\): If enabled the SSL certificate used must be valid and \nthe whole certificate chain must be trusted. The default is false because most people will work with self signed \ncertificates in their homes and their devices are already authorized since being in their networks.\n* `auth` \\\u003cobject\\\u003e **optional**: If your http server requires authentication you can specify your credential in this \nobject. When defined the object can contain the following properties:\n    * `username` \\\u003cstring\\\u003e **required**\n    * `password` \\\u003cstring\\\u003e **required**\n    * `sendImmediately` \\\u003cboolean\\\u003e **optional** \\(Default: **true**\\): When set to **true** the plugin will send the \n            credentials immediately to the http server. This is best practice for basic authentication.  \n            When set to **false** the plugin will send the proper authentication header after receiving an 401 error code \n            (unauthenticated). The response must include a proper `WWW-Authenticate` header.  \n            Digest authentication requires this property to be set to **false**!\n* `headers` \\\u003cobject\\\u003e **optional**: Using this object you can define any http headers which are sent with the http \nrequest. The object must contain only string key value pairs.  \n  \nBelow is an example of an urlObject containing all properties:\n```json\n{\n  \"url\": \"http://example.com:8080\",\n  \"method\": \"GET\",\n  \"body\": \"exampleBody\",\n  \n  \"strictSSL\": false,\n  \n  \"auth\": {\n    \"username\": \"yourUsername\",\n    \"password\": \"yourPassword\"\n  },\n  \n  \"headers\": {\n    \"Content-Type\": \"text/html\"\n  }\n}\n```\n\n#### MQTTObject\n\nA mqttObject can have the following properties:\n\n##### Basic configuration options:\n\n* `host` \\\u003cstring\\\u003e **required**: Defines the host of the mqtt broker.\n* `port` \\\u003cnumber\\\u003e **optional** \\(Default: **1883**\\): Defines the port of the mqtt broker.\n* `credentials` \\\u003cobject\\\u003e **optional**: Defines the credentials used to authenticate with the mqtt broker.\n    * `username` \\\u003cstring\\\u003e **required**\n    * `password` \\\u003cstring\\\u003e **optional**\n- `subscriptions` \\\u003cobject | array\\\u003e **required**: Defines an array (or one single object) of subscriptions.\n    - `topic` \\\u003cstring\\\u003e **required**: Defines the topic to subscribe to.\n    - `characteristic` \\\u003cstring\\\u003e **required**: Defines the characteristic this subscription updates.\n    - `messagePattern` \\\u003cstring\\\u003e **optional**: Defines a regex pattern. If `messagePattern` is not specified the \n        message received will be used as value. If the characteristic expects a boolean value it is tested if the \n        specified regex is contained in the received message. Otherwise the pattern is matched against the message \n        and the data from regex group can be extracted using the given `patternGroupToExtract`.\n    - `patternGroupToExtract` \\\u003cnumber\\\u003e **optional** \\(Default: **1**\\): Defines the regex group of which data is \n        extracted.\n\n##### Advanced configuration options:\n\n* `protocol` \\\u003cstring\\\u003e **optional** \\(Default: **\"mqtt\"**\\): Defines protocol used to connect to the mqtt broker\n* `qos` \\\u003cnumber\\\u003e **optional** \\(Default: **1**\\): Defines the Quality of Service (Notice, the QoS of the publisher \n           must also be configured accordingly).  \n           In contrast to most implementations the default value is **1**.\n    * `0`: 'At most once' - the message is sent only once and the client and broker take no additional steps to \n                            acknowledge delivery (fire and forget).\n    * `1`: 'At least once' - the message is re-tried by the sender multiple times until acknowledgement is \n                            received (acknowledged delivery).\n    * `2`: 'Exactly once' - the sender and receiver engage in a two-level handshake to ensure only one copy of the \n                            message is received (assured delivery).\n* `clientId` \\\u003cstring\\\u003e **optional** \\(Default: `'mqttjs_' + Math.random().toString(16).substr(2, 8)`\\): Defines clientId\n* `keepalive` \\\u003cnumber\\\u003e **optional** \\(Default: **60**\\): Time in seconds to send a keepalive. Set to 0 to disable.\n* `clean` \\\u003cboolean\\\u003e **optional** \\(Default: **true**\\): Set to false to receive QoS 1 and 2 messages while offline.\n* `reconnectPeriod` \\\u003cnumber\\\u003e **optional** \\(Default: **1000**\\): Time in milliseconds after which a reconnect is tried.\n* `connectTimeout` \\\u003cnumber\\\u003e **optional** \\(Default: **30000**\\): Time in milliseconds the client waits until the \n        CONNECT needs to be acknowledged (CONNACK).\n\nBelow is an example of an mqttObject containing the basic properties for a light bulb service:\n```json\n{\n  \"host\": \"127.0.0.1\",\n  \"port\": \"1883\",\n  \n  \"credentials\": {\n    \"username\": \"yourUsername\",\n    \"password\": \"yourPassword\"\n  },\n  \n  \"subscriptions\": [\n    {\n      \"topic\": \"your/topic/here\",\n      \"characteristic\": \"On\",\n      \"messagePattern\": \"on\"\n    },\n    {\n      \"topic\": \"your/other/topic/here\",\n      \"characteristic\": \"Brightens\",\n      \"messagePattern\": \"([0-9]{1,3})\"\n    }\n  ]\n}\n```\n\n### Examples\n\n#### Basic light bulb with power and brightness\nThis is a basic light bulb configuration supporting the required On and the optional brightness characteristic.  \nNote that every url is simply a string and are only examples. You could also define every url using a [urlObject](#urlobject).\n````json\n{\n  \"accessory\": \"HTTP-LIGHTBULB\",\n  \"name\": \"Light\",\n  \n  \"onUrl\": \"http://localhost/api/lightOn\",\n  \"offUrl\": \"http://localhost/api/lightOff\",\n  \"statusUrl\": \"http://localhost/api/lightStatus\",\n\n  \"brightness\": {\n    \"setUrl\": \"http://localhost/api/setBrightness?brightness=%s\",\n    \"statusUrl\": \"http://localhost/api/getBrightness\"\n  }\n}\n````\n\n#### Light bulb supporting color\n\n````json\n{\n  \"accessory\": \"HTTP-LIGHTBULB\",\n  \"name\": \"Light\",\n  \n  \"onUrl\": \"http://localhost/api/lightOn\",\n  \"offUrl\": \"http://localhost/api/lightOff\",\n  \"statusUrl\": \"http://localhost/api/lightStatus\",\n  \n  \"brightness\": {\n    \"setUrl\": \"http://localhost/api/setBrightness?brightness=%s\",\n    \"statusUrl\": \"http://localhost/api/getBrightness\"\n  },\n  \n  \"hue\": {\n    \"setUrl\": \"http://localhost/api/setHue?hue=%s\",\n    \"statusUrl\": \"http://localhost/api/getHue\"\n  },\n  \"saturation\": {\n    \"setUrl\": \"http://localhost/api/setSaturation?saturation=%s\",\n    \"statusUrl\": \"http://localhost/api/getSaturation\"\n  }\n}\n````\n\n#### Light bulb support color temperature\n````json\n{\n  \"accessory\": \"HTTP-LIGHTBULB\",\n  \"name\": \"Light\",\n  \n  \"onUrl\": \"http://localhost/api/lightOn\",\n  \"offUrl\": \"http://localhost/api/lightOff\",\n  \"statusUrl\": \"http://localhost/api/lightStatus\",\n    \n  \"brightness\": {\n    \"setUrl\": \"http://localhost/api/setBrightness?brightness=%s\",\n    \"statusUrl\": \"http://localhost/api/getBrightness\"\n  },\n  \n  \"colorTemperature\": {\n    \"setUrl\": \"http://localhost/api/setColorTemperature?temperature=%s\",\n    \"statusUrl\": \"http://localhost/api/getColorTemperature\",\n    \"unit\": \"mired\"\n  }\n}\n````\n\n#### Light bulb using body parameters\n````json\n{\n  \"accessory\": \"HTTP-LIGHTBULB\",\n  \"name\": \"Light\",\n  \"debug\": true,\n  \"onUrl\": {\n    \"url\": \"http://localhost/api/light\",\n    \"method\": \"PUT\",\n    \"body\": \"{ \\\"on\\\": 1 }\"\n  },\n  \"offUrl\": {\n    \"url\": \"http://localhost/api/light\",\n    \"method\": \"PUT\",\n    \"body\": \"{ \\\"on\\\": 0 }\"\n  },\n  \"statusUrl\": \"http://localhost/api/light\",\n  \"brightness\": {\n    \"statusUrl\": \"http://localhost/api/light\",\n    \"setUrl\": {\n      \"url\": \"http://localhost/api/light\",\n      \"method\": \"PUT\",\n      \"body\": \"{ \\\"brightness\\\": %s }\"\n    }\n  },\n  \"colorTemperature\": {\n    \"statusUrl\": \"http://localhost/api/light\",\n    \"unit\": \"mired\",\n    \"minValue\": 143,\n    \"maxValue\": 344,\n    \"setUrl\": {\n      \"url\": \"http://localhost/api/light\",\n      \"method\": \"PUT\",\n      \"body\": \"{\\\"temperature\\\": %s }\"\n    }\n  }\n}\n````\n\n## Notification Server\n\n`homebridge-http-lightbulb` can be used together with \n[homebridge-http-notification-server](https://github.com/Supereg/homebridge-http-notification-server) in order to receive\nupdates when the state changes at your external program. For details on how to implement those updates and how to \ninstall and configure `homebridge-http-notification-server`, please refer to the \n[README](https://github.com/Supereg/homebridge-http-notification-server) of the repository first.\n\nDown here is an example on how to configure `homebridge-http-lightbulb` to work with your implementation of the \n`homebridge-http-notification-server`.\n\n```json\n{\n    \"accessories\": [\n        {\n          \"accessory\": \"HTTP-LIGHTBULB\",\n          \"name\": \"Light\",\n          \n          \"notificationID\": \"my-switlightch\",\n          \"notificationPassword\": \"superSecretPassword\",\n          \n          \"onUrl\": \"http://localhost/api/lightOn\",\n          \"offUrl\": \"http://localhost/api/lightOff\",\n          \n          \"statusUrl\": \"http://localhost/api/lightStatus\"\n        }   \n    ]\n}\n```\n\n* `notificationID` is an per Homebridge instance unique id which must be included in any http request.  \n* `notificationPassword` is **optional**. It can be used to secure any incoming requests.\n\nTo get more details about the configuration have a look at the \n[README](https://github.com/Supereg/homebridge-http-notification-server).\n\n**Available characteristics (for the POST body)**\n\nDown here are all characteristics listed which can be updated with an request to the `homebridge-http-notification-server`\n\n* `characteristic` \"On\": expects a boolean `value`\n* `characteristic` \"Brightness\": expects a number `value` in mired\n* `characteristic` \"Hue\": expects a number `value`\n* `characteristic` \"Saturation\": expects a number `value`\n* `characteristic` \"ColorTemperature\": expects a number `value` TODO\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhomebridge-plugins%2Fhomebridge-http-lightbulb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhomebridge-plugins%2Fhomebridge-http-lightbulb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhomebridge-plugins%2Fhomebridge-http-lightbulb/lists"}