Custom Parameter Time Series
Query historical data for parameters that exist outside the node configuration JSON.
信息
Added in SDK v2.1.1. Parameters in node config use Time Series Data instead.
What This Module Does ?
Query time series for backend-defined custom parameters not listed in nodeConfig, by paramName and dataType on the node.
Use node.getCustomParamTSData() / getCustomParamSimpleTSData() when the parameter is not on ESPRMDeviceParam. Use Time Series Data when the parameter is in nodeConfig.devices[].params.
Obtain the node via Node Management first.
Expected outcome: Historical data points for the named custom parameter.
Common Workflows
Query with aggregation
const tsData = await node.getCustomParamTSData({
paramName: "custom_energy_param",
dataType: "float",
startTime: 1704067200,
endTime: 1704153600,
numIntervals: 24,
aggregate: "avg",
aggregationInterval: "hour",
timezone: "America/New_York",
});
Simple query
const simpleData = await node.getCustomParamSimpleTSData({
paramName: "custom_counter",
dataType: "int",
startTime: startTimestamp,
endTime: endTimestamp,
resultCount: 100,
});
Error Handling
try {
await node.getCustomParamTSData({ paramName, dataType, startTime, endTime });
} catch (error) {
console.error("Custom TS query failed:", error);
}
Ensure paramName and dataType match the backend definition.
Advanced Concepts
Config vs custom parameters
Best Practices
- Confirm the parameter is custom before using these APIs
- Use the simpler method when aggregation is not needed
- Load the node first — Node Management
Related Resource
- API Reference: