Skip to content

✨ Full UI Localization & πŸ› Bug fixes

Choose a tag to compare

@cataseven cataseven released this 14 Jul 17:42
d372a71

Localization, template-name fixes, and correct daily aggregates β€” plus a new two-file install layout.

Heads-up β€” the card now ships as two files. From this release the download contains Home Assistant - Statistics Graph Chart Card.js and translations.js, which must sit side by side in the same folder. HACS installs both automatically; manual installers must copy both and add only the main file as a resource (type: module). If translations.js is ever missing or out of date the card still works β€” it just falls back to English and logs a one-line notice.


🌐 Full UI localization β€” 16 languages (#287)

The entire interface is now translatable: the card surfaces (presets, relative labels, Group-By / Points-Hour pickers, tooltip stat labels, empty states, D/W/M/Y and rolling-window shortcut buttons) and the full visual editor (tabs, group headings, every field label, every toggle, and every dropdown option).

  • Languages: English, Turkish, German, Spanish, Portuguese, Italian, French, Dutch, Russian, Swedish, Danish, Norwegian, Polish, Czech, Finnish, Chinese (16 total), covering 454 UI strings each.
  • Card language is controlled by the language: option β€” auto (default) follows each viewer's HA profile language, or pin a fixed language (great for wall tablets, where every viewer should see the same thing regardless of their own profile).
  • Editor language follows the card's language: setting. Pin a card to English and its editor speaks English too β€” even if your HA profile is another language. Changing the Language dropdown re-renders the editor live.
  • Color-palette names (Accent, Red, Deep purple, Teal, …) and position values (Top Left, Bottom Right, …) are translated as well.

Deliberate boundaries (documented in the README): editor tooltips stay in English as reference documentation; entity state words (on/off/heating) always follow the viewer's HA profile because HA ships a single language pack per browser session; and units (kWh, Β°C) are never translated. Translations were drafted by the maintainers β€” corrections are very welcome via a PR to translations.js.

image

🏷️ Template entity names now render (#290)

name: "{{ ... }}" templates were displayed verbatim as {{ state_attr(...) }} instead of their rendered value. Two bugs were behind this:

  1. Name templates were never subscribed. Only color fields were sent to HA's render_template WebSocket, so name/tooltip_name templates were never evaluated.
  2. Numeric results were dropped. HA sends template results typed β€” a template reading a numeric attribute arrives as a JS number, and the old string-only handling silently discarded it (so even after fix #1 a number template fell back to the entity's friendly name).

Both are fixed. Name and tooltip_name templates now render across every surface (state row, tooltip, legend, chart labels), values of any type (number, string, boolean) are handled, and while a template is still resolving the card shows the entity's friendly name β€” never a raw {{ }}. tooltip_name templates resolve independently of name.

entities:
  - entity: sensor.temperature
    name: "{{ state_attr('sensor.temperature', 'raw_state') }}"

πŸ“Š Daily averages no longer change overnight (#286)

Month view + Group by Day + aggregate_func: last / first. For a cumulative sensor that resets daily (e.g. a daily-COP ratio), a completed day's value could change the next day and stop matching the sensor.

The card was correctly showing HA's time-weighted daily mean for finished days while tracking the live value for the in-progress day, so the two disagreed. For a cumulative ratio the meaningful daily number is the end-of-day reading (last) β€” but setting aggregate_func: last didn't help, because Group-by-Day fetched daily statistics rows and a measurement-class sensor's daily rows have no state field, so last/first silently fell back to the day mean.

Now, aggregate_func: last / first on measurement sensors with Group by Day / Month / Year fetches hourly statistics and takes the bucket's true endpoint β€” so a completed day shows the same value it showed while in progress, with no overnight change. (Counters are unaffected: their daily rows carry a real state, so they already resolved correctly. avg is unchanged and still reports HA's time-weighted daily mean by design.)

entities:
  - entity: sensor.dagelijkse_cop_warmtepomp
    aggregate_func: last   # keep Group by Day