{"id":18799270,"url":"https://github.com/bryal/sm2335egh-rs","last_synced_at":"2025-07-31T23:11:52.382Z","repository":{"id":197241717,"uuid":"697859206","full_name":"bryal/sm2335egh-rs","owner":"bryal","description":"Driver in Rust for the SM2335EGH 5-channel LED controller","archived":false,"fork":false,"pushed_at":"2024-02-11T13:51:53.000Z","size":2416,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-18T08:13:23.506Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/bryal.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":"2023-09-28T16:06:30.000Z","updated_at":"2023-09-29T17:46:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"a3046e5a-d8e7-4c5d-b785-d7f3dc954256","html_url":"https://github.com/bryal/sm2335egh-rs","commit_stats":null,"previous_names":["bryal/sm2335egh-rs"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryal%2Fsm2335egh-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryal%2Fsm2335egh-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryal%2Fsm2335egh-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bryal%2Fsm2335egh-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bryal","download_url":"https://codeload.github.com/bryal/sm2335egh-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239727305,"owners_count":19687149,"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-07T22:14:37.956Z","updated_at":"2025-02-19T20:21:50.050Z","avatar_url":"https://github.com/bryal.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SM2335EGH-rs\n\nA GPIO-based driver for the SM2335EGH LED controller found in the SwitchBot Color Bulb, written in pure no-std Rust.\n\nThe SM2335EGH (aka just SM2335) is a 5-channel, 10-bit LED controller made by Shenzen Sunmoon Microelectronics.\n[Some details about the chip can be found on their website, chinaasic.com](http://www.chinaasic.com/chipDetails/detail_290.html).\nAlternatively, you can find the [document with the specs here in doc/](doc/SM2335EGH-chip-details-ch.pdf).\n\nIn short, the five channels (called OUT1 through OUT5) are essentially split into two groups.\nThe first three channels (OUT1-OUT3) are low voltage at 40V and allow a maximimum current of 160mA.\nIn practice, these three channels are used for RGB / coloured light.\nThe last two channels (OUT4-OUT5) are much higher voltage at 500V, but the maximum current is halved at 80mA.\nThese two channels are used for warm \u0026 cool white.\n\nIn my SwitchBot bulbs, this is the concrete channel mapping used:\n\n| Output | Group | Color/hue  |\n|--------|-------|------------|\n| OUT1   | RGB   | Green      |\n| OUT2   | RGB   | Red        |\n| OUT3   | RGB   | Blue       |\n| OUT4   | CW    | Warm white |\n| OUT5   | CW    | Cold white |\n\nThis chip seems fairly uncommon at this point (2023-09).\nAt least I'm not aware of any other products than the SwitchBot bulbs that use it.\nThe specific model number of my bulbs with this chip is W1401400.\n\n![Rainbow color cycle on a dismantled SwitchBot Color Bulb connected to a flasher/debugging probe](switchbot-rust-rainbow.gif)\n\n## Implementation\n\nI just based the driver on the ones in [Tasmota](https://github.com/arendst/Tasmota/pull/15839) and [ESPHome](https://github.com/esphome/esphome/pull/3924). I've asked the manufacturer for more information about the protocol, just to have a first hand source, but I'm not particularly worried about bugs. The protocol as found in the Tasmota and ESPHome implementations is really simple, and I haven't had any issues in practice. \n\nHowever, if you happen to have access to the protocol specification, please contact me! Similarly, if you've spotted an issue in the current implementation -- don't hesitate to open an issue (or even better, a PR).\n\n## License\n\nThe MIT License (MIT). See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbryal%2Fsm2335egh-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbryal%2Fsm2335egh-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbryal%2Fsm2335egh-rs/lists"}