# Time-of-use rates card

> Canonical HTML: https://screenrig.ai/docs/cards/tou-rates/

Display the current electricity rate and when it next changes.

Supplied weekday tariff windows determine the current energy price, next change and today’s bands. Dated overrides cover all-day exceptions, while windows running overnight follow their start weekday. The daily timeline tracks the local clock through daylight-saving changes, and any uncovered period stays unknown.

## Live card

This card is drawn in your browser by the same code the Players run, with sample data.

Category: Finance. Tags: Prices and rates, Schedules, Offices and workplaces.

## Layouts

This fullscreen card fills the whole screen in landscape or portrait and is not placed as a corner, chip, or strip.

Layouts: full. Forms: landscape, portrait.

[Card layouts, themes and publishing](/docs/cards/). [Browse the cards](/apps/#cards).

## Data and privacy

This card uses its configured properties and live card data.

Tariff schedules only; no meter or customer identity is required.

## Properties

For theme, background, accent and position, see [Common properties](/docs/cards/#common-properties).

Set static properties in `params`. Bind `data` to a project card data key for live values; that document holds only dynamic properties. Without a data key, put the complete configuration in `params`. Nested rows describe the contents of their parent property.

### Static properties

| Name | Type | Default | Values and limits | Description |
| --- | --- | --- | --- | --- |
| `currency` | string | `"CAD"` | pattern: `"^[A-Z]{3}$"` |  |
| `priceDecimals` | integer | `3` | minimum: `0`; maximum: `6` |  |
| `perPage` | integer | `6` | minimum: `2`; maximum: `8` |  |
| `pageSeconds` | integer | `12` | minimum: `8`; maximum: `120` |  |
| `followCurrent` | boolean | `true` |  |  |

### Dynamic properties

| Name | Type | Default | Values and limits | Description |
| --- | --- | --- | --- | --- |
| `title` | string | `"Electricity rates"` | maxLength: `100` |  |
| `provider` | string | `""` | maxLength: `120` |  |
| `footnote` | string | `""` | maxLength: `240` |  |
| `updatedAt` | string | `""` | maxLength: `64` |  |
| `bands` | array | `[]` | maxItems: `24` | First matching interval wins. Overnight windows use the start weekday. Equal start/end spans to that local time the next day. Missing coverage stays unknown. |
| `bands[].id` | string |  | minLength: `1`; maxLength: `48`; Required |  |
| `bands[].label` | string |  | minLength: `1`; maxLength: `60`; Required |  |
| `bands[].days` | array |  | minItems: `1`; maxItems: `7`; Required |  |
| `bands[].start` | string |  | pattern: `"^([01][0-9]\|2[0-3]):[0-5][0-9]$"`; Required |  |
| `bands[].end` | string |  | pattern: `"^([01][0-9]\|2[0-3]):[0-5][0-9]$"`; Required |  |
| `bands[].rateUnits` | integer |  | minimum: `0`; maximum: `100000000`; Required | Price per kWh in currency units scaled by10^priceDecimals. |
| `bands[].kind` | string | `"custom"` | `"off-peak"`, `"shoulder"`, `"peak"`, `"custom"` |  |
| `bands[].note` | string | `""` | maxLength: `140` |  |
| `dayOverrides` | array | `[]` | maxItems: `120` | Each explicit local date uses the referenced band price all day, overriding weekly windows. First date entry wins. An unknown band id yields unknown pricing. |
| `dayOverrides[].date` | string |  | pattern: `"^[1-9][0-9]{3}-[0-9]{2}-[0-9]{2}$"`; Required |  |
| `dayOverrides[].bandId` | string |  | minLength: `1`; maxLength: `48`; Required |  |

## Canvas example

Add this item to a playlist page’s `primitives`. [Publish the playlist and assign a screen](/docs/cards/#publish-a-card-canvas).

```json
{
  "id": "tou-rates",
  "primitive": "card",
  "card": "tou-rates",
  "major": 1,
  "params": {
    "theme": "neomustard"
  },
  "rect": {
    "x": 0,
    "y": 0,
    "width": 1920,
    "height": 1080
  },
  "layer": 0,
  "content_fit": "fill",
  "data": "example-key"
}
```

## Write live data

The canvas example binds its `data` field to `example-key`. That value is a data key: a name this canvas item chooses, not the name of the card. Give each canvas item its own key when items should show different data, or share one key when they should show the same data. Keys are scoped to the project, follow the K/V key grammar, and cannot start with `feed:`.

Create this document before showing the card, then replace it to update the screen without republishing. Writes to a key that live canvas items bind are checked against each bound card’s dynamic properties. Use the same project as the playlist.

Save the document as `card-data.json`. The CLI reads the document itself, with no wrapper:

```json
{
  "title": "Electricity rates",
  "provider": "",
  "footnote": "",
  "updatedAt": "",
  "bands": [],
  "dayOverrides": []
}
```

```console
screenrig card-data put example-key --file card-data.json
```

Or call the API directly. The API wraps the same document in a `document` field. An agent token already names its project, so no project header is sent; if you send `ScreenRig-Project`, it must match the token’s project. Supply your API authorization through the environment; see [API authentication](/docs/authentication/).

```console
curl --request PUT "https://api.screenrig.ai/api/card-data/example-key" \
  --header "Authorization: Bearer $SCREENRIG_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{"document":{"title":"Electricity rates","provider":"","footnote":"","updatedAt":"","bands":[],"dayOverrides":[]}}'
```
