T3chW1zard / emporia-connect

Emporia Connect API enables seamless integration with Emporia devices, offering intuitive access to customer details, device data, and more. Use this repository to report issues, request features, or provide feedback.
3 stars 0 forks source link

Add Timestamps and Automatic Unit Conversion to Usage Data #2

Closed T3chW1zard closed 1 month ago

T3chW1zard commented 1 month ago

Feature Request: Add Timestamp and Automatic Unit Conversion for Historical Usage Endpoint

Description:

When using the historical-usage endpoint, the data provided lacks a timestamp or any indication of when the data was collected. This makes it difficult to correlate the usage data with specific time periods. It would be helpful if the endpoint returned a timestamp for each data point, so users can accurately track usage over time.

Additionally, the endpoint could automatically convert kilowatts (kW) to watts (W) when the data scale is in seconds or minutes. This would simplify the handling of data and prevent users from manually converting units when working with smaller time scales.

Proposed Enhancements:

  1. Add Timestamp:

    • Include a timestamp or time period for each data point in the historical-usage endpoint response.
  2. Automatic Unit Conversion:

    • Automatically convert kilowatts (kW) to watts (W) when the scale is in seconds or minutes, ensuring the unit aligns with the time scale.

Benefits:

T3chW1zard commented 1 month ago

Thank you for your suggestion!

We've added a new endpoint called /usage that includes the requested features, such as timestamps and automatic unit conversion based on the time scale. You can find the full details and usage examples in the documentation here.

The old historical-usage endpoint will remain available but has been marked as deprecated. We recommend switching to the new /usage endpoint for improved functionality moving forward.

Feel free to check out the documentation for more information!