TL;DR — mattertimectl 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:
- IKEA's own DIRIGERA hub does it (and Homey Pro), re-pushing the time after every power-off. The common advice in those threads is, more or less, "buy a IKEA Dirigera hub."
- SmartThings is unreliable with some never get the clock back and there's no button to trigger a sync. Others say it eventually syncs but takes a long time.
- Apple Home apparently doesn't set the time at all.
- Home Assistant's built-in Matter integration can't write the time cluster in the first place, which is exactly why the cottage industry of fixes below exists.
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.
- Any time zone, not just European ones. DST offsets come straight from the IANA time-zone database, so they're correct for Sydney or Toronto the same as for Paris, and the DST list is bounded to what the device can actually store.
- It speaks the device's language. Matter-epoch microseconds only at the wire, with the right granularity and time source, so the write is accepted, then it reads the clock back to confirm the device took it.
- One binary, one job. No daemon, no database, no runtime. A ~3 MB binary and a small JSON config.
- Runs from a timer. Each run connects, sets the clock, verifies, and exits; a systemd timer fires it hourly, and staleness is bounded by the interval.
- Safe by default. It won't push time unless the host's own clock is NTP-trusted.
- Thread without the baggage. No Thread radio, no border router of its own, and no BLE; it reaches Thread devices over IPv6 through the border routers already on the network (ex: HomePods, an Apple TV, etc.).
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.
