Skip to content

v1.1.0

Choose a tag to compare

@github-actions github-actions released this 28 Oct 21:26
· 19 commits to main since this release

Four new features, all from the roadmap: a card can now fill itself from a label, area, floor or device class, an entity can be drawn from one of its attributes instead of its state, and colour bands can start at another entity's value and change the icon as the value moves between them. Everything is settable from the visual editor. Nothing about your existing cards needs changing.

Added

Fill the card from a rule

  • New devices turn up on the card without editing the dashboard. Instead of picking every entity, include fills the card from a rule: every battery in the house, or the temperature and humidity sensors in one room. exclude takes things back out. (#80, closes #56)

    type: custom:chartdeck-card
    style: bar
    include:
      area: kitchen
      device_class: [temperature, humidity]
    exclude:
      entity: sensor.oven_probe
      label: ignore
    hide_unavailable: true
    limit: 5
    sort: descending
    • include matches by label, area, floor, device_class or domain. Values under one key are alternatives; different keys must all match. So "every battery" is device_class: battery, and "the temperature sensors in the kitchen" is area plus device_class.
    • exclude takes the same keys plus entity, and leaves out anything that matches any of them.
    • An entity's label and area can come from the entity itself or from its device, and its floor comes from its area.
    • Only entities with a number to show are matched, so an area rule doesn't pull in the room's lights and switches. Entities hidden in the entity registry never match.
    • Entities you list under entities come first, then the matched ones by name. Matched entities take the card-wide options.
    • The card re-checks its rules whenever the registries or states change. Moving a sensor into the kitchen on the dev Home Assistant put it on the card within a couple of seconds, and moving it out took it off again.
    • In the editor the rules sit under the entity list, as Also show every entity that matches and Leave out, using Home Assistant's own area, floor, label and device class pickers.
  • Unavailable entities can be left off the card. hide_unavailable: true drops every entity that is unavailable or unknown, whether you listed it or a rule matched it. It works on any card, not only rule-filled ones. In the editor it's Hide unavailable entities under Display. (#80)

  • A card can show just the top few. limit: 5 keeps the first five entities after sorting, so sort: ascending with limit: 3 gives you the three flattest batteries in the house. With sort: none it keeps the first ones in order. In the editor it's Show at most under Display. (#80)

Values from an attribute

  • A thermostat's temperature, a weather entity's humidity or a media player's volume can be drawn directly, without a template sensor in between. Give an entity an attribute and the card draws that attribute instead of the state. The editor offers a drop-down of that entity's own attributes in its row options. It works in every style. (#77, closes #53)

    entities:
      - entity: climate.lounge
        attribute: current_temperature
        unit: °C
      - entity: weather.home
        attribute: humidity
        unit: '%'
    • An entity's unit and display precision describe its state, not its attributes, so neither is used for an attribute. Set unit yourself. The decimals follow how the attribute was reported (at most 2) until you set decimals.
    • If the attribute isn't there, the card falls back to the entity's state, so a media player that is switched off reads "Off" rather than "Unavailable". An attribute that holds text shows the text.

Colour bands

  • A colour band can start at another entity's value, the same way min, max and target already could. A battery can turn red below a level kept in an input number, or a tank warning can follow a threshold an automation sets. (#78, closes #54)

    severity:
      - from: 0
        color: red
      - from: input_number.battery_warning
        color: amber
      - from: 70
        color: green
    • When the threshold entity changes, the bar colours, the needle gauge's coloured arc and the legend all move with it straight away, without a reload. Moving an input number from 40 to 20 on the dev Home Assistant recoloured the bars and moved the legend and needle arc as it went.
    • The bands are re-sorted after the entity values are read, so a threshold that moves past its neighbours still lands in the right order.
    • A band whose entity is missing or isn't a number is left out, with one warning in the browser console, the same way a missing min or max entity is handled.
    • In the editor each band has a Start from an entity button. The entity picker opens under the band, and the From box stays visible, greyed out, showing the entity's current value.
  • The icon can change colour with the band, so a battery icon turns red when it's low. Turn on color_icon: true (Colour icons to match their band in the editor's Colours section) and each icon takes the colour of the band its value is in. (#79, closes #55)

  • Each band can have its own icon, shown while the value is in that band, such as a different icon for a tank that's nearly empty. (#79)

    color_icon: true
    severity:
      - from: 0
        color: red
        icon: mdi:battery-alert-variant-outline
      - from: 20
        color: amber
      - from: 50
        color: green
        icon: mdi:battery
    • A band's icon wins over the icon set on the entity. A band without one leaves the entity's icon alone.
    • Unavailable entities keep their usual icon and colour, since "below the first band" isn't a real reading.
    • Both work in every style, including inside the ring and arc gauges.

Changed

  • Colour band rows in the editor are now two lines. The first has From, Colour, the new entity button and remove; the second has Label and the new Icon picker. Existing bands are untouched. (#78, #79)

Upgrading

No action needed. Every new option is off unless you set it, so existing cards draw exactly as before. Update through HACS and hard-refresh the browser (or clear the app's frontend cache on the companion app) to pick up the new card.

The wiki covers each option in full: include and exclude, hide_unavailable, limit, attribute, thresholds from an entity and icons that follow the band.

Full changelog: v1.0.1...v1.1.0