Statistics Graph Card


The Statistics Graph card allows you to display a graph of statistics data for each of the entities listed.

Statistics are gathered every hour for sensors that support it. It will either keep the min, max and mean of a sensors value for a specific hour, or the sum for a metered entity.

If your sensor doesn’t work with statistics, check this.

Screenshot of the statistics graph card for power entities Screenshot of the Statistics Graph card with none metered entities and `chart_type` `line`.

Screenshot of the statistics graph card for energy entities Screenshot of the Statistics Graph card with a metered entity and `chart_type` `bar`.

To add the Statistics Graph card to your user interface, click the menu (three dots at the top right of the screen) and then Edit Dashboard. Click the “Add Card” button in the bottom right corner and select Statistics Graph from the card picker. All options for this card can be configured via the user interface.

Configuration Variables

type string Required

statistics-graph

entities list Required

A list of entity IDs or entity objects, see below.

days_to_show integer (Optional, default: 30)

Days to show in graph. Minimum is 1 day.

chart_type string (Optional)

If the graph should be rendered as a bar or a line chart.

stat_types list (Optional)

The statistics types to render. min, max, mean, sum, state

title string (Optional)

The card title.

period string (Optional)

The period of the rendered graph. 5minute, hour, day or month

Options For Entities

If you define entities as objects instead of strings, you can add more customization and configuration:

Configuration Variables

entity string Required

Entity ID.

name string (Optional)

Overwrites friendly name.

Example

Alternatively, the card can be configured using YAML:

type: statistics-graph
title: 'My Graph'
entities:
  - sensor.outside_temperature
  - entity: sensor.inside_temperature
    name: Inside