Skip to content

โœจ New Features & ๐Ÿ› Bug Fix

Latest

Choose a tag to compare

@cataseven cataseven released this 25 Nov 06:58
6bb18d8

โœจ New in this release

๐Ÿ”ฎ Date picker โ€” โ–ถ steps into your forecast (#452)

On a chart with its own date picker and a forecast that carries dates โ€” a price or forecast array (data_attribute with ISO or epoch time stamps) or the Energy dashboard's solar forecast โ€” the โ–ถ button no longer stops at today. In the Day, Week, Month and Year modes it moves on to tomorrow, next week or next month for as long as the forecast reaches and shows that period whole; at the last period the forecast covers the button greys out. After a reload the card opens on the current period again.

type: custom:statistics-graph-chart-card
show_date_picker: true
date_picker_modes: [day, week]   # โ–ถ steps ahead in Day / Week / Month / Year
entities:
  - solar_forecast: true         # or a sensor whose data_attribute holds dated prices
    graph_type: bar

Charts without dated forecast rows, charts in a date_picker_group or sync_group, and the rolling Last โ€ฆ buttons still stop at the current period.


๐Ÿ”ฃ Legend units โ€” the entity's unit after each value (#439)

Add unit to an entity's legend_stats and every value in its legend row carries the entity's unit: MIN 14.5 ยฐC AVG 21.8 ยฐC LIVE 23.6 ยฐC. It is the same unit the tooltip shows โ€” your own unit if you set one, otherwise the sensor's. In the visual editor it is the new Unit checkbox in the entity's Legend section, next to Min โ€ฆ Live.

entities:
  - entity: sensor.living_room_temperature
    show_in_legend: true
    legend_stats: [min, avg, max, live, unit]   # unit adds ยฐC to every value

Values shown as โ€” and a Live value that is text (for example a state_map label) stay without a unit, and unit: "" hides it. legend_stats: [unit] on its own adds the unit to the default Min, Avg and Max. The units are also in the card PNG export. With units the values are wider, so on a narrow card a legend row can take more lines. Cards that don't list unit look exactly as before; if you added units with a styles ::after rule, remove it when you switch, or the unit shows twice.


โฒ๏ธ Interval picker โ€” 15- and 30-minute buttons (#455)

The interval picker gets two minute buttons, 15m and 30m, that stay on the bar next to 1H, 24H and the rest โ€” so a card that opens on one hour can switch to the last 15 or 30 minutes and back. Pick them in the editor under Visible Intervals, or list them in YAML:

hours_to_show: 1
show_interval_picker: true
interval_options: ["15m", "30m", "1H", "24H", "7D"]
default_interval: "30m"        # optional: open on 30 minutes
interval_picker_group: climate # optional: every card in the group follows
auto_scale_points: true        # one point per minute below one hour
  • Minutes are written with a lower-case m (15min and 30 min work too); 6M still means six months.
  • With auto_scale_points: true, a window shorter than an hour now draws one point per minute, also for sensors that report every few seconds, and the time axis gets a label every 5 or 10 minutes.
  • The date picker and the Controller card offer the same ranges as rolling modes: add last_15m / last_30m to date_picker_modes, or open on one with date_picker_default_mode: last_30m.
  • hours_to_show takes fractions (0.5 = 30 minutes), and the editor's Hours to Show field now accepts them.
  • A label the picker can't use (30M, 6H, a typo) now leaves one line in the browser console instead of disappearing silently.

๐Ÿ—‚๏ธ Ranking keeps the bars in a fixed order โ€” ranking_order (#456)

Ranking sorted the bars by value every time, so on a live power overview a device jumped up and down the list as appliances switched on and off. ranking_order keeps them in place:

chart_mode: ranking
ranking_order: config   # value (default) | config | alphabetic
  • value โ€” highest value first, as before.
  • config โ€” the order of your entities: list (Entity Order in the editor); drag the entities into the order you want.
  • alphabetic โ€” A to Z by the name next to the bar.

Min Value and Max Value keep filtering in every order: a device that crosses the threshold still appears or disappears, and the bars below it move by one row. Editor: Chart โ†’ Ranking โ†’ Sort By.


โ†”๏ธ Shift + drag โ€” pans a zoomed chart with the mouse (#463)

After a brush zoom, hold Shift and drag the graph with the mouse to slide the zoomed window left or right โ€” the way one finger already does on a phone. The window keeps its length and stops at the edge of the loaded data, only the sideways movement counts, and cards linked with Zoom Sync follow once you let go. The pan adds no zoom level, so a double-click still steps back through the levels you brushed.

A drag without Shift still draws a new zoom selection, and on a chart that is not zoomed Shift + drag is a normal brush.


โœ๏ธ Comparison label โ€” your own words instead of "(previous period)" (#462)

A comparison ghost is named after its period: Speed (previous period), Speed (yesterday), Speed (last week) โ€ฆ On a rolling 14-day chart none of these says what you see. Each comparison now takes a label, and your words go between the brackets instead: in the legend, the tooltip, the stacked Total row, State Timeline rows and the CSV export.

type: custom:statistics-graph-chart-card
hours_to_show: 336               # a rolling 14-day view
entities:
  - entity: sensor.wind_speed
    name: Speed
    compare:
      period: previous_period
      label: 2 weeks ago         # "Speed (2 weeks ago)" instead of "Speed (previous period)"
  • Only the words change: the comparison, its date line in the tooltip and the ฮ”% stay the same.
  • Works with every period, a number of hours, layout: sequential and State Timeline charts. In the list form each comparison takes its own label; periods_back adds no ร—2 to a label, so write the whole wording (label: 4 weeks ago).
  • Your text is shown as you write it, for every viewer; in YAML, quote it if it looks like a number, a time or yes/no (label: "14:00"). Comparisons without a label keep the built-in words, which follow the card language.
  • On a stacked chart, the ghost stack's Total row uses the label when every comparison in that stack has the same one.
  • The label is fixed text: if a date picker, the interval picker or a drill-down can change what previous_period compares with, leave it empty, or use a fixed look-back such as period: 336 (hours), which always compares with two weeks earlier.
  • Visual editor: entity โ†’ Graph โ†’ Period Comparison โ†’ the new Label field on each row; its placeholder shows the word used when the field is empty.

โš ๏ธ Behaviour changes

  • ๐Ÿ“ˆ 6-month and 1-year charts use the same hourly data as the 90-day chart โ€” with the default grouping, rolling views now read Home Assistant's hourly statistics, just like 90D: the interval picker's 6M and 1Y, any hours_to_show up to a year, and the date picker's Last 180 days and Last 12 months. A day looks the same in all of them, only with fewer points: 90D shows about 22 a day, 6M one every 3 hours and 1Y one every 6 hours, on round clock times. On narrow cards the steps get longer (6 and 12 hours on a phone), so no point or bar is ever skipped. Until now most of these views switched to one value per day; on some sensors that value changed meaning along the line (the end-of-day reading on some days, the daily average on others), and it could change when you added another entity to the card, even a hidden one. Bars on these views now show 3- or 6-hour totals instead of one bar per day: each day's bars add up to that day's total, and group_by: date still gives one bar per day. Legend minimum and maximum now include the ups and downs within a day, tooltips show the time, the line ends at now, and the first load fetches more data (later refreshes fetch only the newest hour). These stay exactly as before: calendar groupings (date, week, month, year), the date picker's Day, Week, Month, Year and custom views, graph_start and show_full_period views, Energy-dashboard sync, and views longer than a year. Wind-direction sensors keep Home Assistant's daily direction averages beyond 90 days, so a north wind does not turn into a south wind on long views.
  • ๐ŸŒก๏ธ Heatmap and Calendar follow the threshold transition (#458) โ€” with color_thresholds, their cells now blend between the threshold colours (transition: smooth, the default), the way lines, bars and the gauge always did; until now they switched in hard steps whatever the setting said. Set transition: hard to keep the stepped look.
  • ๐Ÿ“ Sparkline cards with height: auto size to their rows and fill their Sections cell (#448) โ€” since 4.03 they reserved a 200 px chart area under the sparklines, so a two-row sparkline card in a two-row Sections cell spilled over the cards below it. With a fixed row count the card now fills its cell with the rows at the top (and, on a card with chart pages, the page strip at the bottom), and if its rows need more room than the cell it grows with them instead of cutting one; with rows: auto, in Masonry and in stacks it is exactly as tall as its rows. If you raised grid_options.rows to make room, lower it again for a more compact card.
  • ๐Ÿ“ Line points sit on their bars (#452, #460) โ€” on charts that mix bars and a line with hourly, multi-hour, daily or weekly grouping, each point of the line is now drawn on the centre of its own bar. With group_by: hour, date or week the period still in progress used to be drawn at the current time, so by the evening it hung almost a full column to the right of today's bar; with multi-hour grouping (2h โ€ฆ 12h, or any Nh up to 24h) every point sat on the right edge of its bar, and hovering a bar could show the line value of the period before it. The line therefore no longer reaches the now line, which keeps showing the current time, and on hourly and multi-hour charts the tooltip names the start of the period. Moving the points changes no value, and the CSV export still records the time of the last update. Until the running period has a bar (for example hourly statistics bars before the hour is complete), and on views shorter than two periods (for example a 24-hour window grouped by day), the line still runs to now. Line-only charts are unchanged.
  • ๐Ÿงฑ Stacked areas stay clean where a series is zero (#446) โ€” a stacked line or area no longer draws its outline, or a sliver of fill, along the series below it while its own value is zero, so that edge keeps the colour of the series it belongs to: an idle grid no longer paints the battery's edge blue for hours. While the whole stack is at zero, the first series still draws the zero line. A series that starts or stops in an interval in which the series below it sits on the other side of zero (import ending just as the battery starts charging, or export starting under a stacked solar band) now starts or ends on the zero line instead of cutting across the other series. Zero readings are still real data: stacking, tooltips, totals, point markers and single spikes between zeros are unchanged.
  • ๐Ÿ“Š Ranking: long names get a wider name column (#457) โ€” the name column stopped at about 120 px on every card. It now grows to fit the longest name, up to 40 % of the chart's width, so names like "Computer Monitor (Computer Living)" show in full on desktop and tablet cards, and the bars get shorter to make room. With Min Value or Max Value the column is sized for every entity in the list, including the ones hidden at the moment, so the bars don't jump sideways when a device appears or disappears. Cards on which every name fits look exactly as before; on phones long names are still shortened with โ€ฆ, and the tooltip shows them in full.
  • โณ Short windows with Auto Scale draw one point per minute (#455) โ€” with auto_scale_points: true, a window shorter than one hour (a fractional hours_to_show, a drill into a short bar, the first hour of a graph_start: day view) uses one-minute buckets instead of five-minute ones. A matching auto_scale_rules entry still decides.
  • ๐Ÿ• Short views label the time axis every 5 or 10 minutes (#455) โ€” a view shorter than an hour โ€” a zoom, a fractional hours_to_show, or a graph_start: day / date-picker Day view during the first hour after midnight โ€” labels the axis every 5 or 10 minutes instead of every 15.
  • ๐Ÿ”ก A sub-hour range that matches no button reads 45m (#455) โ€” instead of 45M, which looked like months.

๐Ÿ›  Fixes & reliability

  • ๐Ÿ“‰ Long views no longer draw a flat line over months where a sensor's statistics type changed โ€” when a sensor was measurement for a while and total or total_increasing before or after it (or the other way round), Home Assistant returns the rows of the other type only if the same request also includes a sensor of that type. Depending on the interval and on which other entities shared the card, those months came back empty and the card bridged them with the last known value: 90D showed the real curve while 6M drew a straight line across the same weeks. The card now fetches those rows again on its own, so every interval shows the same data.
  • ๐Ÿ“… Daily points of long views sit on the right date again โ€” since 4.06, views that draw one point per day from Home Assistant's daily statistics with the default grouping (views longer than a year, and long views anchored to a calendar start such as graph_start: year) laid those days on the UTC calendar, so on a Home Assistant east of UTC (most of Europe, Africa, Asia and Australia) every point and bar showed the previous day's date: hovering 22 Nov showed the closing value of 23 Nov. The days now follow the server's own midnight, including the 23- and 25-hour days of a clock change; moving averages and ref_entity rows use the same days.
  • ๐Ÿ” Dashboards with several statistics charts refresh only the newest hour โ€” every 5 minutes each chart fetches just the latest statistics and adds them to what it already has. Until now, on a dashboard with more than one such chart, every chart but one (and any chart that had been out of view once) downloaded its whole range again at every refresh.
  • โž— Totals are no longer cut when the browser names the server's time zone differently (#459) โ€” since 4.06 the card compared the names of the two zones, so a browser reporting Europe/Vienna for a Europe/Berlin server (or Asia/Calcutta for Asia/Kolkata) was treated as a different clock: daily statistics were re-read in finer pieces, and a show_second_state_as: sum on a month view could show about half of the real total. Zones with the same midnights now count as the same zone.
  • ๐Ÿท๏ธ State Timeline shows attribute text again (#442) โ€” a row with graph_type: state_strip and an attribute (for example a tracker's connected_to) showed 0, 1, 2 in the bars, the tooltip and the time slices instead of the attribute's values.
  • ๐Ÿ–ฑ๏ธ An emptied Radial Bar, Gauge or Polar Area chart stays quiet (#441) โ€” after the last entity was switched off from the legend or the state row (or by its enabled helper, or on a chart page with nothing to draw, or when every Polar Area value is 0), the blank chart still showed the tooltip of the entity that had been there, and a click opened its More Info dialog.
  • โฑ๏ธ The now line stays in the bar of the running hour on price and forecast bar charts (#447) โ€” bars read from an attribute array (data_attribute, e.g. hourly electricity prices) or from the solar forecast are centred on the start of their period, so from the middle of every hour the now line stood inside the next bar. It now walks through the bar of the period that is actually running, as it already did with group_by: hour โ€” also on charts that draw a line next to these bars, whose line still ends at the current time. Charts whose bars all come from history are unchanged, and views that span less than two bars (a deep zoom, a daily price on a one-day chart) keep the clock position.
  • ๐Ÿ“… The last day labels of the x axis no longer print on top of each other (#452) โ€” the label of the last day is always added, and on a crowded axis it could land on the label before it ("21 Sat22 Sun"). It is now left out when the two would touch.
  • ๐Ÿ”ค Editor: the State Timeline font size hint shows the real defaults (#440) โ€” the empty field said 10, but the names on the left are drawn at 11 px (the state labels inside the bars at 10 px); it now reads "10 / 11".
  • ๐Ÿงฎ Today's average from long-term statistics is Home Assistant's own average so far (#460) โ€” the day or week in progress on an average line (date, week, month or year charts) was pulled towards the current reading; it now matches Home Assistant's value, also on charts that draw the same sensor's min or max next to it.
  • ๐Ÿ‘ฏ Two rows of the same entity keep their own live values โ€” a thermostat's target line no longer jumps to the current temperature on every update, an attribute row (a battery voltage, a tracker's access point) no longer takes the state's value, a forecast row listed first no longer freezes the sensor's own line, and a meter's hourly change bars no longer show the meter reading as one giant bar when the meter is also drawn as a line (on short charts those bars now refresh every few minutes, like change bars without a line beside them, instead of with every reading of that line).
  • ๐Ÿ”ฝ Drill down on a solar-forecast or price bar opens just that bar (#452) โ€” clicking today's bar on a forecast chart changed nothing, and clicking a later bar showed everything from it to the end of the forecast.
  • ๐ŸŽฏ Drill down opens the bar you click (#452) โ€” a click on the left part of a bar opened the bar before it, and on charts that also draw a finer line or finer bars (even ones hidden in the legend or on another chart page) it opened a short slice of those instead.
  • ๐Ÿ“ State Timeline: names that fit the label column stay on one line โ€” a name could be wrapped onto a second line, or split before its last letter, although the column had been sized for it, which made every row taller.
  • ๐Ÿ”ข Editor: the Heatmap and Calendar label hints show the real defaults โ€” the grey hints and tooltips of the X / Y label size and opacity fields now show what an empty field draws (Heatmap 9 px, Calendar day names 10 px and dates 9 px, full opacity).
  • ๐Ÿ’ก Editor: the entity Group By hint says how to get one equal-width bar per day (#454) โ€” set Group By on the card; set on a single row, the days keep their real calendar length, so a rolling window shows only part of the first and the last one.
  • ๐ŸŽจ Color-threshold fills follow Fill Opacity and Gradient (#444) โ€” set fill_opacity on an entity with color thresholds and the colored fill takes that strength, fading towards the axis (Gradient, on by default) or even with gradient: false; without fill_opacity it keeps its classic look.
  • ๐ŸŒ— Fills of lines that cross zero fade towards the zero line in every shape โ€” with horizontal or raw color thresholds, rise/fall colors, or a gap in the line, the fill was as strong at the zero line as under the line.
  • ๐ŸŽš๏ธ A flat rise/fall or threshold-segment fill uses half of fill_opacity โ€” with gradient: false, a set fill_opacity on rise/fall colors or horizontal / raw color thresholds gave five eighths of it instead of the documented half; raise the value by a quarter to keep the previous look (an empty fill_opacity is unchanged).
  • โœ‚๏ธ Ranking: a shortened name keeps its first letter (#457) โ€” a name cut with โ€ฆ no longer starts outside the card ("omputer Monitor โ€ฆ").
  • ๐Ÿ”š Ranking: the value at the end of the longest bar is no longer cut off โ€” when the value and its share don't fit, the bars get just short enough to show them in full.
  • ๐Ÿ” A zoom selection is no longer lost when the chart updates โ€” on a chart whose sensors report every few seconds, an update arriving while you dragged a zoom selection with the mouse made the selection disappear and left the tooltip switched off until the next click. The selection now stays and zooms when you let go; on phones an interrupted long-press selection is dropped cleanly, and the one-finger pan works straight away after it.
  • ๐Ÿ‘† On touch screens, panning a zoomed drill_down chart right after a tap no longer drills down in the middle of the pan.
  • ๐Ÿฉบ A custom auto-scale rule for windows under an hour gets its fine buckets on chatty sensors (#455) โ€” on sensors that report every few seconds it used to fall back to 5-minute statistics.
  • ๐Ÿงญ Wind direction sensors use long-term statistics (#461) โ€” with state_class: measurement_angle, charts longer than 24 hours now read Home Assistant's direction averages like any measurement sensor: 30-day charts no longer go flat before the last ~10 days, hour and day bars match Home Assistant's own averages (right across north), imported direction statistics (statistic_id) show Home Assistant's day, week and month averages, and the editor shows LTS; data_source: history keeps the raw readings.
  • ๐Ÿ“ˆ Every chart of a very chatty sensor draws its data โ€” when several charts on a dashboard share a sensor that reports every few seconds, the charts that loaded alongside the first one no longer show a flat line at the current value (a radar only the current value) until their next refresh.
  • ๐Ÿ”— Cards that follow a picker come back on its range โ€” a card that follows another card's interval, Points/Hour or Group By picker (also through sync_group) and comes back onto the page (a conditional card shown again, a phone / desktop variant, a reload) now goes back to its own range or Auto together with the picker, also after the controller's โ†บ Reset, instead of keeping the last pick it saw.
  • ๐Ÿ“ฑ Date picker on narrow cards โ€” the โ€น โ€บ buttons keep their full size and the date no longer slides under the period buttons (controller card on a phone or in the editor preview, pickers with many buttons): the period buttons move to a row of their own, so such a card can become up to one button row taller or shorter; on very narrow cards a long date ends in "โ€ฆ".
  • ๐Ÿ“Œ Centred date picker groups stay clear โ€” with date_picker_shortcuts_position: center or date_picker_nav_position: center the centred group no longer flashes over the other buttons when the chart updates or the card is resized, and two quick updates in a row no longer leave it there.
  • ๐ŸŒ Comparison and solar-forecast names switch to your language as soon as the translations load โ€” on a non-English dashboard whose data arrived before the translation file, "(yesterday)", "(last week)" โ€ฆ and "Solar forecast" stayed in English in the legend, tooltip, state row and CSV until the next refresh.
  • โž– Two-entity math and cost rows from long-term statistics use the current value in the hour in progress โ€” the hour in progress (and the first hour of a new day or week) was combined with the previous hour's average of the ref_entity or price_entity, so a "total โˆ’ green" remainder could even turn negative and a new price only counted once its hour was over; a diff or delta pair no longer drifts, or grows a bar of its own, when only the reference updates.