Support for Digital Clocks

Hi guys, first of all let me say that this project is really amazing!!
I saw many 7-segment style digital clock on Thingiverse and decided to print one. Unfortunately none of them was very complete on the firmware side so I’ve added myself the support for most of them.
I have made the firmware as configurable as possible in order to have the possibility to support the largest number of designs.
Here on my blog there is the full description of what I’ve done.
I’ve already made a pull request to the master branch in order to get this feature available directly on future releases of WLED.
With a bit of more work I’ll also add support for 6 digits displays.
Let me know what do you think about it and if you’re a WLED code manteiner I’ll appreciate some hints on where is the best place to put defines and globals (the one that I added in overlay.cpp).

How do you handle the : between the HH:MM and MM:SS?
Just turn them on at the same brightness as the LEDs on each side of them? I say that because each digit could be a segment with its own LED strip, color palette, effect, intensity, speed.

With that approach, HA software could then trigger actions to specific events which control specific digits, like it could be temporarily converted to a countdown timer, or stock ticker, with things like stock price is currently up / same / down from yesterday and rising / steady / falling embedded within the digits.

Or, HA software could see an upcoming calendar entry and pulse the clock for a bit when the first calendar notification happens, and adjust the color as the time gets closer to it.

Many different variations available once a subset (segment) of the entire string of LEDs visually represents a digit outline.

I think it is fantastic you got your WLED digital clock to work and then made it easy to fully integrate into WLED for everyone. Any [time-lapsed] video of it in action?

Hi, thanks for your interest.
The dots are just blinking with 1Hz freq. So being an overlay whatever effect you select it will blinck at this frequency.
Yeah, I have splitted the strip in 5 segment, 1 foreach digit and 1 for the dots.
With this approach, as you said, you can do whatever you want!
I’m still learning how to send a countdown and display it. At the moment is not implemented. If you have some good starting point I can try to implement it.

Simply change the data source from current time to the countdown timer’s current value.
The source change could be detected from an API call (which is easy to test because it’s automatically available to the usermod - if you wrote it as a usermod). Or it could be a UI modification, like in the clock configuration, check-box for digital / analog clock, and if digital is checked, countdown preset (in seconds) could be entered. If countdown preset is not null or 0 (and digital clock is enabled), a checkbox for automatically switch to countdown timer if preset is not 0. Then every second that passes, the preset reduces by 1 second.

If your digital clock also has a decimal place (or the layout lends itself to making it look like there is one) and you have a desire to raise people’s blood pressure, you could call it the “self-destruct countdown timer” - which always stops at 0.4 seconds left… :skull_and_crossbones:

1 Like

My mod is implemented as an overlay and it can be enabled under Time settings, in the dropdown menu.
Have you some docs reference in particular for the countdown?
I’ve searched the wled wiki but can’t find anything about it. I had to investigate it more.
I definitely want to implement it, could be a very nice feature with a lot of possibilities, like for example displaying the remeaning time for an Alexa (or Home Assintant) countdown.
[EDIT] Fount the countdown checkbox in the UI, need to understand how it is managed in the code, there should be a global if it is enabled.
I’ll deepen and update the post!

1 Like

With existing WLED HA & NodeRed support, the possibilities are quite far reaching indeed.

I do like how you were thinking about an Alexa timer countdown as an example. A voice-activated countdown digital display that reverts to being a clock. Or, for a new year’s even party, countdown to midnight and the new year.

Just a different way to think about what you already were looking into doing.

1 Like

I’m just curious if you were ever able to integrate any kind of countdown with Home Assistant or (more importantly to my wife) Alexa.

Hey. I’m a novice to WLED and most Arduino/ESP coding. I usually work in Swift UI, but I’m trying to make an LED 7-segment clock using 2812’s. I have all of the digits built and can easily change order of segments. I need some guidance with getting WLED to display a clock and you seem to have done it. Any help greatly appreciated.