{"id":13583507,"url":"https://github.com/Djelibeybi/homebridge-button-platform","last_synced_at":"2025-04-06T21:32:13.822Z","repository":{"id":37070426,"uuid":"241781727","full_name":"Djelibeybi/homebridge-button-platform","owner":"Djelibeybi","description":"A Homebridge platform plugin to create virtual buttons that respond to HTTP requests from things like Flic buttons or an Elgato Stream Deck.","archived":true,"fork":false,"pushed_at":"2022-11-07T03:07:52.000Z","size":488,"stargazers_count":59,"open_issues_count":8,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-09T12:56:31.358Z","etag":null,"topics":["elgato-stream-deck","flic","flic-buttons","flic-hub-lr","homebridge","homebridge-plugin","homekit-support","http","rest-api","streamdeck","virtual-buttons"],"latest_commit_sha":null,"homepage":"https://omg.dje.li/homebridge-button-platform/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Djelibeybi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-20T03:12:48.000Z","updated_at":"2025-02-24T00:22:22.000Z","dependencies_parsed_at":"2023-01-20T13:31:43.171Z","dependency_job_id":null,"html_url":"https://github.com/Djelibeybi/homebridge-button-platform","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Djelibeybi%2Fhomebridge-button-platform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Djelibeybi%2Fhomebridge-button-platform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Djelibeybi%2Fhomebridge-button-platform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Djelibeybi%2Fhomebridge-button-platform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Djelibeybi","download_url":"https://codeload.github.com/Djelibeybi/homebridge-button-platform/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247555709,"owners_count":20957825,"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":["elgato-stream-deck","flic","flic-buttons","flic-hub-lr","homebridge","homebridge-plugin","homekit-support","http","rest-api","streamdeck","virtual-buttons"],"created_at":"2024-08-01T15:03:31.717Z","updated_at":"2025-04-06T21:32:13.531Z","avatar_url":"https://github.com/Djelibeybi.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# Button Platform for Homebridge\n\n\u003e **ARCHIVED** This plugin is no longer updated.\n\nThis Homebridge platform plugin creates virtual buttons that can be triggered\nusing HTTP requests. It was originally created to provide HomeKit support for\n[Flic smart buttons](https://flic.io/) before the Flic Hub LR got native HomeKit\nsupport but can be leveraged by anything that can send HTTP requests.\n\n\u003e **Flic Hub LR now supports HomeKit**: Flic released a firmware update for the\nFlic Hub LR on 2 December 2020 which included native HomeKit support.\nVisit \u003chttps://flic.io/homekit\u003e for instructions on how to configure native\nHomeKit access.\n\n**This plugin requires a working home hub.**\n\nBefore you install, ensure you have [setup a HomePod, HomePod mini, Apple TV or\niPad as a home hub](https://support.apple.com/en-au/HT207057) for HomeKit. A\nhome hub is required to run automations triggered by the button events generated\nby this plugin.\n\n## Install\n\nThe simplest method to install and configure this plugin is via\n[`homebridge-config-ui-x`](https://www.npmjs.com/package/homebridge-config-ui-x).\n\nTo install manually, run the following command in your Homebridge directory.\nDepending on how you installed Homebridge, you may need to add the `-g` and/or\nthe `--unsafe-perms` parameters:\n\n```shell\nnpm install [-g|--unsafe-perms] homebridge-button-platform\n```\n\nThe `-g` option will install the plugin globally and the `--unsafe-perms` option\nis needed for some platforms to install successfully.\n\n## Configuration\n\nThe plugin can be configured via the [`homebridge-config-ui-x`](https://www.npmjs.com/package/homebridge-config-ui-x)\nadmin interface.\n\nTo configure the plugin manually, add the following configuration to the\n`platforms` block of your Homebridge `config.json` file:\n\n```json\n\"platforms\": [\n    {\n        \"platform\": \"button-platform\",\n        \"port\": 3001,\n        \"buttons\": [\n            \"My Button\",\n            \"Your Button\",\n            \"Their Button\"\n        ]\n    }\n  ]\n```\n\nYou can add as many buttons to the array as you need. Each button will get its\nown URI on which the server will listen for events. You can determine the URI\nfor each button by checking the Homebridge logs for\n`The Event URI for \u003cbutton name\u003e is: /button-button-name` strings.\n\n\u003e **Note:** renaming a button in `config.json` is the same as deleting the old\nbutton and adding a new one, i.e. any configuration will be lost.\n\n## Sending events\n\nTo trigger a button event, send an HTTP `GET` request with a specific query\nstring value or an HTTP `POST` request to your Homebridge hostname or IP address\nand the port specified in the configuration of the platform, plus the URI for the\nbutton.\n\n### Using a `GET` request\n\nThe simplest method of triggering an event is to use a simple `GET` request with\nthe query string parameter of `event` set to one of the valid event types:\n\n* `click` or `single-press`\n* `double-click` or `double-press`\n* `hold` or `long-press`\n\nFor example, to send a single click event to a button using `curl`:\n\n```shell\n$ curl http://\u003chomebridge\u003e:\u003cport\u003e/uri?event=click\nSuccess\n```\n\nYou could also use this URL with a normal web browser.\n\n### Example Flic button configuration\n\nHere’s a screenshot of what an Internet Request action should look like in the\nFlic app if your Homebridge server is `homebridge.local` and the plugin\nwas listening on port 3001:\n\n![flic-config](docs/flic-config.png)\n\nThe values are as follows:\n\n| Field | Value |\n|:------|:------|\n| Hub Action | **Internet Request** |\n| URL | `http://homebridge.local:3001/button-name?event=click` |\n| Type | **GET** |\n\n### Battery level\n\nThe plugin from v1.5 onwards automatically creates a\nbattery service when it detects it's being triggered by a Flic button and will\nupdate the battery level with the current value from the Flic whenever the\nbutton is pushed.\n\n### Example Stream Deck configuration\n\nYou can use the \"Website\" Stream Deck action to trigger an event. In the\nStream Deck configuration, drag the \"Website\" action to a key and configure\nthe URL to be `http://homebridge.local:3001/button-name?event=click` which uses the\nsame parameters as the `GET` request above:\n\n![streamdeck-key](docs/streamdeck-config.png)\n\n\u003e **Top tip:** If you enable the `GET request in background` option, a browser will\n\u003e not open when you hit the key.\n\n## Using a `POST` request\n\nIf you use an HTTP `POST` request you must set the Content-Type header to either\n`application/json` or `application/x-www-form-urlencoded`. The body of the request\nneeds a field named `event` with a value of one of the event types defined above.\n\nFor example, to send a double press event to a button using `curl` with a JSON\npayload:\n\n```shell\n$ curl -X POST \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"event\": \"double-click\"}' \\\n  http://\u003chomebridge\u003e:\u003cport\u003e/\u003curi\u003e\n```\n\nYou can also `POST` with an `application/x-www-form-urlencoded` payload:\n\n```shell\n$ curl -X POST \\\n  -H 'Content-Type: application/x-www-form-urlencoded' \\\n  -d 'event=double-click' \\\n  http://\u003chomebridge\u003e:\u003cport\u003e/\u003curi\u003e\n```\n\nThis is useful when used in with a larger form-based application.\n\n## Troubleshooting\n\nCheck the Homebridge logs for any warnings as the plugin will log any attempts\nto trigger an invalid event or any invalid URIs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDjelibeybi%2Fhomebridge-button-platform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDjelibeybi%2Fhomebridge-button-platform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDjelibeybi%2Fhomebridge-button-platform/lists"}