{"id":20088226,"url":"https://github.com/alexistm/yeelight_ambilight_python","last_synced_at":"2025-05-06T02:32:49.036Z","repository":{"id":43223458,"uuid":"262628407","full_name":"AlexisTM/yeelight_ambilight_python","owner":"AlexisTM","description":"Python ambilight for the Xiaomi Yeelight Jiaoyue 650 ceiling light","archived":false,"fork":false,"pushed_at":"2024-04-04T07:48:46.000Z","size":28,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-14T22:39:55.209Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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}},"created_at":"2020-05-09T17:57:54.000Z","updated_at":"2022-01-13T15:06:37.000Z","dependencies_parsed_at":"2024-04-04T08:51:02.671Z","dependency_job_id":null,"html_url":"https://github.com/AlexisTM/yeelight_ambilight_python","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_ambilight_python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexisTM%2Fyeelight_ambilight_python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexisTM%2Fyeelight_ambilight_python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexisTM%2Fyeelight_ambilight_python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlexisTM","download_url":"https://codeload.github.com/AlexisTM/yeelight_ambilight_python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224480728,"owners_count":17318311,"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:12:53.069Z","updated_at":"2024-11-13T16:12:53.781Z","avatar_url":"https://github.com/AlexisTM.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# yeelight_ambilight_python\nPython ambilight for the Xiaomi Yeelight Jiaoyue 650 ceiling light\n\nNOTE: Sadly, the limit of 60 requests/minute cannot be removed on the ceiling lights.\n\n## Installation\n\nClone and install dependencies\n\n```py\ngit clone https://github.com/AlexisTM/yeelight_ambilight_python.git\ncd yeelight_ambilight_python\npython3 -m pip install -r requirements.txt\n```\n\n## Usage\n\nModify the following parameters:\n\n```py\nDO_MAIN = True # Use the main light\nDO_MAIN_MOON = True # Use the main light as moon (DO_MAIN should be true)\nDO_AMBIENT = True # Use ambient light\n\nDELAY = 0.05 # Additional delay because the 650 cannot use the music mode\nMAX_MAIN_LUMINOSITY = 15 # Maximal \"main\" luminosity (DO_MAIN on and DO_MAIN_MOON off)\nLUMINOSITY_THRESHOLD = 1 # Update the main light if the luminosity changes of at least this\nTEMPERATURE_THRESHOLD = 100 # Update the main light if the temperature changes of at least this\nCOLOR_THRESHOLD = 25 # Update the ambient light if the temperature changes of at least this\n\nLIGHT_IP = \"192.168.178.20\" # The light IP, this creates 3 connections to allow higher rate.\n```\n\n## Methodology\n\n1. Grab the screen image\n    * Take a screenshot (ImageGrab.grab)\n    * Cut the screenshot to fit the film size (image.getbbox)\n2. Extract the dominant color\n    * Resize the image to a small 100x100 size (nearest neightbour to keep the correct colors)\n    * Convert the image to a 32 color image with adaptative palette\n    * Get the most used color from these 32 colors subset in the generated palette\n3. Compute the luminosity by using the black and white image resized to 1x1 using bicubic to get a mean color\n4. Compute the temperature (using RGB to XYZ to xy to CCT)\n\n\n## Dependencies\n\n* Yeelight-python: Yeelight communication\n* numpy: To use colour-science\n* colour-science: To convert RGB to Temperature\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexistm%2Fyeelight_ambilight_python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexistm%2Fyeelight_ambilight_python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexistm%2Fyeelight_ambilight_python/lists"}