{"id":15669872,"url":"https://github.com/plasticrake/homebridge-opc","last_synced_at":"2025-05-06T20:22:45.157Z","repository":{"id":57265790,"uuid":"59254618","full_name":"plasticrake/homebridge-opc","owner":"plasticrake","description":"Open Pixel Control (OPC) plugin for Homebridge","archived":false,"fork":false,"pushed_at":"2020-04-30T23:12:06.000Z","size":15,"stargazers_count":11,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T02:34:47.242Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/plasticrake.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2016-05-20T01:17:23.000Z","updated_at":"2022-12-19T23:56:38.000Z","dependencies_parsed_at":"2022-08-25T03:40:46.854Z","dependency_job_id":null,"html_url":"https://github.com/plasticrake/homebridge-opc","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/plasticrake%2Fhomebridge-opc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plasticrake%2Fhomebridge-opc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plasticrake%2Fhomebridge-opc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plasticrake%2Fhomebridge-opc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/plasticrake","download_url":"https://codeload.github.com/plasticrake/homebridge-opc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252761952,"owners_count":21800228,"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":[],"created_at":"2024-10-03T14:41:33.237Z","updated_at":"2025-05-06T20:22:45.134Z","avatar_url":"https://github.com/plasticrake.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# homebridge-opc\n[![NPM Version](https://img.shields.io/npm/v/homebridge-opc.svg)](https://www.npmjs.com/package/homebridge-opc)\n\nOpen Pixel Control (OPC) plugin for [Homebridge](https://github.com/nfarina/homebridge).\n\n# Installation\n\n1. Install homebridge using: npm install -g homebridge\n2. Install this plugin using: npm install -g homebridge-opc\n3. Update your configuration file. See the sample below.\n\n# Updating\n\n- npm update -g homebridge-opc\n\n# Configuration\n\n## Lightbulbs\nPixel segments are exposed as a lightbulb in HomeKit with the lightbulbs configuration.\n\n```json\n\"lightbulbs\": [\n  { \"name\": \"Strand\", \"map\": [ [0, 0, 10] ] }\n]\n```\n\nThe map property is similar to the FadeCandy server map configuration:\n\n* [ *OPC Channel*, *First OPC Pixel*, *Pixel count* ]\n  * Pixel count is optional and will default to 1.\n\n### Map Examples\n\nChannel 0, pixels 0 through 3:\n```javascript\n\"map\": [ [ 0, 0, 4 ] ] // As a Range\n\"map\": [ [0,0], [0,1], [0,2], [0,3] ] // Individual\n```\n\nChannel 1, pixels 6 through 8:\n```javascript\n\"map\": [ [ 1, 6, 3 ] ] // As a Range\n\"map\": [ [1,6], [1,7], [1,8] ] // Individual\n```\n\nChannel 1, pixels 6 through 9:\n```javascript\n\"map\": [ [ 1, 6, 3 ], [1,9] ] // Range plus Individual\n\"map\": [ [1,6], [1,7], [1,8], [1,9] ] // Individual\n```\n\n## Gradients\nPixel segments can also be set to a gradient between two lightbulb colors.\n\n```json\n\"lightbulbs\": [\n  { \"name\": \"Left\",  \"map\": [ [0,0] ] },\n  { \"name\": \"Right\", \"map\": [ [0,39] ] },\n],\n\n\"gradients\": [\n  { \"lightbulbNames\": [\"Left\", \"Right\"], \"map\": [ [ 0, 1, 38, 1 ] ] }\n]\n```\n\nThe map property for gradients has an additional option Step Length. If omitted it defaults to 0.\n* [ *OPC Channel*, *First OPC Pixel*, *Pixel count*, *Step length* ]\n\nFor a gradient 10 pixels long:\n* Step Length of 0 will have 1 color: `1,2,3,4,5,6,7,8,9,10`\n* Step Length of 1 will have 10 colors: `1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10`\n* Step Length of 2 will have 5 colors: `1,2 | 3,4 | 5,6 | 7,8 | 9,10`\n* Step Length of 3 will have 4 colors: `1,2,3 | 4,5,6 | 7,8,9 | 10`\n\n## Fade Duration\n\nName             | Default      | Description\n---------------- | ------------ | --------------------------------------------\nfadeDuration     | 0            | Fade between color changes in ms (0 is instantaneous)\nfadeOnDuration   | fadeDuration | Fade when turning a lightbulb on in ms (0 is instantaneous)\nfadeOffDuration  | fadeDuration | Fade when turning a lightbulb off in ms (0 is instantaneous)\n\n## Sample Configurations\n\n* Minimal configuration, one 10 pixel long strand all one color:\n```json\n \"accessories\": [{\n     \"accessory\": \"OpcAccessory\",\n     \"name\": \"Light Strip\",\n     \"host\": \"localhost\",\n     \"port\": 7890,\n\n     \"lightbulbs\": [\n       { \"name\": \"Strand\",  \"map\": [ [0, 0, 10] ] }\n     ]\n }]\n```\n\n* Strip 40 Pixel long strip with one pixel on each end as a lightbulb and the 38 pixels in between a gradient. Includes optional fade durations:\n```json\n \"accessories\": [{\n     \"accessory\": \"OpcAccessory\",\n     \"name\": \"Light Strip\",\n     \"host\": \"localhost\",\n     \"port\": 7890,\n\n     \"fadeDuration\": 100,\n     \"fadeOnDuration\": 500,\n     \"fadeOffDuration\": 1000,\n\n     \"lightbulbs\": [\n       { \"name\": \"Left\",  \"map\": [ [0,0] ] },\n       { \"name\": \"Right\", \"map\": [ [0,39] ] },\n     ],\n\n     \"gradients\": [\n       { \"lightbulbNames\": [\"Left\", \"Right\"], \"map\": [ [ 0, 1, 38, 1 ] ] }\n     ]\n\n }]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplasticrake%2Fhomebridge-opc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplasticrake%2Fhomebridge-opc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplasticrake%2Fhomebridge-opc/lists"}