{"id":15018209,"url":"https://github.com/supereg/homebridge-http-switch","last_synced_at":"2025-04-05T06:02:26.809Z","repository":{"id":23048909,"uuid":"98018715","full_name":"Supereg/homebridge-http-switch","owner":"Supereg","description":"Powerful http switch for Homebridge: https://github.com/homebridge/homebridge","archived":false,"fork":false,"pushed_at":"2024-02-22T03:41:50.000Z","size":294,"stargazers_count":224,"open_issues_count":21,"forks_count":37,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-03-29T05:06:38.835Z","etag":null,"topics":["hap","homebridge","homebridge-http","homebridge-plugin","homekit","http","http-switch","javascript","mqtt","mqtt-smarthome","notifications","regex","switch","toggle-switch"],"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/Supereg.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-22T08:40:10.000Z","updated_at":"2025-03-02T19:55:16.000Z","dependencies_parsed_at":"2024-05-15T12:16:14.012Z","dependency_job_id":"e46ebb0d-f80c-4cfe-a668-6830fd6d1396","html_url":"https://github.com/Supereg/homebridge-http-switch","commit_stats":{"total_commits":176,"total_committers":5,"mean_commits":35.2,"dds":"0.045454545454545414","last_synced_commit":"8658029a0cbed16e2952efc9a359ce059f602987"},"previous_names":[],"tags_count":56,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Supereg%2Fhomebridge-http-switch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Supereg%2Fhomebridge-http-switch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Supereg%2Fhomebridge-http-switch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Supereg%2Fhomebridge-http-switch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Supereg","download_url":"https://codeload.github.com/Supereg/homebridge-http-switch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246140581,"owners_count":20729802,"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","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-switch","javascript","mqtt","mqtt-smarthome","notifications","regex","switch","toggle-switch"],"created_at":"2024-09-24T19:51:40.007Z","updated_at":"2025-03-29T05:06:48.704Z","avatar_url":"https://github.com/Supereg.png","language":"JavaScript","funding_links":["https://github.com/sponsors/Supereg"],"categories":[],"sub_categories":[],"readme":"# homebridge-http-switch Plugin\n\n[![npm](https://img.shields.io/npm/v/homebridge-http-switch?style=for-the-badge)](https://www.npmjs.com/package/homebridge-http-switch)\n[![npm](https://img.shields.io/npm/dt/homebridge-http-switch?style=for-the-badge)](https://www.npmjs.com/package/homebridge-http-switch)\n[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/Supereg/homebridge-http-switch/Node-CI?style=for-the-badge)](https://github.com/Supereg/homebridge-http-switch/actions?query=workflow%3A%22Node-CI%22)\n[![GitHub issues](https://img.shields.io/github/issues/Supereg/homebridge-http-switch?style=for-the-badge)](https://github.com/Supereg/homebridge-http-switch/issues)\n[![GitHub pull requests](https://img.shields.io/github/issues-pr/Supereg/homebridge-http-switch?style=for-the-badge)](https://github.com/Supereg/homebridge-http-switch/pulls)\n\n\n`homebridge-http-switch` is a [Homebridge](https://github.com/nfarina/homebridge) plugin with which you can configure \nHomeKit switches 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`homebridge-http-switch` supports three different type of switches. A normal `stateful` switch and two variants of \n_stateless_ switches (`stateless` and `stateless-reverse`) which differ in their original position. For stateless switches \nyou can specify multiple urls to be targeted when the switch is turned On/Off.   \nMore about on how to configure such switches can be read further down.\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-switch`\n\n```\nsudo npm install -g homebridge-http-switch\n```\n\n## Updating the switch state in HomeKit\n\nThe _'On'_ characteristic from the _'switch'_ service has the permission to `notify` the HomeKit controller of state \nchanges. `homebridge-http-switch` supports two ways 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-switch` requests the \nstate of the switch in an specified interval (pulling) and sends the value to HomeKit.  \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-switch` whenever \nthe value changes. This is more efficient as the new value is updated instantly and `homebridge-http-switch` 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-switch` 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.  \nFor [shelly.cloud](https://shelly.cloud) devices mqtt is the best and only option to implement push-updates.\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- `name` \\\u003cstring\\\u003e **required**: Defines the name which is later displayed in HomeKit\n- `switchType` \\\u003cstring\\\u003e **optional** \\(Default: **\"stateful\"**\\): Defines the type of the switch:\n    * **\"stateful\"**: A normal switch and thus the default value.\n    * **\"stateless\"**: A stateless switch remains in only one state. If you switch it to on, it immediately goes back to off. \n    Configuration example is further [down](#stateless-switch).\n    * **\"stateless-reverse\"**: Default position is ON. If you switch it to off, it immediately goes back to on. \n    Configuration example is further [down](#reverse-stateless-switch).\n    * **\"toggle\"**: The toggle switch is a stateful switch however does not use the `statusUrl` to determine the current \n    state. It uses the last set state as the current state. Default position is OFF.\n    * **\"toggle-reverse\"\"**: Same as **\"toggle\"** but switch default position is ON.\n\n* `onUrl` \\\u003cstring | \\[string\\] | [urlObject](#urlobject) | [[urlObject](#urlobject)]\\\u003e **required**: Defines the url \n(and other properties when using an urlObject) which is called when you turn on the switch.\n* `offUrl` \\\u003cstring | \\[string\\] | [urlObject](#urlobject) | [[urlObject](#urlobject)]\\\u003e **required**: Defines the url \n(and other properties when using an urlObject) which is called when you turn off the switch.\n* `statusUrl` \\\u003cstring | [urlObject](#urlobject)\\\u003e **required**: Defines the url \n(and other properties when using an urlObject) to query the current state from the switch. By default it expects the http \nserver to return **'1'** for ON and **'0'** for OFF leaving out any html markup.  \nYou can change this using `statusPattern` option.  \n\n#### Advanced configuration options:\n\n- `serialNumber` \\\u003cstring\\\u003e **optional** \\(Default: **\"SW01\"**\\): Defines a custom serial number shown in the home app.\n- `statusPattern` \\\u003cstring\\\u003e **optional** \\(Default: **\"1\"**\\): Defines a regex pattern which is compared to the body of the `statusUrl`.\nWhen matching the status of the switch is set to ON otherwise OFF. [Some examples](#examples-for-custom-statuspatterns).\n- `statusCache` \\\u003cnumber\\\u003e **optional** \\(Default: **0**\\): Defines the amount of time in milliseconds a queried state \n of the switch 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- `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 `onUrl`, `offUrl` and `statusUrl`.  \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 must include a proper `WWW-Authenticate` header.  \n        Digest authentication requires this property to be set to **false**!\n- `httpMethod` _**deprecated**_ \\\u003cstring\\\u003e **optional**: If defined it sets the http method for `onUrl` and `offUrl`. \nThis property is deprecated and only present for backwards compatibility. It is recommended to use an \n[[urlObject](#urlobject)] to set the http method per url.\n\n* `timeout` \\\u003cinteger\\\u003e **optional** \\(Default: **1000**\\): When using a stateless switch this timeout in \n**milliseconds** specifies the time after which the switch is reset back to its original state.\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 only supported when `switchType` is **\"stateful\"**)\n\n- `mqtt` \\\u003c[mqttObject](#mqttobject)\\\u003e **optional**: Defines all properties used for mqtt connection.\n                                                     See [mqttObject](#mqttobject).\n\n* `multipleUrlExecutionStrategy` \\\u003cstring\\\u003e **optional** \\(Default: **\"parallel\"**\\): Defines the strategy used when \nexecuting multiple urls. The following are available:\n    * **\"parallel\"**: All urls are executed in parallel. No particular order is guaranteed. Execution as fast as possible.\n    * **\"series\"**: All urls are executed in the given order. Each url must complete first before the next one is executed.  \n    When using series execution you can also have a look at the [delay url](#the-delay-url).\n\n- `debug` \\\u003cboolean\\\u003e **optional**: If set to true debug mode is enabled and the plugin prints more detailed information.\n\nBelow are two example configurations. One is using simple string urls and the other is using simple urlObjects.  \nBoth configs can be used for a basic plugin configuration.\n\n```json\n{\n    \"accessories\": [\n        {\n          \"accessory\": \"HTTP-SWITCH\",\n          \"name\": \"Switch\",\n          \n          \"switchType\": \"stateful\",\n          \n          \"onUrl\": \"http://localhost/api/switchOn\",\n          \"offUrl\": \"http://localhost/api/switchOff\",\n          \n          \"statusUrl\": \"http://localhost/api/switchStatus\"\n        }   \n    ]\n}\n```\n\n```json\n{\n    \"accessories\": [\n        {\n          \"accessory\": \"HTTP-SWITCH\",\n          \"name\": \"Switch\",\n          \n          \"switchType\": \"stateful\",\n          \n          \"onUrl\": {\n            \"url\": \"http://localhost/api/switchOn\",\n            \"method\": \"GET\"\n          },\n          \"offUrl\": {\n            \"url\": \"http://localhost/api/switchOff\",\n            \"method\": \"GET\"\n          },\n          \n          \"statusUrl\": {\n            \"url\": \"http://localhost/api/switchStatus\",\n            \"method\": \"GET\"\n          }\n        }   \n    ]\n}\n```\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. If 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* `requestTimeout` \\\u003cnumber\\\u003e **optional** \\(Default: **20000**\\): Time in milliseconds specifying timeout (Time to wait\n    for http response and also setting socket timeout).\n* `repeat` \\\u003cnumber\\\u003e **optional** \\(Default: **1**\\): Defines how often the execution of this urlObject should \n    be repeated.  \n    Notice that this property only has an effect on ulrObject specified in `onUrl` or `offUrl`.\n    Also have a look at the `multipleUrlExecutionStrategy` property. Using \"parallel\" execution could result in\n    unpredictable behaviour.\n* `delayBeforeExecution` \\\u003cnumber\\\u003e **optional** \\(Default: **0**\\): Defines the time in milliseconds to wait \n    before executing the urlObject.  \n    Notice that this property only has an effect on ulrObject specified in `onUrl` or `offUrl`.\n    Also have a look at the `multipleUrlExecutionStrategy` property.\n  \nBelow is an example of an urlObject containing the basic 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 switch 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}\n```\n\n### Stateless Switch\n\nSince **OFF** is the only possible state you do not need to declare `offUrl` and `statusUrl`\n\n```json\n{\n    \"accessories\": [\n        {\n          \"accessory\": \"HTTP-SWITCH\",\n          \"name\": \"Switch\",\n          \n          \"switchType\": \"stateless\",\n          \n          \"timeout\": 1000,\n          \n          \"onUrl\": \"http://localhost/api/switchOn\"\n        }   \n    ]\n}  \n```\n\n### Reverse Stateless Switch\n\nSince **ON** is the only possible state you do not need to declare `onUrl` and `statusUrl`\n\n```json\n{\n    \"accessories\": [\n        {\n          \"accessory\": \"HTTP-SWITCH\",\n          \"name\": \"Switch\",\n          \n          \"switchType\": \"stateless-reverse\",\n          \n          \"timeout\": 1000,\n          \n          \"offUrl\": \"http://localhost/api/switchOff\"\n        }   \n    ]\n}\n```\n\n### Multiple On or Off Urls\nIf you wish to do so you can specify an array of urls or urlObjects (`onUrl` or `offUrl`) when your switch is a \n**stateless switch** or a **reverse-stateless switch**.  \n**This is not possible with a normal stateful switch.**\n\nBelow are two example configurations of an stateless switch with three urls. \nOne is using simple string array and the other is using simple urlObject arrays. \n\n```json\n{\n    \"accessories\": [\n        {\n          \"accessory\": \"HTTP-SWITCH\",\n          \"name\": \"Switch\",\n          \n          \"switchType\": \"stateless\",\n          \"onUrl\": [\n            \"http://localhost/api/switch1On\",\n            \"http://localhost/api/switch2On\",\n            \"http://localhost/api/switch3On\"\n          ]\n        }   \n    ]\n}\n```\n```json\n{\n    \"accessories\": [\n        {\n          \"accessory\": \"HTTP-SWITCH\",\n          \"name\": \"Switch\",\n          \n          \"switchType\": \"stateless\",\n          \"onUrl\": [\n            {\n              \"url\": \"http://localhost/api/switch1On\"\n            },\n            {\n              \"url\": \"http://localhost/api/switch2On\"\n            },\n            {\n              \"url\": \"http://localhost/api/switch3On\"\n            }\n          ]\n        }   \n    ]\n}\n```\n\n#### The 'delay(...)' url\n\nWhen using multiple urls and **\"series\"** as `multipleUrlExecutionStrategy` you can also specify so called delay urls in the \n`onUrl` or `offUrl` arrays. This could be used to guarantee a certain delay between two urls.  \nThe delay url has the following pattern: **\"delay(INTEGER)\"** where 'INTEGER' is replaced with the delay in milliseconds.\n\nHere is an example:\n```json\n{\n    \"accessories\": [\n        {\n          \"accessory\": \"HTTP-SWITCH\",\n          \"name\": \"Delayed Switch\",\n          \n          \"switchType\": \"stateless\",\n          \"multipleUrlExecutionStrategy\": \"series\",\n          \n          \"onUrl\": [\n            \"http://localhost/api/switch1On\",\n            \"delay(1000)\",\n            \"http://localhost/api/switch2On\"\n          ]\n        }   \n    ]\n}\n```\n\n### Examples for custom statusPatterns\n\nThe `statusPattern` property can be used to change the phrase which is used to identify if the switch should be turned on \nor off. So when you want the switch to be turned on when your server sends **\"true\"** in the body of the http response you\ncould specify the following pattern:\n```json\n{\n    \"statusPattern\": \"true\"\n}\n```\n\nHowever using Regular Expressions much more complex patterns are possible. Let's assume your http enabled device responds \nwith the following json string as body, where one property has an random value an the other indicates the status of the \nswitch:\n```json\n{\n    \"perRequestRandomValue\": 89723789,\n    \"switchState\": true\n}\n```\nThen you could use the following pattern:\n```json\n{\n    \"statusPattern\": \"{\\n    \\\"perRequestRandomValue\\\": [0-9]+,\\n    \\\"switchState\\\": true\\n}\"\n}\n```\n**Note:** The `statusPattern` must be placed on the same level as the `statusUrl` property, not inside the `statusUrl` object. See below for example.\n\n```json\n{\n    \"statusUrl\": {\n     },\n    \"statusPattern\": \"....\",\n}\n```\n\nMore on how to build regex patterns: https://www.w3schools.com/jsref/jsref_obj_regexp.asp\n\n## Notification Server\n\n`homebridge-http-switch` 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-switch` to work with your implementation of the \n`homebridge-http-notification-server`.\n\n```json\n{\n    \"accessories\": [\n        {\n          \"accessory\": \"HTTP-SWITCH\",\n          \"name\": \"Switch\",\n          \n          \"notificationID\": \"my-switch\",\n          \"notificationPassword\": \"superSecretPassword\",\n          \n          \"onUrl\": \"http://localhost/api/switchOn\",\n          \"offUrl\": \"http://localhost/api/switchOff\",\n          \n          \"statusUrl\": \"http://localhost/api/switchStatus\"\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsupereg%2Fhomebridge-http-switch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsupereg%2Fhomebridge-http-switch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsupereg%2Fhomebridge-http-switch/lists"}