You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+85-17Lines changed: 85 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,7 +64,7 @@ An awesome feature-rich custom card for [Home Assistant](https://www.home-assist
64
64
| 📈 | Line, step, and bar charts with smooth Bezier curves |
65
65
| 📅 |**Built-in Date Picker** — navigate Day, Week, Month, Year views with arrow buttons, calendar popup, and preset ranges (Last 7/30 Days, Last 12 Months). Sync multiple cards with `date_picker_group` — even cards without a visible picker can follow the group. Customize visible modes with `date_picker_modes` — lock to a single mode for a minimal nav bar |
66
66
| 🔢 | Live state rows with current value, MDI icons, and configurable font sizes |
67
-
| 🎯 |**Nine chart modes** — Timeline, Scatter, Pie (donut), Ranking (horizontal bar), Radial Bar (concentric arcs), Polar Area (variable-radius pie), Radar (spider polygon), Heatmap (days × hours), Calendar (weekly grid) — selectable from a single dropdown |
67
+
| 🎯 |**Ten chart modes** — Timeline, State Timeline, Scatter, Pie (donut), Ranking (horizontal bar), Radial Bar (concentric arcs), Polar Area (variable-radius pie), Radar (spider polygon), Heatmap (days × hours), Calendar (weekly grid) — selectable from a single dropdown |
68
68
| 🎛️ |**Gauge display** — replace the state row with a half-circle gauge showing current value against min/max bounds |
69
69
| ✨ |**Sparkline mode** — ultra-compact inline graphs with no chrome, ideal for dashboard overview tiles |
70
70
| 📊 |**Rise/Fall colorization** — graph segments automatically change color as values climb or drop, with independent colors for rising, falling, and stable periods |
@@ -73,7 +73,7 @@ An awesome feature-rich custom card for [Home Assistant](https://www.home-assist
73
73
| 🏷️ |**Custom unit per entity** — override auto-detected units with `unit: kWh` on any entity. Essential for attributes and unitless sensors |
74
74
| 🔡 |**Axis label customization** — adjust font size and opacity of Y-axis and X-axis labels independently for a clean, tailored look |
75
75
| 📌 |**Axis tick marks** — optional small tick lines at each label position, controllable independently for X and Y axes |
76
-
| 🕐 |**Graph Start Hour** — pin the X-axis to a fixed start hour (e.g. 06:00) to cut out irrelevant nighttime data on solar dashboards|
76
+
| 🕐 |**Dynamic Graph Hours** — filter data to specific hours each day with `graph_start_hour` and `graph_end_hour`. Accepts fixed numbers or sensor entities (e.g. `sensor.sunrise_hour`) for sunrise-to-sunset views that adapt throughout the year|
77
77
| 🛠️ |**Full visual editor** — every option is configurable through the Lovelace UI without touching YAML; entities can be reordered by drag-and-drop. The editor adapts dynamically: irrelevant options hide based on the selected chart mode |
78
78
| ↕️ | Dual Y-axis support (primary + secondary) with per-axis bounds and configurable tick count |
79
79
| ↕️ |**Independent Y2 axis toggle** — show or hide the secondary (right) Y axis labels without affecting the primary axis |
@@ -269,9 +269,11 @@ These options apply to the whole card.
269
269
| `show_x_axis` | boolean | `true` | Show X axis labels (time in Timeline, values in Scatter). Available in Timeline and Scatter modes. |
270
270
| `show_x_ticks` | boolean | `false` | Draw small tick marks at each X-axis label position. |
271
271
| `show_y_ticks` | boolean | `false` | Draw small tick marks at each Y-axis label position. |
272
-
| `graph_start_hour` | number | `null` | Anchors the X-axis to a fixed hour of the day (0–23). For example, `6` starts the chart at 06:00 — ideal for solar panels. Ignored when the interval picker is active. |
272
+
| `graph_start_hour` | number / entity | `null` | Daily start hour filter. Points before this hour each day are hidden, creating natural line breaks between days. Accepts a fixed number (`6` = 06:00, `6.5` = 06:30) or a sensor entity ID (`sensor.sunrise_hour`) for dynamic values. Works with Date Picker: in Day mode trims the X-axis, in Week/Month/Year modes filters per day. See [Dynamic Graph Hours](#-dynamic-graph-hours). |
273
+
| `graph_end_hour` | number / entity | `null` | Daily end hour filter. Points after this hour each day are hidden. Same format as `graph_start_hour`. Use with `sensor.sunset_hour` for sunrise-to-sunset views. |
273
274
| `graph_start` | string | `null` | Snaps the graph start to a calendar boundary: `tomorrow`(tomorrow 00:00 — ideal for next-day spot prices via `data_attribute`), `week` (Monday 00:00), `month` (1st of month), `year` (Jan 1st). When set to `tomorrow`, the window automatically extends to cover the full next day even without `show_full_period`. Ignored when the interval picker is active. See [Long-Range Views](#-long-range-views). |
274
275
| `show_full_period` | boolean | `false` | Extends the X-axis to cover the full calendar period instead of stopping at "now". A dashed vertical line marks the current time. Works with `graph_start` (week/month/year) and `energy_date_sync`. Not required for `graph_start: tomorrow` — that extends automatically. See [Show Full Period](#-show-full-period). |
276
+
| `card_background_color` | color | `null` | Custom background color for the card. Accepts any CSS color (hex, rgba, name). Replaces `card_mod` workarounds — this value persists across re-renders. |
275
277
| `show_legend` | boolean | `false` | Show a compact color-coded entity name key below the graph. Click any item to temporarily toggle that entity's visibility on the graph. For per-entity stats, use the entity-level Legend toggle. |
276
278
| `legend_position` | string | `"center"` | Position of the compact legend: `left`/ `center` / `right`. The legend flows inline at the chosen alignment. |
Requires at least 3 entities. Each entity's value is normalized to its `lower_bound` / `upper_bound` range. Polygon grid rings provide reference levels. Colored dots at each vertex show the exact position, with value labels nearby. Supports color thresholds for per-dot colors.
592
594
595
+
### State Timeline
596
+
597
+
```yaml
598
+
type: custom:statistics-graph-chart-card
599
+
chart_mode: state_timeline
600
+
hours_to_show: 24
601
+
entities:
602
+
- entity: binary_sensor.window_living_room
603
+
name: Living Room
604
+
state_map:
605
+
- value: "off"
606
+
label: "Closed"
607
+
color: "#e74c3c"
608
+
- value: "on"
609
+
label: "Open"
610
+
color: "#5dade2"
611
+
```
612
+
613
+
Displays horizontal colored bars showing state changes over time — one row per entity. Entity names appear on the left, state labels inside each segment when wide enough. Hover for a tooltip showing state name, duration, and time range. Works with `binary_sensor`, `input_boolean`, `input_select`, and any entity with a `state_map`.
614
+
593
615
### Chart Mode Compatibility
594
616
595
617
Not all card options apply to every mode. The visual editor hides irrelevant options automatically.
596
618
597
-
| Feature | Timeline | Scatter | Pie | Ranking | Radial Bar | Polar Area | Radar | Heatmap | Calendar |
When viewing multiple days, data outside the specified hours is hidden and lines break naturally between days. Both `graph_start_hour` and `graph_end_hour` accept fixed numbers (`6`, `22`, `6.5` for 06:30) or entity IDs.
2243
+
2244
+
---
2245
+
2178
2246
### ⏩ Sparse Data with Points Per Hour
2179
2247
2180
2248
For sensors that update infrequently (e.g. weather), use a higher `points_per_hour` with forward-fill. Empty buckets inherit the last known value, producing a clean step-line instead of scattered dots.
0 commit comments