Alexa.DeviceUsage.Meter interface in your Alexa add-on so that customers can view their energy use. Use the Alexa.DeviceUsage.Meter interface with your devices that measure energy use, such as electric and natural gas meters. The Alexa.DeviceUsage.Meter interface is intended to help customers manage their energy usage with the Alexa energy dashboard. For details, see Smart Home Energy Overview.
If your device doesn’t measure energy consumption directly, such as a thermostat, use the Alexa.DeviceUsage.Estimation interface instead.
Unlike other interfaces, proactive reporting isn’t optional. When you support the Alexa.DeviceUsage.Meter interface, you must send proactive events to the Alexa event gateway. You are required to send MeasurementsReport events.
For the list of locales that the Alexa.DeviceUsage.Meter interface supports, see List of Alexa Interfaces and Supported Languages. For the definitions of the message properties, see Alexa Interface Message and Property Reference.
Utterances
TheAlexa.DeviceUsage.Meter interface doesn’t have any user utterances. Instead, you send energy usage events to Alexa, so that Alexa can report energy use to the customer.
Data measurement resolution
You set a default resolution, in seconds, for how often you report data measurements of energy use. Amazon recommends a minimum resolution of 3,600 (hourly) and a maximum resolution of 86,400 (daily). The resolution you specify determines how the data appears to the user. Alexa doesn’t assume a constant rate of energy use between data points, and doesn’t imply that to the user. Unless there is an extended period of zero energy use, your data reporting shouldn’t fall below your default resolution. If you report data more frequently than hourly, your data isn’t all recorded. If you report data less frequently than daily, useful data doesn’t appear to the user.Reportable properties
TheAlexa.DeviceUsage.Meter interface doesn’t have any reportable properties.
Discovery
You describe endpoints that supportAlexa.DeviceUsage.Meter using the standard discovery mechanism described in Alexa.Discovery.
For the full list of display categories, see display categories.
Configurations object
In addition to the usual discovery response fields, forAlexa.DeviceUsage.Meter, include a configurations object that contains an energySources object that contains an electricity object, a naturalGas object, or both. The electricity object and the naturalGas object each contain the following fields.
| Field | Description | Type |
|---|---|---|
unit | The unit of measure for the energy source. One of MILLIWATT_HOUR, BTU, CUBIC_FOOT. | String |
measuringMethod | The method you use to measure energy use. MEASURED if your device has dedicated hardware to physically measure energy use; otherwise, ESTIMATED. | String |
defaultResolution | The resolution of your data readings, in seconds. Amazon recommends a minimum resolution of 3,600 (hourly) and a maximum resolution of 86,400 (daily). For details, see data measurement resolution. | Number |
Discover response example
The following example shows aDiscover.Response message for a meter that supports the Alexa.DeviceUsage.Meter interface.
Directives and events
TheAlexa.DeviceUsage.Meter interface defines the following directives and events.
ReportMeasurements directive
Support theReportMeasurements directive so that Alexa can request data from you. The payload of the ReportMeasurements directive is empty.
ReportMeasurements directive example
The following example illustrates aReportMeasurements directive that Alexa sends to your add-on.
ReportMeasurements response
If you handle aReportMeasurements directive successfully, first respond with an Alexa.Response event. You can respond synchronously or asynchronously. If you respond asynchronously, include a correlation token and a scope with an authorization token. The payload for the response is empty.
After you send your Response event, send a MeasurementsReport event to report your data to Alexa.
The following example shows a ReportMeasurements response.
ReportMeasurements directive error handling
If you can’t handle aReportMeasurements directive successfully, respond with an Alexa.ErrorResponse event.
ReduceResolution directive
Support theReduceResolution directive so that Alexa can notify you when you are sending messages to the Alexa event gateway too frequently.
ReduceResolution directive example
The following example illustrates aReduceResolution directive that Alexa sends to your add-on.
ReduceResolution directive payload
| Field | Description | Type |
|---|---|---|
limit | The upper bound for the resolution of the data you report to Alexa, in seconds. This limit overrides the defaultResolution that you report in your discovery response. If you continue to report data at a higher resolution, you might encounter throttling exceptions, and some data points might be dropped. | Number |
duration | Reduce the resolution for this amount of time. The time period is represented in ISO 8601 duration format. If the duration field isn’t present, reduce the resolution until you receive a new ReduceResolution directive. | String |
ReduceResolution response
If you handle aReduceResolution directive successfully, respond with an Alexa.Response event. You can respond synchronously or asynchronously. If you respond asynchronously, include a correlation token and a scope with an authorization token. The payload for the response is empty.
The following example shows a ReduceResolution response.
ReduceResolution directive error handling
If you can’t handle aReduceResolution directive successfully, respond with an Alexa.ErrorResponse event.
InvalidMeasurementError directive
Support theInvalidMeasurementError directive so that Alexa can notify you when you have sent an invalid data point.
InvalidMeasurementError directive example
The following example illustrates aInvalidMeasurementError directive that Alexa sends to your add-on.
InvalidMeasurementError directive payload
The payload contains a field namedelectricity or naturalGas. The field is an object that contains the following fields.
| Field | Description | Type |
|---|---|---|
errorCode | The error code for the invalid data, such as NEGATIVE_VALUE. For the full list of error codes, see error codes. | String |
timeOfError | end timestamp of the data that you sent.Defined in ISO 8601 format, YYYY-MM-DDThh:mm:ssZ | String |
InvalidMeasurementError response
If you handle aInvalidMeasurementError directive successfully, respond with an Alexa.Response event. You can respond synchronously or asynchronously. If you respond asynchronously, include a correlation token and a scope with an authorization token. The payload for the response is empty.
The following example shows an InvalidMeasurementError response.
InvalidMeasurementError directive error handling
If you can’t handle aInvalidMeasurementError directive successfully, respond with an Alexa.ErrorResponse event.
MeasurementsReport event
Send aMeasurementsReport event to the Alexa event gateway to proactively report a batch of one or more energy use measurements to Alexa.
Send MeasurementsReport events to the Alexa event gateway at times that are uniformly distributed throughout the day, to the second, for all events generated by your add-on for all customers. For example, you can add a random wait time to each event before sending it. You can send batches of data based on the size and age of the data, instead of the time of day.
MeasurementsReport event example
MeasurementsReport event payload
You must include at least one of the following fields in the payload:electricityIntervalsnaturalGasIntervals
DIR directive.
| Property | Description | Type | Required |
|---|---|---|---|
electricityIntervals | Amount of electricity used over a period of time. You must include at least one of electricityIntervals or naturalGasIntervals. | Array of objects | No |
electricityIntervals[].usage | Amount of energy used between the start and end interval. | Number | Yes |
electricityIntervals[].start | Start time of the interval. Defined in ISO 8601 format, YYYY-MM-DDThh:mm:ssZ | String | Yes |
electricityIntervals[].end | End time of the interval. Defined in ISO 8601 format, YYYY-MM-DDThh:mm:ssZ | String | Yes |
naturalGasIntervals | Amount of natural gas used over a period of time. You must include at least one of electricityIntervals or naturalGasIntervals. | Array of objects | No |
naturalGasIntervals[].usage | Amount of energy used between the start and end interval. | Number | Yes |
naturalGasIntervals[].start | Start time of the interval. Defined in ISO 8601 format, YYYY-MM-DDThh:mm:ssZ | String | Yes |
naturalGasIntervals[].end | End time of the interval. Defined in ISO 8601 format, YYYY-MM-DDThh:mm:ssZ | String | Yes |
AddOrUpdateReport
You must proactively send anAlexa.Discovery.AddOrUpdateReport message if the feature support of your endpoint changes. For example, if you change your default reporting schedule from hourly to daily you must send an AddOrUpdateReport message. For details, see AddOrUpdateReport event.
AddOrUpdateReport event example
Troubleshooting
Error codes
The following are the error codes that Alexa sends in the InvalidMeasurementError directive.| Error Code | Description |
|---|---|
NEGATIVE_VALUE | You reported a negative value for energy usage. |
IN_FUTURE | You reported a value with a timestamp in the future. Any data reported with a timestamp that’s more than a few seconds in the future is rejected. A few seconds is considered a minor clock inaccuracy. |
INVALID_INTERVAL_START_END | You reported an interval that starts after it ends. |
INTERVAL_OVERLAP | You reported an interval that overlaps with an interval that you reported previously. |
Other possible issues
Alexa sends an InvalidMeasurementError directive that contains an error code if you send invalid data. If you send messages to the Alexa Gateway too frequently, Alexa sends you a ReduceResolution directive. In addition, if you notice unexpected behavior, consider the following issues:- Avoid sending duplicate data to the Alexa Event Gateway.
- Alexa expects your data to be as current as possible. Don’t send data that’s more than one day old.
- It’s important for timestamps to be accurate. Synchronize with Coordinated Universal Time (UTC) regularly.
- Intervals shouldn’t be longer than the
defaultResolutionyou sent in your discovery response. - In case the device resets unexpectedly, gaps between intervals can occur.
- Send batched updates in chronological order.

