An IKEA ALPSTUGA on a wood desk showing 1:12 PM on its LED dot-matrix display

TL;DRmattertimectl is a tiny, single-binary Matter controller that keeps device clocks correct. It joins an existing Matter fabric as an extra administrator and pushes the time through the standard Time Synchronization cluster, on any ecosystem, with no Home Assistant or extra hub required.

The problem: complex inconsistency

The IKEA ALPSTUGA air-quality monitor is actually mainly a little desk clock. But, it has no battery-backed clock inside so every power cycle resets it. Its as smart as a microwave clock. Matter luckily allows for Matter-based time sync so long as the controllers (Apple, Google, Amazon, etc.) support it.

Unfortunately not all of the major Matter controllers fully support time sync, and some not at all. It's a recurring complaint: who is responsible for restoring the time, whether the device re-requests it after a reboot, how to get ALPSTUGA time sync working over Thread, and syncing Matter device clocks in general.

It depends entirely on the hub

Whether a device ever gets the time back is decided by which hub it happens to be paired to:

The software fix is a pile of Home Assistant

When the hub doesn't do it, the answer today is Home Assistant plus glue. It started as a Python script that opens a WebSocket to HA's Matter Server and sends SetUTCTime; that grew into a custom component and a stack of automations people trade around, including gnarly ones that special-case the daylight-saving "duplicate hour" and rate-limit the flood of devices all reconnecting at once after an outage.

It works, and it's clever. But it's a lot of house to keep one clock correct. Running Home Assistant, its Matter Server add-on, a custom integration, an exposed WebSocket port, and a timezone-aware automation, all so a little display shows the right time.

And the time itself is genuinely fiddly

The reason this keeps tripping people up is that the devices are picky about the write. The ALPSTUGA rejects SetUTCTime unless it is handed Matter-epoch microseconds, the right granularity, and a time source. Time zone and DST are their own minefield: in those threads people hit ConstraintError (0x87) the moment they use a non-European zone (Australia/Sydney, Asia/Tokyo, America/Toronto), and found that if the DST offset isn't set just right, the time zone is silently ignored.

The solution: mattertimectl

mattertimectl is a single Rust binary that does this one job, correctly, on any Matter setup, without adopting a home-automation platform.

It structured as a secondary controller which joins the devices' existing fabric as an additional Matter administrator (Matter "multi-admin") on its own fabric, and pushes the time through the standard cluster. The primary ecosystem (Apple Home, SmartThings, Google, etc.) keeps working untouched. mattertimectl is just one more admin on the fabric so it's ecosystem-agnostic by construction.

Since it's a simple binary, it can be run from MacOS as a one off as well.

It builds and runs on Linux and macOS today. Because it's already a small, single-purpose binary with a tiny state footprint, a natural next step is a port to the ESP32, so the whole job could fit on a cheap microcontroller instead of a Raspberry Pi.

Using it

Commission each device once, inside a pairing window opened in the primary app, then let a timer drive it:

sudo -u mattertimectl mattertimectl commission <pairing-code>
sudo systemctl enable --now mattertimectl.timer

That's the whole setup. The ALPSTUGA gets the right time a couple of minutes after boot and every hour after, with nothing left to think about.

It's built on rs-matter, the official CSA Rust Matter stack. Source is at src.nth.io/luke/mattertimectl (with a GitHub mirror), and prebuilt aarch64 Linux and macOS binaries are on the releases page.