{"id":16295085,"url":"https://github.com/niieani/illumination-control","last_synced_at":"2025-04-09T13:13:23.866Z","repository":{"id":47150981,"uuid":"356190014","full_name":"niieani/illumination-control","owner":"niieani","description":"Use JavaScript to control your Aukey Smart RGB Lamp running on Tuya IoT firmware","archived":false,"fork":false,"pushed_at":"2023-12-15T02:39:54.000Z","size":101,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-03T11:42:46.127Z","etag":null,"topics":["aukey","iot","smart-lamp","tuya","tuyapi"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"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/niieani.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":"2021-04-09T08:09:35.000Z","updated_at":"2021-07-20T08:43:06.000Z","dependencies_parsed_at":"2024-11-05T16:48:00.109Z","dependency_job_id":"e9f49385-92ae-4c32-af6f-c8b173914fc2","html_url":"https://github.com/niieani/illumination-control","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/niieani%2Fillumination-control","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niieani%2Fillumination-control/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niieani%2Fillumination-control/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niieani%2Fillumination-control/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niieani","download_url":"https://codeload.github.com/niieani/illumination-control/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248045266,"owners_count":21038555,"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":["aukey","iot","smart-lamp","tuya","tuyapi"],"created_at":"2024-10-10T20:17:34.482Z","updated_at":"2025-04-09T13:13:23.849Z","avatar_url":"https://github.com/niieani.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Aukey Illumination Control\n\nUse JavaScript to control your [Aukey Smart RGB Lamp](https://www.amazon.com/gp/product/B08TM4DBRB/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8\u0026psc=1) running on Tuya IoT firmware.\n\nThe protocol for setting color and scenes was reverse engineered and you can use simple helper functions from this repo to set them. You can even make combinations that aren't possible with the UI (e.g. scenes that mix fades with non-fades).\n\nThe light is very responsive on a good WiFi network, so I'm trying to do some audio visualization with the lamp, but you can use it for your own needs. :)\n\n## Setup\n\nYou'll need to create a Tuya IoT account: https://iot.tuya.com/index/\n\nIt's a long an annoying process that takes upto 24 hours (due to the wait for their apis to propagate). Instructions for that are [here](https://github.com/codetheweb/tuyapi/blob/master/docs/SETUP.md).\n\nThen clone this repo and create a file `src/devices.js`:\n\n```js\nmodule.exports = [\n  // copy the output of the 'tuya-cli wizard' command, or if you have an id/key for your device:\n  {\n    name: 'AUKEY Living Room',\n    id: 'my_api_id_here',\n    key: 'my_api_secret_here'\n  },\n]\n```\n\n## Running\n\n```\nyarn\nyarn start\n```\n\nThis will open Electron and your light will start reacting to whather is coming from the default record device (by default likely your computer's microphone).\n\nDo customize this behavior in `preload.js` to your liking.\n\n## Usage\n\n```js\nconst { device, ready } = require(\"./run\");\nconst { getScene, schema } = require(\"./aukey-helpers\");\n\nawait ready;\n\ndevice.set({\n  multiple: true,\n  data: {\n    [schema.mode]: \"scene\",\n    [schema.power]: true,\n    [schema.sceneDefinition]: getScene({\n      targetSlotNth: 4,\n      stages: [\n        {\n          crossfade: false,\n          holdMs: 1000,\n          hue: 10,\n          saturation: 1000,\n          lightness: 1000,\n        },\n      ],\n    }),\n  },\n});\n```\n\nCheck `aukey-helpers.js` for all supported options.\n\n## Caveats\n\nWhen using 'colour' mode, large changes (distant value from the previous one) can cause a timeout,\nbecause the light fades to the other color and only then responds.\nWorkaround is to use the 'scene' mode with a single color and cross-fade disabled.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniieani%2Fillumination-control","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniieani%2Fillumination-control","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniieani%2Fillumination-control/lists"}