Metrics
Time-series energy data for analysis, monitoring, and insights
Metrics in Texture are time-series data points that represent energy usage, production, storage, and environmental impact across your devices and sites. Each metric is organized into configurable time buckets—from 15-minute intervals to yearly aggregations—enabling both real-time monitoring and long-term trend analysis.
Why Metrics?
Metrics enable you to:
- Monitor Performance — Track energy consumption, production, and storage in real-time
- Analyze Trends — Identify patterns across hours, days, weeks, or months
- Calculate Emissions — Measure environmental impact with CO2 data
- Optimize Operations — Use data-driven insights for energy management
- Enable Automation — Trigger workflows based on metric thresholds
- Generate Reports — Create dashboards and analytics for stakeholders
Metrics serve as the primary data source for energy intelligence across the Texture Platform.
Available Metrics
Texture currently offers five core metrics that cover the essential aspects of energy systems:
Metric | Description | Applicable Devices | Unit |
---|---|---|---|
Energy Consumption | Energy consumed or used to charge a battery | Battery devices | Watt-hours (Wh) |
Energy Production | Energy produced or discharged from a battery | Battery devices | Watt-hours (Wh) |
Energy Storage | Latest energy stored in a battery | Battery devices | Watt-hours (Wh) |
Energy Emissions | CO2 emissions associated with energy usage | Battery and Inverter devices | Pounds of CO2 |
Energy Generation | Energy generated by solar inverters | Inverter devices | Watt-hours (Wh) |
Each metric follows consistent data structures and API patterns, making them easy to integrate into your applications.
Metric Types and Usage
Energy Consumption
Energy Consumption measures the amount of energy consumed or used to charge a battery in watt-hours (Wh). This metric only applies to battery devices.
Data Characteristics:
- Unit: Watt-hours (Wh)
- Time Domain: Data may be sparse, as values are only present when the battery is charging
- Aggregation: Each time bucket contains the total energy consumed during that period
API Reference:
GET /v1/metrics/consumption
Example Usage:
const response = await fetch(
'https://api.texturehq.com/v1/metrics/consumption?filterDeviceId[]=device123&filterRangeAfter=2025-04-10T00:00:00Z&filterRangeBefore=2025-04-10T23:59:59Z&windowSize=HOUR',
{
headers: {****
'texture-api-key': 'YOUR_API_KEY'
}
}
);
const data = await response.json();
Energy Production
Energy Production measures the amount of energy produced or discharged from a battery in watt-hours (Wh). This metric only applies to battery devices.
Data Characteristics:
- Unit: Watt-hours (Wh)
- Time Domain: Data may be sparse, as values are only present when the battery is discharging
- Aggregation: Each time bucket contains the total energy produced during that period
API Reference:
GET /v1/metrics/production
Example Usage:
const response = await fetch(
'https://api.texturehq.com/v1/metrics/production?filterDeviceId[]=device123&filterRangeAfter=2025-04-10T00:00:00Z&filterRangeBefore=2025-04-10T23:59:59Z&windowSize=HOUR',
{
headers: {
'texture-api-key': 'YOUR_API_KEY'
}
}
);
const data = await response.json();
Energy Storage
Energy Storage measures the amount of energy stored in a battery in watt-hours (Wh). This metric reports the latest charge for each time period. This metric only applies to battery devices.
Data Characteristics:
- Unit: Watt-hours (Wh)
- Aggregation: Each time bucket contains the latest charge value for that period
- Continuity: This metric typically provides continuous data as long as the battery is operational
API Reference:
GET /v1/metrics/storage
Example Usage:
const response = await fetch(
'https://api.texturehq.com/v1/metrics/storage?filterDeviceId[]=device123&filterRangeAfter=2025-04-10T00:00:00Z&filterRangeBefore=2025-04-10T23:59:59Z&windowSize=HOUR',
{
headers: {
'texture-api-key': 'YOUR_API_KEY'
}
}
);
const data = await response.json();
Energy Emissions
Energy Emissions measures the total pounds of CO2 emitted during a specific time period, calculated using marginal emissions data from our partnership with WattTime. This metric applies specifically to battery and inverter devices.
Data Characteristics:
- Unit: Pounds of CO2
- Aggregation: Each time bucket contains the total emissions during that period
- Applicability: This metric applies to both battery and inverter devices
- Methodology: Based on WattTime's Marginal Operating Emissions Rate (MOER), which represents the emissions rate of electricity generators responding to load changes on the local grid at a given time
- Coverage: 5-minute granularity with 2+ years of historical data and 72-hour forecasts
Emissions Data Availability
Marginal emissions data is currently available for U.S. regions only. International coverage is expanding. Contact us if you need emissions data for specific regions outside the U.S.
API Reference:
GET /v1/metrics/emissions
Example Usage:
const response = await fetch(
'https://api.texturehq.com/v1/metrics/emissions?filterDeviceId[]=device123&filterRangeAfter=2025-04-10T00:00:00Z&filterRangeBefore=2025-04-10T23:59:59Z&windowSize=HOUR',
{
headers: {
'texture-api-key': 'YOUR_API_KEY'
}
}
);
const data = await response.json();
Energy Generation
Energy Generation measures the amount of energy generated or produced by solar inverters in watt-hours (Wh). This metric only applies to inverter devices.
Data Characteristics:
- Unit: Watt-hours (Wh)
- Time Domain: Data may be sparse, as values are only present during daylight hours when solar generation is active
- Aggregation: Each time bucket contains the total energy generated during that period
API Reference:
GET /v1/metrics/generation
Example Usage:
const response = await fetch(
'https://api.texturehq.com/v1/metrics/generation?filterDeviceId[]=device123&filterRangeAfter=2025-04-10T00:00:00Z&filterRangeBefore=2025-04-10T23:59:59Z&windowSize=HOUR',
{
headers: {
'texture-api-key': 'YOUR_API_KEY'
}
}
);
const data = await response.json();
API Reference
Request Parameters
All metric endpoints accept the following common parameters:
Parameter | Type | Description | Required |
---|---|---|---|
filterDeviceId | array[string] | Device IDs to fetch metrics for | Yes* |
filterRangeAfter | string or null | Time range start point which to fetch metrics | No |
filterRangeBefore | string or null | Time range end which to fetch metrics. If not set, defaults to now | No |
filterRangeRelative | string | The time range relative to the current time. Defaults to '1d' if range, after, and before are all not set | No |
filterSiteId | array[string] | Site IDs to fetch metrics for if grouped by site | Yes* |
groupBy | string | Facet to group the metrics by (e.g. site). Allowed value: SITE | No |
windowSize | string | Time window size (FIFTEEN_MINUTES, HOUR, DAY, WEEK, MONTH, YEAR). Default: 15 minutes | No |
* Either filterDeviceId
or filterSiteId
must be provided, and either filterRangeAfter
or filterRangeRelative
must be provided.
Response Format
All metric endpoints return data in a consistent format:
{
"data": [
{
"ts": "2025-04-10T00:00:00.000Z",
"v": 1234.56,
"deviceId": "device123",
"siteId": null,
"customerId": null
},
// Additional time buckets...
],
"meta": {
"label": "energyConsumedWhr",
"series": [
"device123"
],
"sparse": false,
"unit": "WATT_HOURS",
"displayUnit": "whr",
"domainMeta": {
"label": "time",
"sparse": false,
"rate": {
"unit": "HOUR",
"displayUnit": "h",
"scaleFactor": 1
}
}
}
}
Time Windows and Aggregation
Window Size Options:
The windowSize
parameter determines the granularity of the time buckets in the response:
Value | Description |
---|---|
FIFTEEN_MINUTES | 15-minute intervals |
HOUR | Hourly intervals |
DAY | Daily intervals |
WEEK | Weekly intervals |
MONTH | Monthly intervals |
YEAR | Yearly intervals |
Relative Time Ranges:
You can use the filterRangeRelative
parameter to specify a time range relative to the current time:
1h
: Last 1 hour12h
: Last 12 hours1d
: Last 1 day (default if no time range is specified)7d
: Last 7 days30d
: Last 30 days90d
: Last 90 days1y
: Last 1 year
Data Aggregation: When requesting metrics with different window sizes, the data is aggregated as follows:
- Sum Aggregation: Consumption, Production, Emissions, Generation
- Latest Value Aggregation: Storage
For example, when requesting hourly data for a day, you'll receive 24 data points, each containing the appropriate aggregation for that hour.
Grouping by Site:
You can group metrics by site using the groupBy=SITE
parameter along with filterSiteId
to specify which sites you want data for. This is useful when you want to analyze metrics across multiple devices belonging to the same site.
Data Freshness
Consumption, production, generation, and storage metrics are available with minimal latency. Emissions data relies on data sync jobs and may have some lag. For immediate device state changes, consider using the Events API.
Best Practices
- Use the appropriate window size: For high-resolution analysis, use smaller window sizes (e.g.,
FIFTEEN_MINUTES
orHOUR
). For trend analysis, use larger window sizes (e.g.,DAY
,WEEK
, orMONTH
). - Choose between absolute and relative time ranges: Use
filterRangeAfter
andfilterRangeBefore
for precise time periods. UsefilterRangeRelative
for rolling time windows relative to now. - Optimize for sparse data: Some metrics like Consumption and Production may have sparse data in time periods when the battery is not active. Your application should handle these gaps appropriately.
- Group by site when appropriate: When analyzing trends across multiple devices at the same site, use the
groupBy=SITE
parameter instead of making multiple device requests. - Cache responses when possible: To improve application performance, consider caching responses for frequently accessed time ranges that don't change often (like historical data).
Next Steps
- Explore the full Metrics API reference
- Test different window sizes and time ranges
- Build dashboards and analytics using metric data
- Integrate metrics into your energy management workflows
Metrics provide the foundation for data-driven energy intelligence in Texture—enabling monitoring, analysis, and automation across your energy infrastructure.