Skip to content

Commit 083e26b

Browse files
committed
Implement Matter Time Sync support for all Matter boards
1 parent 9ff53f2 commit 083e26b

60 files changed

Lines changed: 4660 additions & 605 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

boards.txt

Lines changed: 8 additions & 8 deletions
Large diffs are not rendered by default.

libraries/Matter/examples/matter_time_sync/matter_time_sync.ino

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
Matter Time Synchronization example
33
44
The example shows how to receive UTC time (and timezone / DST offsets) from a
5-
Matter controller and read them as Unix timestamps using the Arduino Matter
6-
API.
5+
Matter controller and read them as Unix timestamps using the Arduino Matter API.
76
87
The Time Synchronization cluster is enabled on the root endpoint. After the
98
device is commissioned, a Matter hub that supports time sync (or chip-tool
@@ -12,6 +11,10 @@
1211
1312
Compatible boards:
1413
- Arduino Nano Matter
14+
- SparkFun Thing Plus Matter
15+
- Silicon Labs xG24 Explorer Kit
16+
- Silicon Labs xG24 Dev Kit
17+
- Seeed Studio XIAO MG24 (Sense)
1518
1619
Author: Tamas Jozsi (Silicon Labs)
1720
*/

libraries/Matter/readme.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -484,13 +484,13 @@ Class for creating and controlling a Matter Power Source appliance with battery
484484

485485
## class MatterTimeSynchronization
486486

487-
Receives UTC time (and optional timezone / DST offsets) from a Matter controller via the Time Synchronization cluster on the root endpoint (not a bridged appliance). Currently enabled for Arduino Nano Matter.
487+
Receives UTC time (and optional timezone / DST offsets) from a Matter controller via the Time Synchronization cluster on the root endpoint (not a bridged appliance).
488488

489489
The device does not pull time by itself. A Matter controller that supports time sync must push `SetUTCTime` (and, when the TimeZone feature is advertised, `SetTimeZone` / `SetDSTOffset`). Use `request_time()` to emit a `TimeFailure` event so a supporting controller can push time again.
490490

491491
### Enabling time sync in Home Assistant
492492

493-
Requires Matter Server **1.2.0+** (Home Assistant Matter Server app **9.1.0+**).
493+
Requires Matter Server **1.2.0** (Home Assistant Matter Server app **9.1.0**) or later versions.
494494

495495
#### Home Assistant OS / Supervised (Matter Server add-on)
496496

@@ -540,11 +540,6 @@ docker exec matterjs-server sh -c 'echo TZ=$TZ; date; node -e "console.log(Intl.
540540

541541
`TZ` must be non-empty and resolve to your IANA zone (not `UTC`), or timezone/DST offsets pushed to the device will be zero.
542542

543-
#### Notes
544-
545-
- After a device reflash/reboot, some Matter Server versions may skip re-sync for up to 24 hours (cooldown). Restarting the Matter Server clears that state. See [matter-js/matterjs-server#938](https://github.com/matter-js/matterjs-server/issues/938).
546-
- In Matter Server logs, a successful push looks like `timeSynchronization.setUtcTime` (and `setTimeZone` / `setDstOffset` when timezone is supported) with `status: Success`.
547-
548543
```bool request_time();```
549544
Emits a `TimeFailure` event on the root endpoint so a supporting controller can push time again. Rate-limited to once per 60 seconds. Returns `false` if skipped by the rate limit or if logging fails. Controllers may still ignore the event during their own cooldown windows.
550545

package/slcp/thingplusmatter/thingplusmatter_matter.slcp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ component:
9696
from: matter
9797
- id: matter_time_format_localization
9898
from: matter
99+
- id: matter_time_synchronization
100+
from: matter
99101
- id: matter_user_label
100102
from: matter
101103
- id: matter_switch

package/slcp/xg24devkit/xg24devkit_matter.slcp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ component:
9898
from: matter
9999
- id: matter_time_format_localization
100100
from: matter
101+
- id: matter_time_synchronization
102+
from: matter
101103
- id: matter_user_label
102104
from: matter
103105
- id: matter_switch

package/slcp/xg24explorerkit/xg24explorerkit_matter.slcp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ component:
9898
from: matter
9999
- id: matter_time_format_localization
100100
from: matter
101+
- id: matter_time_synchronization
102+
from: matter
101103
- id: matter_user_label
102104
from: matter
103105
- id: matter_switch

package/slcp/xiao_mg24/xiao_mg24_matter.slcp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ component:
9898
from: matter
9999
- id: matter_time_format_localization
100100
from: matter
101+
- id: matter_time_synchronization
102+
from: matter
101103
- id: matter_user_label
102104
from: matter
103105
- id: matter_switch

test/build/test_build.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@
252252
"../../libraries/Matter/examples/matter_sensor_multiple/matter_sensor_multiple.ino": all_matter,
253253
"../../libraries/Matter/examples/matter_switch/matter_switch.ino": all_matter,
254254
"../../libraries/Matter/examples/matter_temp_sensor/matter_temp_sensor.ino": all_matter,
255+
"../../libraries/Matter/examples/matter_time_sync/matter_time_sync.ino": all_matter,
255256
"../../libraries/Matter/examples/matter_thermostat/matter_thermostat.ino": all_matter,
256257
"../../libraries/Matter/examples/matter_tvoc_sensor/matter_tvoc_sensor.ino": all_matter,
257258
"../../libraries/Matter/examples/matter_window_covering/matter_window_covering.ino": all_matter,

variants/thingplusmatter/matter/autogen/.slc_state/.crc_config.crc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ btconf/gatt_configuration.btconf=-2125273027
1010
btl_interface_cfg.h=664168518
1111
btl_interface_cfg_s2c4.h=-733541119
1212
circular_queue_config.h=130466338
13-
common/lighting-app.zap=-1264415028
13+
common/lighting-app.zap=1130675426
1414
dmadrv_config.h=281221886
1515
emlib_core_debug_config.h=1524820012
1616
matter/tracing/build_config.h=-1562925613

variants/thingplusmatter/matter/autogen/sl_component_catalog.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
#define SL_CATALOG_MATTER_THERMOSTAT_PRESENT
5858
#define SL_CATALOG_MATTER_THREAD_NETWORK_DIAGNOSTICS_PRESENT
5959
#define SL_CATALOG_MATTER_TIME_FORMAT_LOCALIZATION_PRESENT
60+
#define SL_CATALOG_MATTER_TIME_SYNCHRONIZATION_PRESENT
6061
#define SL_CATALOG_MATTER_USER_LABEL_PRESENT
6162
#define SL_CATALOG_APP_ASSERT_PRESENT
6263
#define SL_CATALOG_APP_LOG_PRESENT

0 commit comments

Comments
 (0)