{"id":41192413,"url":"https://github.com/trip5/esphome-led-clock","last_synced_at":"2026-04-08T06:01:18.914Z","repository":{"id":176499374,"uuid":"658862693","full_name":"trip5/EspHome-Led-Clock","owner":"trip5","description":"EHLC: EspHome-Led-Clock (for Sinilink XY-Clock \u0026 303WifiLC01 and other 7-Segment Displays)","archived":false,"fork":false,"pushed_at":"2026-03-24T06:53:19.000Z","size":1269,"stargazers_count":30,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-03-25T08:29:36.732Z","etag":null,"topics":["303wifilc01","aliexpress","clock","esphome","esphome-devices","esphomeyaml","esphomeyaml-config","homeassistant","led-clock","ledclock","sinilink","tm1637","tm1637display","tm1650","xy-clock","yaml"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trip5.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-06-26T16:35:33.000Z","updated_at":"2026-03-24T06:53:23.000Z","dependencies_parsed_at":"2023-06-29T22:51:45.277Z","dependency_job_id":"ce7ad9d6-f370-45bd-8837-c4849666610a","html_url":"https://github.com/trip5/EspHome-Led-Clock","commit_stats":null,"previous_names":["trip5/esphome-sinilink-clock","trip5/esphome-led-clock"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/trip5/EspHome-Led-Clock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trip5%2FEspHome-Led-Clock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trip5%2FEspHome-Led-Clock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trip5%2FEspHome-Led-Clock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trip5%2FEspHome-Led-Clock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trip5","download_url":"https://codeload.github.com/trip5/EspHome-Led-Clock/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trip5%2FEspHome-Led-Clock/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31542384,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"online","status_checked_at":"2026-04-08T02:00:06.127Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["303wifilc01","aliexpress","clock","esphome","esphome-devices","esphomeyaml","esphomeyaml-config","homeassistant","led-clock","ledclock","sinilink","tm1637","tm1637display","tm1650","xy-clock","yaml"],"created_at":"2026-01-22T20:26:43.253Z","updated_at":"2026-04-08T06:01:18.902Z","avatar_url":"https://github.com/trip5.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![image](./images/EHLC.png)\n\n# EspHome-Led-Clock\n\n***This documentation is the same on the [Github Page](https://trip5.github.io/EspHome-Led-Clock/), which may be easier to read.***\n\nEHLC is meant to be used on ESP-based LED Clocks using ESPHome. So far, it works with Sinilink Wifi XY-Clocks and 303WifiLC01 Clocks. It can probably be adapted for use with other 7-Segment Display clocks. And, of course, it's ESPHome, so it's only limited by your imagination and skill.\n\nA lot of inspiration is taken from the [`EHMTXv2`](https://github.com/lubeda/EspHoMaTriXv2) project... but with a 7-segment display.\n\nUsing either clock requires the TM1650 display to be supported by an external component - at least until ESPHome has native support. The 303WifiLC01 Clock also requires an external component to support its RTC chip. The default config is to use my own forks of other repositories (which I link to below).\n\nDue to memory constraints on the ESP8266 these clocks use, I've decided to split the functions by how you may choose to use the clock.  Read below for more details.\n\n---\n\n## LED Clocks\n\n### Sinilink XY-Clock\n\n![image](./images/sinilink_XY-Clock.jpg)\n\nThis is the link on Aliexpress I have personally used but I am sure there are others:\nhttps://www.aliexpress.com/item/1005004427096126.html\n\n## 303WifiLC01 Clock\n\n![image](./images/303WIFILC01.jpg)\n\nThis is the link on Aliexpress I have personally used but I am sure there are others:\nhttps://www.aliexpress.com/item/1005003163124952.html\n\n### DIY TM1637 \"Box Clock\"\n\n![image](./images/TM1637-boxclock.jpg)\n\nI built this using an ESP32 and a TM1637 Display.\nIf you've got the ability to make one, it's not too hard to edit the `yaml` file to adapt it.\n\n### Flashing\n\nYou can use ESPHome to make it completely custom or you can use my [Web Tool](https://trip5.github.io/EspHome-Led-Clock/firmware.html).\n\n#### Sinilink XY-Clock\n\nDon't forget to connect GPIO0 to GND when first connecting to your serial flasher!\n\n![image](./images/sinilink_XY-Clock-Pins.jpg)\n\nA JST1.25mm header should fit nicely if you want a DIY quick-connector...\n\n![image](./images/JST1.25mm.jpg)\n\nI usually use some copper wire bent into hooks soldered to connector wire.\n\n#### 303WifiLC01 Clock\n\nDon't forget to connect GPIO0 to GND when first connecting to your serial flasher!\n\n![image](./images/303WIFILC01-Pins.jpg)\n\n2.54mm pin headers fit nicely (duPont male connectors will kind of work).\n\n\u003c!--\n\n---\n\n## New to ESPHome?\n\nTry following this step-by-step guide to compiling a YAML:\n[Beginner's Guide to Adding Devices](https://deploy-preview-4411--esphome.netlify.app/guides/beginners_guide_adding_devices)\n\nThis guide is proposed for the ESPHome documentation and if you find it helpful, it would be great if you could leave a comment in the\n[Pull Request](https://github.com/esphome/esphome-docs/pull/4411) to get them added to the ESPHome Docs officially.\n\n--\u003e\n\n### New to Flashing a Device?\n\nYou can read this: [Physically Connecting to your Device](https://esphome.io/guides/physical_device_connection).\n\n---\n\n## Using This firmware\n\nThis is ESPHome, so it's not pretty but very functional.\n\n### Connecting to Wi-Fi\n\nIf using this device on a network outside your usual, ESPHome will, after 10 seconds (set by the YAML), give up trying to connect to its \"home\" network and enter AP mode.\nYou should then connect to the hotspot with a mobile phone and hopefully you will get a pop-up message that will assist in opening your browser to the device's wireless configuration.\n\nIf not, then open your web browser and go to `http://192.168.4.1` to enter the wireless configuration. If the device has wi-fi credentials but they are invalid, this screen may show the WebUI instead.\nTry visiting an unhandled endpoint like `http://192.168.4.1/wifi` (almost anything will work here).\n\nWhen connected, the clock will display its IP address. Be sure if you are using this clock as a travel clock to NOT use Home Assistant as a time source (it uses SNTP by default).\n\n### Date Display\n\nThe clock can display the date at configurable intervals.\nThe display interval checks how long the clock was displayed for and then displays the date for the specified time (in seconds).\nKeep in mind that displaying the message from the Home Assistant integration will not interrupt this count, so I recommend choosing sane and even numbers.\n\n### Time Sync\n\nTime can be synced to the Internet at configurable intervals between 1 - 24 hours, provided the wifi network is connected.\n\n### Alarms\n\nThe clock can play alarms at configurable intervals. The Sinilink Clock has a piezo speaker, so it can play a Nokia-style tune. The 303 does not (so the file must be edited to remove a lot of lines... there are many notes in the YAML to make this easier).\n\nPlease note the default YAML has 2 alarms available and 3 tunes.  See below for more information regarding the ([speaker](#speaker-notes) for some useful links) and how to play tunes.\n\n### Flip It!\n\nIn the yaml files are notes how to flip your display and use it upside-down.  You should use a different `segment_mapping` as well.\n\nBe sure to check that the yaml file has `backward: true`.\n\n---\n\n## Non-HA Version\n\nThe Non-HA version will function completely without Home Assistant and can still be controlled by accessing the WebUI via its IP or mDNS address, easily found with [eh Device Scanner](https://github.com/trip5/eh-Device-Scanner).\n\nThe file [`EHLClock.yaml`](EHLClock.yaml) contains functions useful for using the Sinilink XY-Clock as... mostly just a clock but with some power-saving functions.\nIt includes all of the functions above as well as these below.  This version has a WebUI which can be accessed via it's IP after connecting the clock to Wifi.\nSo if you need a travel clock, this may be the ideal one for you.  It can still be controlled by Home Assistant as well but is not dependent on it to function.\n\nThe file [`EHLClock-303.yaml`](EHLClock-303.yaml) is derived from the above master file for the 303WifiLC01 Clock.\n\n### Time Zone POSIX\n\nThanks to [andrewjswan](https://github.com/andrewjswan) for the idea to make time zones editable directly in the WebUI.\nThey must be in POSIX format (see [notes](#posix-time-strings) below).  Don't forget to hit enter to make it stick.\n\n### Alternate Time Zone\n\nThis option is to allow displaying a Time Zone other than your \"home\" time zone.  It can be activated permanently.\n\n### Weather\n\nThere are is the option to display current weather Temperature (°C/°F).\nIt will display at specified intervals (for example, every 5th rotation of time and date).\n\nYou will need to enter your GPS location using [Latitude and Longitude](https://www.gps-coordinates.net/) for it function correctly.\nIt uses my [ESPHome-Open-Meteo component](https://github.com/trip5/ESPHome-Open-Meteo).\n\nIt will not function without Internet connectivity (of course).\n\n### Wifi Stop Seek\n\nThis is disabled by default but by turning it on, the clock will disable its wifi radio after a configurable time if the network connection is dropped.\nNote that this does not turn wifi off if connected, it's merely a timeout for when the configured wifi connection cannot be made. \nThis is meant as a power-saving feature in the event of a power blackout.\n\nUnder normal conditions, when an ESPHome device loses wifi connectivity, it will continuously seek out a wifi connection or activate a hotspot to allow configuring a wifi connection.\nWhile in this non-connected state, the clock will use more power than usual. If you have a coin-cell battery that maintains the RTC during a blackout,\nyou could re-connect the clock to a powerbank or some other power source and it will continue to function.\n\nPlease note that this also means that the clock will not try to connect to wifi again (this will be indicated on the screen as \"Wifi Off\"),\nunless you reset the power, which just means unplugging it and plugging it back in again.\n\nThe time to attempt connection is set in the WebUI.  Do not set this time too short for usual circumstances.  The range is 60 to 315 seconds.\nAlso, do not go outside these numbers as the variable that holds this number is limited to this range.\n\nI have allowed 60 seconds minimum in the options but this could mean your clock stops trying to connect to wifi just because\nyour router rebooted or the wifi was a bit sketchy. So you should probably set it to something reasonable.\nThe default is 180 seconds which I think is enough time for even the slowest router to reboot, but it's your choice.\nAlso keep in mind that this time will affect how long the configuration hotspot is available for.\nThe hotspot will activate after 10 seconds (lowered from 60 seconds which is ESPHome default).\n\nYou can enable or disable this mode by holding the button for 5 seconds to toggle the function. The wifi will be turned on again if it has been turned off.\n\n### Display Off\n\nThere are two options to turn off the display. One is to turn off the display after a configurable time when the clock is not being used (in minutes).\nThe other is to turn off the display when there is no Wifi connection (in seconds).  The display may be turned on again by pressing the button.\n\n### Power Consumption\n\n*Sinilink XY-Clock Blue LED, 2024.11.10 Version, 1 hour each mode, measured with a FNIRSI FNB-58 powered externally*\n\n| Status: Modes                                        | Power usage |\n| ---------------------------------------------------- | ----------- |\n| Connected: Display On - Brightness 7                 | 147.13 mAh  |\n| Connected: Display On - Brightness 1                 | 126.66 mAh  |\n| Connected: Display Off after 5 min                   | 122.03 mAh  |\n| No Wifi: Stop Seek Off \u0026 Display On - Brightness 1   | 128.33 mAh  |\n| No Wifi: Stop Seek On \u0026 Display On - Brightness 1    | 73.35 mAh   |\n| No Wifi: Stop Seek On \u0026 Display Off after 30 sec     | 69.77 mAh   |\n\n#### What Does This Mean?\n\nOn maximum power savings, you could power the clock from a 5000mAh powerbank for almost 3 days: `5000mAh / 70mA ≈ 71.4 hours`!\n\n### LED Output\n\nWhile the clock is attempting to connect to wifi or while in hotspot mode, the blue LED will pulse on and off every 1 second.\n\nIf Stop Seek is enabled, then the LED will pulse on or off every 2 seconds during connection attempts.\n\nIf connected to Wifi or Stop Seek has activated, the LED will turn off completely.\n\n### Button Functions\n\nBy default, the buttons can be used as such:\n\n| Button  | Short-click Function | Long-press Function (hold for 1 second) |\n| ------- | -------------------- |---------------------------------------- |\n| Up      | Increase brightness  | Toggle the Wifi Stop Seek (see below)   |\n| Down    | Decrease brightness  | Toggle Alt Time Zone on/off             |\n| Set     | Toggle 12/24-hour mode | Show the clock's IP address (or other wifi status) |\n\nOf course, this is ESPHome, so you can change the button functions by editing the YAML if you wish.\n\n### Special Note Regarding the WebUI's Internet Dependence\n\nESPHome devices usually rely on the Internet to be available to access a Javascript file that formats the web UI.\nSpecifically, the device will look for https://oi.esphome.io/v2/www.js but this file can be made available on-device with this included in the `webserver:` section.\nThis can be added to the non-HA version but I recommend against it (it eats up valuable resources).\n\n```yaml\n  local: true\n```\n\nIf you don't mind the device's WebUI being dependent on the Internet, you could remove this line.\nYou could consider hosting the file on another machine in-house, too by using something like:\n\n```yaml\n  js_include: \"\"\n  js_url: \"http://192.168.1.1/esphome-www/www.js\"\n```\n\n---\n\n## Home Assistant Version\n\nThe file [`EHLClock-HA.yaml`](EHLClock-HA.yaml) contains functions useful for using the Sinilink XY-Clock with Home Assistant.\nIt does not include the WebUI, editable Time Zones, or Wifi Stop Seek but it does includes all of the functions below.\n\nThe file [`EHLClock_303-HA.yaml`](EHLClock_303-HA.yaml) is derived from the above master file for the 303WifiLC01 Clock.\n\n### Override Time Zones\n\nMaking Home Assistant Helpers (Input Text) with these names can override the in-firmware time zones.\nAdd `Clock Time Zone` and `Clock Time Zone Alt` as text helpers through [Helpers](https://my.home-assistant.io/redirect/helpers/).\nBy default, these entities are `input_text.clock_time_zone` and `input_text.clock_time_zone_alt`.\n\n### Service Calls\n\n![image](./images/EHLC_Home_Assistant_message.png)\n\nThis example will send a message that will display for 3 seconds before reverting to the clock for 5 seconds, and repeat until 20 seconds is finished (if it is displaying the message, it will finish that last 3 seconds). Unfortunately you are limited to what the TM1650 can actually display so you should probably test it out before adding it to an automation. On the Sinilink, decimal places will only work after the 1st or 2nd digit since the colon actually relies on the 3rd and 4th decimal, so it's perfect for displaying weather or room temperatures or even crypto prices. On the 303, the decimal after the 2nd digit is non-functional and is used by the colon instead.\n\n![image](./images/EHLC_Home_Assistant_tune.png)\n\nThis service is just for the Sinilink Clock and other clocks with a piezo speaker.  See [notes](#speaker-notes) for more info about RTTTL music.\n\n### Template Sensors\n\nThis will allow the clock to display information screens, following a single interval of clock and date screens.  You can display all screens at once or one per interval.\nThey are all treated as sensors, similarly as my [ESPHome-eInk-Boards](https://github.com/trip5/ESPHome-eInk-Boards) projects.\n\nPut something like this in your `configuration.yaml`:\n\n```yaml\ntemplate: !include template.yaml\n```\n\nAnything in `configuration.yaml` under the `template:` heading must now be moved to `template.yaml`. Take a quick look [here](https://community.home-assistant.io/t/how-do-i-setup-template-trigger-sensor-in-a-splitting-config/718626/) for some examples on an easy way to format `template.yaml`.\n\nThe file [`template.yaml`](template.yaml) contains several examples how to add sensors that can be automatically shown by the clock.\nI personally use only one sensor in my Home Assistant and 2 clocks in the house get data from the same sensor but you can (of course) create a sensor for each  individual clock.\n\n### Button Functions\n\nBy default, the buttons can be used as such:\n\n| Button  | Short-click Function | Long-press Function (hold for 1 second) |\n| ------- | -------------------- |---------------------------------------- |\n| Up      | Increase brightness  | Toggle HA Sensors Data All              |\n| Down    | Decrease brightness  | Toggle Alt Time Zone on/off             |\n| Set     | Toggle 12/24-hour mode | Toggle HA Sensors Data Stop           |\n\nOf course, this is ESPHome, so you can change the button functions by editing the YAML if you wish.\n\n---\n\n## Notes\n\n### POSIX Time Strings\n\nPlease note that the time zones MUST be in POSIX format instead of the usual Olsen type (`Asia/Seoul`).\n\nPOSIX formats look like: `KST-9` or `PST8PDT,M3.2.0/2:00:00,M11.1.0/2:00:00` or `AST4ADT,M3.2.0,M11.1.0`.\n\nThey include daylight savings and time-switches in the formatting. So, there is no reliance on the ESPHome Olsen database to be current.\nYou can view all of the time zones in the world in POSIX format [`here`](https://github.com/trip5/timezones.json/blob/master/timezones.md).\nIf you need to make a custom POSIX format you can look [`here`](https://developer.ibm.com/articles/au-aix-posix/) or even better, use this\n[`POSIX Generator`](https://www.topyuan.top/posix) courtesy of TopYuan.\n\n### OTA Update Can Be Buggy\n\nBecause these devices save preferences to flash, updates that introduce new features (which I do often) may fragment the storage space, causing strange behavior.\nIt's always best to fully erase and re-flash when upgrading the version of the firmware.\n\n---\n\n## Update History\n\n| Date       | Release Notes    |\n| ---------- | ---------------- |\n| 2026.04.08 | Non-HA versions: ehDP fixed, both time zones changeable in UI, Weather Temperature options added, Time Zone Offset completely removed (which affects all files) |\n| 2026.03.24 | Added ehDP to non-HA versions. Get [eh Device Scanner](https://github.com/trip5/eh-Device-Scanner) to use it. |\n| 2026.01.25 | Re-introduced variant YAML files with `yaml-derive.py`, minor fixes, Github page added with mkdocs and web flashing tool |\n| 2026.01.22 | Added POSIX to non-HA version and overrides to HA version, removed device's friendly name from entities, mdi icons \u0026 improv serial added, various fixes |\n| 2025.05.26 | Very minor fix to sensors, HA version fixed to actually play alarms on time |\n| 2024.12.09 | Recoded to remove many global variables, relying on numbers and switches where possible, hard-coded variables removed, alarms version re-integrated into main versions |\n| 2024.11.10 | TM1650 driver \u0026 YAMLs updated to allow upside-down display, OTA display status works, power measurements complete |\n| 2024.10.29 | Added Alarms version, removed alarms from regular version, added Display Off options and hard-coded variables to main and Alarms version |\n| 2024.08.22 | Added `local: true` to non-HA version |\n| 2024.06.29 | Added Home Assistant version, major changes to main version, fixed time sync error |\n| 2023.11.16 | Wifi Stop Seek, improved status messages |\n| 2023.10.22 | Show date on intervals |\n| 2023.10.04 | Colon blink configurable |\n| 2023.08.27 | Time zone offset added |\n| 2023.08.26 | Alarms, IP display |\n| 2023.08.19 | 303 Clock support added |\n| 2023.06.29 | Sinilink XY-Clock: Basic functionality, HA integration |\n\n---\n\n## Useful Links\n\nWhat started my curiousity (a long discussion on ESP-based 7-segment clocks): https://github.com/arendst/Tasmota/discussions/15788\n\nTasmota Template for the Sinilink XY-Clock: https://templates.blakadder.com/XY-Clock.html\n\nMaarten Penning's fantastic repository regarding the 303WIFILC01: https://github.com/maarten-pennings/303WIFILC01/tree/main\n\nAbout outputting to the Display: https://esphome.io/components/display/tm1637.html?highlight=tm1637\n\nESPHome's Display: https://esphome.io/components/display/index.html\n\n### Speaker Notes\n\nIf you plan to build your own and want a speaker, get a passive one like the KY-006.  Active ones are a pain to get working with ESPHome.\n\nAbout the Rtttl Buzzer: https://esphome.io/components/rtttl.html\n\nSome RTTTL tunes: https://picaxe.com/rtttl-ringtones-for-tune-command/\n\n### TM1650 Display\n\nBuzzer13's TM1650 ESPHome component: https://github.com/buzzer13/esphome-components\n\nMy fork (which includes a highly modified font) and backward function: https://github.com/trip5/esphome-tm1650\n\n### DS1302 RTC\n\nTrombik's ESPHome Component for the DS1302 RTC (used on the 303): https://github.com/trombik/esphome-component-ds1302\n\nMy fork (probably the same): https://github.com/trip5/esphome-ds1302\n\n### My Other Clocks\n\nEspHome-Led-PixelClock: https://github.com/trip5/EspHome-Led-PixelClock\n\nEspHome-VFD-Clock: https://github.com/trip5/EspHome-VFD-Clock\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrip5%2Fesphome-led-clock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrip5%2Fesphome-led-clock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrip5%2Fesphome-led-clock/lists"}