# Energy Report

### Creating an Energy Report

1. Navigate to the Reports section and click "Create Report"
2. Select "Energy" as the Report Type
3. Configure basic settings:
   * Report Name: Provide a descriptive name
   * Timezone: Select appropriate timezone
   * Schedule: Set execution time and days

<figure><img src="https://2221155863-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LNA8_b8wmabHgJ0QXoJ%2Fuploads%2FPXIC1YS4vmEzGdRD0cCd%2Fimage.png?alt=media&#x26;token=00ada91d-36bb-46af-b117-f7039fff00f1" alt=""><figcaption><p>Basic Settings</p></figcaption></figure>

### Report Configuration

#### Email Settings

* Add recipient email addresses
* Select email branding template if you have one or more [White Label sites](https://docs.datacake.de/portal/white-label)

#### Device Selection

* Choose between:
  * Explicit: Select specific devices
  * Product: Include all devices from a product

#### Timeframe Options

**Preset Timeframes**

* Last 7 days (bucketed by day)
* Last 30 days (bucketed by week)
* This month (bucketed by week)
* This year (bucketed by month)
* Custom range (configurable bucket width)

**Custom Range Configuration**

* From: Start date (e.g., "7 days ago")
* Until: End date (e.g., "now")
* Bucket width: Day/Week/Month

<figure><img src="https://2221155863-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LNA8_b8wmabHgJ0QXoJ%2Fuploads%2F6xGGepog8HB7URh17vzV%2Fimage.png?alt=media&#x26;token=57a36392-274e-41e1-8820-71b1c091638a" alt=""><figcaption><p>Energy Report Settings</p></figcaption></figure>

### Understanding Time Bucketing

Time bucketing determines how data is aggregated in the report. Each bucket represents a time period with opening and closing values.

#### Example Data and Bucket Calculation

<figure><img src="https://2221155863-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LNA8_b8wmabHgJ0QXoJ%2Fuploads%2F7OTFoOD8WvL04fBIKZjL%2FCleanShot%202025-02-07%20at%2016.16.43%402x.png?alt=media&#x26;token=21385874-d1a7-422f-a534-4e5ca1c44332" alt=""><figcaption><p>Sample Data</p></figcaption></figure>

With monthly buckets, the Excel report generates:

**January Sheet:**

* Open: 3 (First value in January)
* Close: 12 (First value in February)

**February Sheet:**

* Open: 12 (First value in February)
* Close: 18 (First value in April, as March has no data)

**March Sheet:**

* Open: 18 (Last known value)
* Close: 18 (Next available value)

**April Sheet:**

* Open: 18 (First value in April)
* Close: N/A (Since no data newer than April exists)

<figure><img src="https://2221155863-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LNA8_b8wmabHgJ0QXoJ%2Fuploads%2FZ7D6FiofdUgznYCKrMbf%2Fimage.png?alt=media&#x26;token=4680e7ca-33df-4613-9e45-f39c5b6d1868" alt=""><figcaption><p>Report Data</p></figcaption></figure>

#### Bucket Calculation Rules

1. Open Value = First value in bucket period
2. Close Value = First value in next bucket period
3. If no data exists in bucket, use next available value for both open/close
4. Consumption = Close - Open

#### Time Bucketing Process

1. Raw data points are collected
2. Points are grouped by bucket width (day/week/month)
3. Each bucket becomes a sheet in Excel
4. Devices listed as rows in each sheet
5. Open/close values calculated per bucket
6. Consumption computed as difference between close and open
