Time Setup: Sunset Incorrect

This feature was working with my WLED Light bulbs and homemade LED Arches turning on at sunset and off at sunrise. But today I noticed that they didn’t turn on so I checked the Time setup page and noticed that instead of 1558 today it’s showing 00:00. However sunrise is showing correctly.

Any ideas?

WLED version? If 0.12 upgrade to 0.13-b6

Running 0.13.0-b6 on my led arches and 0.13.0-b4 on my athom bulbs

I can reproduce, but changing -120 just a bit resolves the issue.

1 Like

Thanks, I did try adjusting that a little yesterday but it didn’t fix. Just changed to -120.00 and it works.

It has to do with simplified/faster math we use in WLED.

so it did it again with long set to -120, changed to -121 and works again

Reading between the lines on @blazoncek, I’m hearing that the “fast math” algorithm they’ve chosen, doesn’t handle certain cases properly and you’re likely to find “magic” numbers that just don’t work. Changing just up or down from those (by even 0.1) will probably work OK as you found.

Maybe stuck with some of those till a bugfix arrives…

If you can compile yourself add this build_flags option -D WLED_USE_REAL_MATH.
WLED will use standard libc math (accurate but more memory hungry).

Personally, I’ll live with the magic numbers.
I’m much more segment memory hungry than SunsetTime hungry.

Thanks for all your efforts - Merry Christmas! :christmas_tree: