Skip to content

🚀🚀🚀 VERSION 2.0

Latest

Choose a tag to compare

@cataseven cataseven released this 26 Jun 09:18
7daaa5c

⚠️⚠️⚠️ ATTENTION ⚠️⚠️⚠️

This release is a comprehensive overhaul of the visual editor and the sensor system,
covering the work done from issue #14 onward. Everything released before that is unchanged.

Compatibility in one line: existing dashboards keep working. There are no hard breaking
changes — but a couple of config details change shape (see Breaking changes & migration).


Highlights

  • Redesigned per-entity editor with four focused tabs: Entity, Timer, Sensors, Design.
  • New sensor system: a dedicated Last run and Next run sensor per entity, each with its
    own label, icon, position, and an optional attribute.
  • Sensor values now use Home Assistant's own formatting. Date/time values are shown as
    localized, auto-updating relative time (for example "5 minutes ago").
  • Built-in "How to create a last-run sensor" helper popup with a ready-to-copy template-sensor
    YAML, reachable from the Sensors tab.
  • Cleaner, modernized editor: per-entity color dots, matching card borders, inline fields,
    simplified typography.

Editor redesign

ui
  • The old "Global Settings" panel (General / Icons / Colors / Labels) has been removed.
    The top of the editor is now a single Card Header field.
  • Each entity is configured through four tabs:
    • Entity — display name and the controlled entity.
    • Timer — timer entity, Automation Link, default-duration override, editable duration,
      and the time-format strings.
    • Sensors — the Last run / Next run sensors and the battery indicator.
    • Design — button position, colors, icons, and status labels for that entity.
  • Each entity card shows a colored dot and a matching outer border, so entities are easy
    to tell apart at a glance.
  • Duplicating an entity now produces an exact copy (it no longer appends "(copy)" to the name).

Sensors: new model

Before: a single per-entity sensor: string.

Now: up to two optional structured sensors per entity:

last_run_sensor:
  entity: sensor.zone_1_last_run
  name: Last run         # label shown on the card
  icon: mdi:history
  position: left         # left | center | right
  attribute: ...         # optional: show an attribute instead of the state
next_run_sensor:
  entity: sensor.zone_1_next_run
  name: Next run
  icon: mdi:update
  position: right
  • Each sensor can show the entity's state or, optionally, one of its attributes.
  • Values are formatted by Home Assistant. Timestamp/date values render as localized,
    auto-updating relative time (via ha-relative-time), replacing the old hand-built
    "X minutes ago" text.

A ? button next to the Last Run Sensor slot opens a popup that explains how to create a
trigger-based template sensor and lets you copy the YAML.


Changed / Deprecated

  • sensor (per-entity, string) is deprecated in favor of last_run_sensor. The card still
    renders a legacy sensor: for backward compatibility, and the visual editor automatically
    migrates
    it to last_run_sensor the first time you open the card in the editor.
  • These label keys have been removed and no longer have any effect (the card now uses HA
    relative-time instead):
    last_on_active, last_on_now, last_on_ago_minutes, last_on_ago_hours, last_on_ago_days.
  • Global colors, icons, labels, and button_position are no longer editable in the
    visual editor.
    They are still read and applied when present in YAML, but the supported way to
    style from the UI is now per-entity (Design tab).
  • Battery: the editor now offers any entity (not only the sensor domain) and uses a
    simple on/off toggle. A literal numeric battery: value still works.

Breaking changes & migration

There are no hard breaking changes — existing dashboards continue to render. Two things to be
aware of:

  1. Opening a card in the visual editor rewrites a legacy sensor: entry into
    last_run_sensor:. Your saved YAML shape will change (the behavior stays the same).
  2. last_on_* label overrides are ignored. Last-run / next-run times are now formatted by
    Home Assistant (localized relative time), so any custom "minutes ago" strings no longer apply.

If you prefer to stay on pure YAML and never open the editor, your existing sensor: config keeps
working as-is.


Old → new config reference

Per-entity

Previously released Now Status
sensor: sensor.x (string) last_run_sensor: { entity, name, icon, position, attribute? } Replaced. Auto-migrated; legacy still rendered.
(none) next_run_sensor: { entity, name, icon, position, attribute? } New.
battery: <entity | number> battery: <entity | number> Unchanged. Editor now accepts any entity.
colors / icons / labels / button_position Same keys Unchanged. Now edited in the Design tab.

Global (top-level)

Previously released Now Status
colors / icons / labels / button_position Same keys Still honored from YAML; removed from the editor UI.
labels.last_on_* Removed / ignored.
title title Unchanged (shown as "Card Header" in the editor).

Updated example (new schema)

type: custom:switch-and-timer-bar-card
title: Irrigation Control
# Global colors/icons/labels still work from YAML (no longer in the editor UI):
colors:
  on: "#2196F3"
  ready: "#4CAF50"
  unavailable: "#F44336"
  button_start: "#4CAF50"
  button_stop: "#2196F3"
  icon: "#FFFFFF"
  progress_fill: "#2196F3"
icons:
  start: mdi:play
  stop: mdi:stop
labels:
  status_on: Watering
  status_ready: Ready
  status_unavailable: Unavailable
  time_format_zero: 0m 00s
  time_unit_minutes: m
  time_unit_seconds: s
entities:
  - name: Zone 1
    switch: switch.zone_1
    timer: timer.zone_1
    timer_and_entity_connected_via_automation: true
    duration: "00:15:00"          # optional override of the helper duration
    editable_duration: true       # optional: tap the total time to change it
    battery: sensor.zone_1_battery # entity id or a literal number
    button_position: left
    last_run_sensor:
      entity: sensor.zone_1_last_run
      name: Last run
      icon: mdi:history
      position: left
    next_run_sensor:
      entity: sensor.zone_1_next_run
      name: Next run
      icon: mdi:update
      position: right
    colors:
      on: "#1E88E5"
      progress_fill: "#1E88E5"
    icons:
      start: mdi:play-circle
      stop: mdi:stop-circle
    labels:
      status_on: Watering
      status_ready: Ready