History graph card
The history graph card allows you to display a graph for each of up to eight entities.
Screenshot of the history graph card, when the sensor has no `unit_of_measurement` defined.
Screenshot of the history graph card, when the sensor has a `unit_of_measurement` defined.
To add the history graph card to your user interface:
- In the top right of the screen, select the edit
button. - If this is your first time editing a dashboard, the Edit dashboard dialog appears.
- By editing the dashboard, you are taking over control of this dashboard.
- This means that it is no longer automatically updated when new dashboard elements become available.
- Once you’ve taken control, you can’t get this specific dashboard back to update automatically. However, you can create a new default dashboard.
- To continue, in the dialog, select the three dots
menu, then select Take control.
- If this is your first time editing a dashboard, the Edit dashboard dialog appears.
- Add a card to your dashboard.
Only the y-axis and logarithmic scale settings can be configured via the user interface. To configure the other options for this card, you need to edit the YAML configuration.
YAML configuration
The following YAML options are available when you use YAML mode or just prefer to use YAML in the code editor in the UI.
Configuration Variables
Hours to show in graph. Minimum is 1 hour. Big values can result in delayed rendering, especially if the selected entities have a lot of state changes.
If true, numerical values on the Y-axis will be displayed with a logarithmic scale.
Options for entities
If you define entities as objects instead of strings, you can add more customization and configuration:
Examples
type: history-graph
title: 'My Graph'
entities:
- sensor.outside_temperature
- entity: media_player.lounge_room
name: Main player
Or with longer time frame, and multiple entities (as long as they share the same unit_of_measurement) in one graph:
type: history-graph
title: "Temperatures in the last 48 hours"
hours_to_show: 48
entities:
- sensor.outside_temperature
- entity: sensor.lounge_temperature
name: "Lounge"
- entity: sensor.attic_temperature
name: "Attic"