跳到主要内容

Why am I unable to fetch time-series values for a given parameter?

If you are publishing time-series data but the query returns no results, check the following:

  1. Parameter created with PROP_FLAG_SIMPLE_TIME_SERIES — Confirm that the parameter was initialized with PROP_FLAG_SIMPLE_TIME_SERIES when creating it. Without this flag, the parameter will not be treated as a time-series parameter and data will not be stored for historical queries.

  2. Parameter name format for querying — When fetching time-series data via the API, use the full parameter name in the format <DeviceName>.<ParamName>. For example, use Sensor.Temperature, not just Temperature. The device and parameter names must match your node configuration exactly.

  3. Time service enabled — Confirm that the time service is enabled in your firmware. Time-series values are reported only if the device has obtained network time from SNTP. Without valid timestamps, the data may not be stored or returned correctly.

  4. Time window in the API — Ensure you are passing the correct time window (start and end timestamps) in your query. Data is returned only for the specified range; if the window is wrong or in the future, the result will be empty.

  5. SNTP sync — Time-series data depends on network time. If the device has not synced with SNTP (e.g., shortly after boot or with no internet), reported values may lack valid timestamps. Wait for time sync before expecting data to appear in queries.