Skip to content

v2.5.0

Choose a tag to compare

@github-actions github-actions released this 29 Oct 21:58
· 24 commits to main since this release

This release fixes a false "variable with no value: null,null" warning that v2.4.1 put in the card editor for most cards, and lets a step's argument hold a placeholder. It adds the two steps asked for in #313 and #314, and reworks the card editor: the built card at the top, a card picker for empty:, an Advanced section for the settings that were YAML-only, and a link to the template.

Fixed

  • The card editor no longer warns about a variable called null,null. Since v2.4.1, any card without a for_each_from or an on_error was told "This template uses a variable with no value and no default: null,null." The two missing settings were read together as [[null,null]], which looks like a placeholder. Each is now read on its own, and only when it's set. (#341)

  • A step's argument can hold a placeholder. [[room|lower|suffix:_[[kind]]_occupancy]] used to stop the suffix: argument at the first ] and come out as hallway_[[kind_occupancy]]. The inner placeholder is now filled in first. That works for every text step, default: and if:x=, and a single [ in an argument (replace:[:() still works as before. (#333)

    default:
      - kind: motion
    card:
      type: tile
      entity: '[[room|lower|prefix:binary_sensor.|suffix:_[[kind]]]]'
  • A template using exists with a ? is built again once Home Assistant arrives. A chain like [[x|suffix:_[[kind]]|exists?]] wasn't recognised as asking Home Assistant, so a card built before the entity registry loaded kept its first answer. (#334)

Added

  • if_exists keeps an entity id only while Home Assistant knows it. Otherwise the value counts as missing, so ? drops it and default: or or: can stand in. It replaces the let: variable holding [[sensor|exists]] that an if: used to read. An optional one that finds nothing leaves quietly. One without ? stays on the card, and the console names the entity id it looked for. (#334, closes #313)

    room_sensors:
      default:
        - kind: motion
      card:
        type: entities
        title: '[[room]]'
        entities:
          - 'light.[[room|lower]]'
          - '[[room|lower|prefix:binary_sensor.|suffix:_[[kind]]|if_exists?]]'
  • A bare with and a bare repeat. [[row|with]] means the same as [[row|with:]]: the block filled in from the values the card already has. [[row|repeat]] repeats an item template over its own for_each or for_each_from, which item templates can now carry. for_each can be a placeholder that fills to a list (for_each: '[[rows]]'), and for_each_from is filled in from the card's values first. The card editor also stops calling a variable unused when only an item template reads it. (#335, closes #314)

    decluttering_templates:
      every_light:
        for_each_from:
          domain: light
        item:
          entity: '[[entity]]'
      lights_card:
        card:
          type: entities
          entities:
            - '[[light_row|with]]'
            - '[[every_light|repeat]]'
  • What it builds, at the top of the card editor. The Result panel moves from the bottom of the editor to the top, with a Rendered / YAML switch. In YAML the line your last edit changed is highlighted. It now fills in with: and repeat: of item templates the way the dashboard does, where before it showed them as written. (#338, closes #256)

  • A card picker for empty:. The card shown when a repeat matches nothing is chosen with Home Assistant's own card picker instead of typed as YAML. Edit opens its editor inside the card editor, and Remove takes it out. It only shows for a card with for_each or for_each_from. (#336, closes #254)

  • An Advanced section in the card editor. Grid size in a sections view, style, on_error (show the error, hide, or a card you pick), strict, rebuild_on, debug, name and inherit_variables have controls of their own now, in a folding section whose header counts how many are set. (#337, closes #251)

  • Edit the template, from the card. When the template lives in a template card on the same dashboard, the "Defined in" line links to it. The link opens the template card's editor. Next time you open the card, it offers to bring back the changes you hadn't saved. (#339, closes #257)

  • Matching templates come first under Community in the By entity tab. Templates with suggest_for: are listed ahead of other custom cards' suggestions in the add-card dialog. Home Assistant's own suggestions still come first. (#340, closes #259)

Changed

  • The card editor's layout. What it builds is now at the top, and Dashboard health has moved below the new Advanced section. The empty: field is a card slot rather than a YAML box, and only appears on a card that repeats. Nothing in the saved configuration changes. (#338, #336)

Upgrading

No action needed. Existing configurations build exactly as before. The only exception is a step argument containing [[, which used to break and now works.

The new steps are on Placeholder Reference and Variables. The bare repeat is on List Entries, and the card editor changes are on Visual Editors.

Full changelog: v2.4.1...v2.5.0