Skip to main content

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:

MetricDescriptionApplicable DevicesUnit
Energy ConsumptionEnergy consumed or used to charge a batteryBattery devicesWatt-hours (Wh)
Energy ProductionEnergy produced or discharged from a batteryBattery devicesWatt-hours (Wh)
Energy StorageLatest energy stored in a batteryBattery devicesWatt-hours (Wh)
Energy EmissionsCO2 emissions associated with energy usageBattery and Inverter devicesPounds of CO2
Energy GenerationEnergy generated by solar invertersInverter devicesWatt-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
note

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:

ParameterTypeDescriptionRequired
filterDeviceIdarray[string]Device IDs to fetch metrics forYes*
filterRangeAfterstring or nullTime range start point which to fetch metricsNo
filterRangeBeforestring or nullTime range end which to fetch metrics. If not set, defaults to nowNo
filterRangeRelativestringThe time range relative to the current time. Defaults to '1d' if range, after, and before are all not setNo
filterSiteIdarray[string]Site IDs to fetch metrics for if grouped by siteYes*
groupBystringFacet to group the metrics by (e.g. site). Allowed value: SITENo
windowSizestringTime window size (FIFTEEN_MINUTES, HOUR, DAY, WEEK, MONTH, YEAR). Default: 15 minutesNo

* 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:

ValueDescription
FIFTEEN_MINUTES15-minute intervals
HOURHourly intervals
DAYDaily intervals
WEEKWeekly intervals
MONTHMonthly intervals
YEARYearly intervals

Relative Time Ranges: You can use the filterRangeRelative parameter to specify a time range relative to the current time:

  • 1h: Last 1 hour
  • 12h: Last 12 hours
  • 1d: Last 1 day (default if no time range is specified)
  • 7d: Last 7 days
  • 30d: Last 30 days
  • 90d: Last 90 days
  • 1y: 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.

tip

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 or HOUR). For trend analysis, use larger window sizes (e.g., DAY, WEEK, or MONTH).
  • Choose between absolute and relative time ranges: Use filterRangeAfter and filterRangeBefore for precise time periods. Use filterRangeRelative 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.