跳到主要内容

Can RainMaker firmware handle timezones and daylight savings offset?

Yes. ESP RainMaker handles timezones and Daylight Saving Time (DST) via the Time Service. UTC is obtained via SNTP; RainMaker then converts to local time using the configured timezone and applies DST rules automatically. Schedules use this local time, so they remain correct across DST changes.

Configure timezone in firmware:

  • Location string (recommended—includes DST rules):
    esp_rmaker_time_set_timezone("America/Los_Angeles");
  • POSIX TZ string:
    esp_rmaker_time_set_timezone_posix("PST8PDT,M3.2.0,M11.1.0");
  • Build-time default: CONFIG_ESP_RMAKER_DEF_TIMEZONE="Asia/Shanghai" in menuconfig

Runtime changes from apps: Enable esp_rmaker_timezone_service_enable() so the node exposes TZ and TZ-POSIX parameters. The phone app can set timezone based on user account settings; values are stored in NVS and survive reboot.

To use timezone and DST correctly: (1) enable time sync, (2) set timezone, (3) optionally enable the timezone service for app-driven updates, (4) enable scheduling if needed. For more details, see Time Service Usage.

信息

Time service and timezone handling are enabled by default in all RainMaker examples. The phone apps set the node's timezone internally to match the user's timezone immediately after provisioning. You can view the configured timezone on the node details page in the app.