{"id":20088282,"url":"https://github.com/alexistm/yeelight-ws","last_synced_at":"2026-06-13T14:02:19.394Z","repository":{"id":50251995,"uuid":"164340210","full_name":"AlexisTM/yeelight-ws","owner":"AlexisTM","description":"yeelight websocket interface","archived":false,"fork":false,"pushed_at":"2024-04-10T07:32:17.000Z","size":330,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-14T12:28:01.950Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/AlexisTM.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-06T19:51:40.000Z","updated_at":"2024-07-12T11:05:58.364Z","dependencies_parsed_at":"2024-07-12T11:05:47.817Z","dependency_job_id":"125059b9-d711-44cc-9d1f-1affa98a30c1","html_url":"https://github.com/AlexisTM/yeelight-ws","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/AlexisTM%2Fyeelight-ws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexisTM%2Fyeelight-ws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexisTM%2Fyeelight-ws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexisTM%2Fyeelight-ws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlexisTM","download_url":"https://codeload.github.com/AlexisTM/yeelight-ws/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241523938,"owners_count":19976424,"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-11-13T16:13:04.424Z","updated_at":"2026-06-13T14:02:14.361Z","avatar_url":"https://github.com/AlexisTM.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# yeelight-ws\nThis is an example of a web-based Yeelight control system handled with a websocket. It allows to control all the lights in your house simultaneously, including the JIAYOUE 650 background light. \n\nThis is a project is about testing the capabilities of different libraries and is not for users.\n\nNote that I am not a graphic designer.\n\n\u003e This is running on a Raspberry Pi Zero\n\nStarring:\n- As the backend\n  - [ws](https://www.npmjs.com/package/ws) - Websocket library\n  - [express](https://www.npmjs.com/package/express) - Minimalist web framwork for node\n  - [yeelight-platform](https://github.com/AlexisTM/yeelight-platform) based on [sahilchaddha's yeelight-platfom](https://github.com/sahilchaddha/yeelight-platform) - The yeelight communication library. \n  - [redis](https://github.com/NodeRedis/node_redis) - Real time database for logins, tokens, and flows\n- As the frontend\n  - [VueJS](https://vuejs.org) - Javascript framework\n  - [colorjoe](https://github.com/bebraw/colorjoe) - Color picker\n  - [RobustWs](https://github.com/appuri/robust-websocket) - Reconnecting websocket\n  - [Bootstrap] 4.x - I'm not a graphic designer CSS library\n\n## Install\n\n```bash\ngit clone http://github.com/AlexisTM/yeelight-ws\ncd yeelight-ws\nnpm install\nnode index.js\n```\n\n**Install redis-server**\n\n```\nsudo apt install redis-server\n```\n\n**Setup of the config.json**\n\n```js\n{\n    \"redis\": {\n        \"ip\": \"192.168.178.23\"\n    },\n    \"discover_lights\": false,\n    \"lights\": [\n        {\n            \"ip\": \"192.168.178.32\",\n            \"type\": \"ceiling4\"\n        }\n    ]\n}\n\n```\n\n**Setup a user**\n\n```bash\nnode setup.js\n#? Username:  AlexisTM\n#? Password:  [hidden]\n#? Roles:  admin, user\n```\n\n## Redis db template\n\n```javascript\nusers/[username]:mmd5 = md5(md5(password)) // stores md5(md5(password))\nusers/[username]:roles = '[\"admin\", \"user\"]' // roles\nusers/[username]:token-[token] = [token] // stores the valid tokens, they expire currently after 10 days, the data \n```\n\n## Install and autoboot on a Raspberry Pi\n\nSSH with the user pi and install it the same way as on a desktop.\n\n```bash\ngit clone http://github.com/AlexisTM/yeelight-ws\ncd yeelight-ws\nnpm install\nsudo apt install redis-server # will be at 127.0.0.1\n```\n\nEnable the autoboot by creating the follwoing file `/etc/systemd/system/yeelight.service`\n\n```bash\n#\n# Service file for systems with systemd to run Yeelight websocket control\n#\n\n[Unit]\nDescription=Yeelight\nAfter=network.target\n\n[Service]\nType=simple\nuser=pi\nWorkingDirectory=/home/pi/yeelight-ws\nExecStart=/usr/bin/node /home/pi/yeelight-ws/index.js\nSendSIGKILL=no\n\n[Install]\nWantedBy=multi-user.target\n```\n\nFinally, start and enable the service.\n\n```bash\nsudo systemctl start yeelight\nsudo systemctl status yeelight # ensure the service works\nsudo systemctl enable yeelight\n```\n\n### Quickview\n\n![Quickview](/www/img/onphone.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexistm%2Fyeelight-ws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexistm%2Fyeelight-ws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexistm%2Fyeelight-ws/lists"}