112

Sunset lighting automation started running an hour late after the clocks changed Troubleshooting

My outdoor lights come on at sunset minus 15 minutes, and it worked perfectly for eight months. Since the clocks went back they come on almost exactly an hour after it gets dark. The controller shows the right local time in the interface and the sunset sensor shows a sensible time for my location. Everything else that runs on a fixed clock time still runs at the right moment. Where do I even start looking?

7 answers Share
Report

Answering anonymously — a moderator will review it first.

  • @reverse_proxy_ro · 3mo ago · 3 replies

    Start with the timezone the process is running in, not the one the interface displays.

    If you are running in a container, the app can be configured with your local timezone while the container itself has no TZ set and thinks it is UTC. Most things still look right because the app converts for display, but anything that depends on the underlying clock, including sun calculations in some setups, quietly works in the wrong frame. An hour is exactly what a daylight saving mismatch looks like.

    Things to check in order:

    • date inside the container versus on the host
    • the TZ environment variable on the container
    • whether the host's tzdata package is out of date, which happens on machines that have not been updated in a year
    • whether your latitude and longitude are still set, since a wiped location can silently fall back to a default

    Fixed clock times still working is consistent with this, because those are evaluated in local time by the app itself.

    184
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
    • @yaml_yeoman · 3mo ago

      Quick way to confirm without digging: render a template that prints now() and the sunset attribute side by side and compare with your phone. If they disagree by an hour you have found it in thirty seconds.

      66
      Share
      Reply

      Answering anonymously — a moderator will review it first.

      Report
    • @trace_tilly · 3mo ago

      Out of date tzdata is a real one on Pi installs that people set up once and never touched. Rules for when the clocks change do get amended and an old database gets it wrong for a couple of weeks either side.

      24
      Share
      Reply

      Answering anonymously — a moderator will review it first.

      Report
  • @logfile_lena · 3mo ago

    Second candidate: your automation may not be using sunset at all any more. People often start with a sun trigger, test it once, then convert it to a fixed time while debugging something else and forget. Open the automation and check the trigger is still a sun trigger with an offset rather than a hardcoded 17:15 that used to be correct in October.

    87
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
  • @null_pointer_ok · 3mo ago

    Minor but worth knowing: sunset minus 15 minutes is often too late in winter anyway because of cloud and terrain. Once you fix the hour, you may find you want minus 30 in the winter months. An elevation based trigger, firing when the sun drops below about minus 4 degrees, tracks perceived darkness far better than a fixed offset does across the year.

    33
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
  • @crashloop_cara · 3mo ago · 2 replies

    Also confirm the clock on the machine is actually being synced. A Pi with no battery backed clock and a broken NTP config drifts, and I have seen a box sit an hour out after a power cut because it restored a stale time and never corrected. timedatectl will tell you in one line whether NTP is active and synchronised.

    54
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
    • @deadbug_wiring · 3mo ago

      And check it after an unplanned reboot specifically. Everything looks perfect until the power blips, then the machine boots with last known time and half your schedule slides.

      21
      Share
      Reply

      Answering anonymously — a moderator will review it first.

      Report