ESP32 Projects
Start a build
Markdown

HU 058 Wi Fi Clock for ESP32-C3

An ESP32 display project for ESP32-C3.

ESP32-C3ESPHomeUnrated
Parts and source

Before you start

Confirm board compatibility and supported firmware targets in the upstream documentation.

Upstream README

⏰ HU-058 WiFi Clock

Hack this RGB 7-segment clock kit into a smart Home Assistant clock, with ESPHome and an ESP32-C3 Super Mini.

HU-058 WiFi Clock

A big thank you to misterblack1 for his original project - his work inspired this version and made it possible. His repo is linked in the Credits section at the bottom.

✨ Features

  • Full RGB control - Colour per panel, per digit or per LED, plus gradients
  • 12 / 24 hour time - With an AM indicator in 12 hour mode
  • On-device effects - Colour Cycle and Flash, smooth even if WiFi drops
  • WiFi status at a glance - The top colon dot goes out if WiFi drops

  • (Edit) Auto Brightness - Light sensor with adjustable Min and Max from Home Assistant
  • (Edit) Colon selector - Off (steady), Blink or Blink Fast
  • (Edit) World Clock - Pick each clock's city from Home Assistant, DST included. Build a few for a row of world clocks

  • (Added) Cycle Temperature - Shows any Home Assistant temperature sensor between the time - (Auto °C or °F)
  • (Added) Cycle Date - Shows the date between the time. Follows the clock's city / Time Zone
  • (Added) Date Format - Manual for DD-MM or MM-DD
  • (Added) OTA indicator - Shows OtA on the display while a firmware update uploads
  • (Added) Boot Indicator - Shows LoAd when ESP32 Starts up
  • (Added) Show Text - Put up to 4 characters on the display from your automations

Parts List:

🔌 Wiring

ESP32-C3 Super Mini to the clock's MCU socket (8051 removed), plus the LDR divider. Wire colours match the video.

HU-058 WiFi Clock wiring diagram

Code-y Bits

🌍 Adding more cities to the World Clock

world-clock.yaml comes with 5 cities. To add more, make these 3 edits. The example adds Paris, Dubai and Hong Kong as cities 6 to 8.

1. substitutions: - add a name and a POSIX TZ rule for each new city. Find more rules in the posix_tz_db zones list.

  city5: Sydney
  city5_tz: "AEST-10AEDT,M10.1.0,M4.1.0/3"
  city6: Paris
  city6_tz: "CET-1CEST,M3.5.0,M10.5.0/3"
  city7: Dubai
  city7_tz: "<+04>-4"
  city8: Hong Kong
  city8_tz: "HKT-8"

2. script: > apply_timezone - add each new _tz to the list. Swap the old *i < 5 check for the sizeof one below. It counts the list for you, so you won't need to change this line again.

  - id: apply_timezone
    then:
      - lambda: |-
          static const char *const TZ[] = {"${city1_tz}", "${city2_tz}", "${city3_tz}",
                                           "${city4_tz}", "${city5_tz}", "${city6_tz}",
                                           "${city7_tz}", "${city8_tz}"};
          auto i = id(time_zone).active_index();
          if (i.has_value() && *i < sizeof(TZ) / sizeof(TZ[0]))
            id(panel)->set_timezone(TZ[*i]);

3. select: > Time Zone - add each new city name to options.

    options: ["${city1}", "${city2}", "${city3}", "${city4}", "${city5}",
              "${city6}", "${city7}", "${city8}"]

Keep the order the same in steps 2 and 3. The Nth option uses the Nth time zone rule. To change a city instead of adding one, just edit its name and rule in substitutions:.

🎬 YouTube tutorial: ESPHome Smart Clock Build for Home Assistant - Under $10

🔤 The Font

These characters can be shown, in the case you see here:

Letters:  A b C c d E F G g H h I i J L l N n O o P q r S t U u y
Digits:   0 1 2 3 4 5 6 7 8 9
Symbols:  - _ = ' "  and a degree sign (° or *)

Case is forgiving. If a letter only exists in the other case, that one is used, so heat, HEAT and HEAt all work. The font still picks the shape, so a capital O looks like a zero and LoAd reads better than LOAD. N and n are both there: N is full height and n is the short one, so pick whichever reads best.

K M V W X Z can't be drawn on a 7-segment digit, so they show blank.

🤖 Actions for automations

Every action is called as esphome.wifi_clock_<action>. Durations are in milliseconds, and the display always goes back to the time on its own.

# Up to 4 characters, left aligned
action: esphome.wifi_clock_show_text
data:
  message: "HEAt"
  duration: 5000

# A number, with an optional unit. C or F also lights the degree mark
action: esphome.wifi_clock_show_number
data:
  value: 21
  unit: "C"
  duration: 5000

There's a ready-to-use example for every action in the actions folder. Paste one into a script or automation (or Developer Tools > Actions, in YAML mode) and change the values.

🙏 Credits

  • Based on misterblack1/HU-058_ESPHome - the reverse engineering of the AiP33628 LED drivers and the original ESPHome component are his work. Where the code comments mention docs/, that's his repo's docs folder.
  • ESP32-C3 port and additional functions by 3ATIVE.

💖 Support This Project

Found this useful? Want to say thanks and fuel future creations?

Your support keeps the creativity flowing! 🍺✨

Buy Me A Coffee
☕ Buy me a Coffee
Patreon
💖 Join on Patreon

Every contribution helps bring more awesome projects to life! 🚀