{"id":15140455,"url":"https://github.com/homebridge/homebridge-examples","last_synced_at":"2025-04-09T10:05:47.410Z","repository":{"id":37950814,"uuid":"256671915","full_name":"homebridge/homebridge-examples","owner":"homebridge","description":"Collection of homebridge plugin examples","archived":false,"fork":false,"pushed_at":"2024-02-22T05:19:52.000Z","size":216,"stargazers_count":86,"open_issues_count":5,"forks_count":71,"subscribers_count":11,"default_branch":"latest","last_synced_at":"2025-04-02T07:47:17.986Z","etag":null,"topics":["homebridge","homebridge-examples","homebridge-plugin","homekit"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/homebridge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2020-04-18T04:49:35.000Z","updated_at":"2025-03-02T17:00:17.000Z","dependencies_parsed_at":"2024-09-16T13:32:28.678Z","dependency_job_id":null,"html_url":"https://github.com/homebridge/homebridge-examples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homebridge%2Fhomebridge-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homebridge%2Fhomebridge-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homebridge%2Fhomebridge-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homebridge%2Fhomebridge-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/homebridge","download_url":"https://codeload.github.com/homebridge/homebridge-examples/tar.gz/refs/heads/latest","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248018060,"owners_count":21034048,"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":["homebridge","homebridge-examples","homebridge-plugin","homekit"],"created_at":"2024-09-26T08:21:41.313Z","updated_at":"2025-04-09T10:05:47.386Z","avatar_url":"https://github.com/homebridge.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# homebridge-examples\n\nThis repo bundles some example implementations for homebridge plugins. They provide some example code to get \nstarted with. They are also published on npm like regular plugins, so you can easily run them in your local\nhomebridge instance. Refer to the respective `package.json` for the plugin name and install them as usual.\n\nThe examples are all written in Typescript and thus require at least homebridge `v1.0.0`.  \nTo build a plugin run the following commands in the respective plugin directory.\n\nRun this command once to install all dependencies required by the plugin:\n```\nnpm install\n``` \n\nAfter that run the following command to compile the Typescript files into Javascript\n(repeat this step every time you change something in the code).\n```\nnpm run build\n```\n\n\nIf you're trying to get one of the example plugins to show up in your homebridge installation without installing it\nfrom npm just clone this repo.\nThen, just cd into one of the plugin folders and run\n```\nsudo hb-service link\n```\nThis creates a symlink from the plugin directory to /var/lib/homebridge/node_modules/plugin_name.\n\nTo undo this run\n```\nsudo hb-service unlink\n```\n\nPay attention to not start homebridge with the --strict-plugin-resolution flag. A standard installation of \nhomebridge might start it with that flag in a start script, located in /opt/homebridge on linux.\n\n\nIf you need inspiration for a plugin written in Javascript you can just run the above commands and look at the \ngenerated Javascript code located in the `./dist` folder. You may need to ignore some code at the beginning of the file \ngenerated by the Typescript compiler.\n\n## Examples for different homebridge plugin types\n\n#### Accessory Plugins\n\nAccessory plugins are the most basic and simplest plugins for homebridge. They should be used if you only want to \nexpose a single accessory and don't require any special functionality.\n\n* [Accessory Plugin](./accessory-example-typescript): A simple Switch accessory.\n\n#### Platform Plugins:\n\nPlatform plugins are able to expose multiple accessories. Additionally, they are required if you want to use the \nController API. \n\n* [Static Platform Plugin](./static-platform-example-typescript): Static platforms know which accessories they want to \nexpose on start up. The set of accessories cannot change over the lifespan of the plugin.\n* [Dynamic Platform Plugin](./dynamic-platform-example-typescript): Dynamic platforms can dynamically add or remove \naccessories at runtime. Accessories are fully stored to disk by homebridge, and the exact state is reconstructed on\na reboot. The plugin can store additional context as well. \n* [Independent Platform Plugin](./independent-platform-example-typescript): Independent platforms are typically used\nwhen the platform intends to only expose external accessories or provides other functionality while not exposing\nan accessory at all.\n\n## Other example plugins\n\n* [Bridged Camera Platform](./bridged-camera-example-typescript)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhomebridge%2Fhomebridge-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhomebridge%2Fhomebridge-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhomebridge%2Fhomebridge-examples/lists"}