Can someone pull me from this rabbit hole? I have been trying for two days to make this work, but getting the current time in ESPHome should be relatively simple.
Let me start with the end point. I have an ESP device connected to two Adafruit ht16k33 backpacks with 14-segment LED displays. That much is working. I can display text with it.print:
I did see this but the display component is a 14-segment LED, thus no font.
I have decided to shelve this project since the time display is unreliable. It starts off by being 30 seconds slow, then a few hours later it just stops updating the time.
Background:
I have built some LED displays that have two 4-character 14-segment LEDs that display the current time and my glucose levels. The code is written in Arduino C++ and gets data from Node-Red every ten seconds. Itās been a desire of mine to move it to ESPHome. I thought I was on a final stretch when I was referred to the sseib ht16k33 component, which provides a component for the 14-segment display.
But I do sincerely appreciate the feedback I have received.
Thus remove the configuration for āfontā and problem solvedā¦ You have to keep an open mind and dont forget these are just examples. You arent always going to be able to copy/paste some code you find online.
You also need to be prepared to visit the Docs pages frequently. Looking at the docs for a 7-segment display as an example. See the āConfiguration Variablesā? A quick check here will tell you that āfontā isnt something you can configure for these types of displays. Font is only for LCD type displays.
Now just use the example the docs give you minus the āformā configuration variable. Thereās even a āTimeā example on the 7-segment docs pageā¦
Interesting. The main difference from my code is that I used the strftime() function.
At any rate, your code is still working after two hours, but itās the overnight timing that I want to see before proceeding with my project.
I did see some older posts and people were having time sync problems and for whatever reason they fixed it by either using a static IP or not using a static IP. I cant remember which it was now but, it was one or the other.
I doubt it. It just reformats a date/time to a string, its pretty basic. I was looking earlier to see how often the time_sync happens and if you can force an update in the event of a growing time difference. I didnt see a way to do it or the default update frequency.
Your code syncs the time pretty well. The display shows HHMM, and the minutes updates within a second of the PC clock.
But, as before, the time display just stops updating after a few hours. Restarting the device does not get the time back, restarting HomeAssistant does.
I see it but post 1 doesnāt print the time on either display and youāve got code chunks in every other post from editing and changing your config. I donāt remember getting a paycheck from you in the mail Friday so post your most recent config so I donāt have to work so hard! You trying to make my brain hurt?
what is confusing is the time in esphome is staying in sync but, the time printed on your display isnāt? The only way to sync the displayed time is to restart HA?