Dashboard status lines that tell you what happens next
One markdown card per dashboard section turns several entities into a headline and a sentence. Built-in cards only, works in any language.
- Published
- Level
- Beginner
A dashboard full of tiles tells you the state of each entity: the plug is off, the schedule is on, departure is at 07:45. You still have to put those together yourself to know what’s going to happen. A status line does that work for you. It sits at the top of a section and says, in one headline and one sentence, what is going on and what comes next.
Every project on this site uses the same pattern. The car heater section, for example, says “Heating starts at 06:55” or “No heating needed” instead of four tiles you’d have to read together.
What it does
- One headline, one sentence. The headline is the state you care about; the sentence adds the detail you’d otherwise look up.
- Most urgent case first. An offline device beats “running”, which beats “schedule off”, which beats “next run”. The first match wins, so the line never shows two conflicting messages.
- Built-in cards only. It’s a plain markdown card, so it survives Home Assistant updates and needs nothing from HACS.
- Speaks your language. Times and decimals are formatted by the template, so a Finnish dashboard says “12,3 °C” and “klo 06:55”.
The pattern
Here is the skeleton. Replace the entity IDs with your own and rewrite the cases for your device.
Show the status line YAML
# Status line: one markdown card that turns several entities into a headline and a sentence.# Put it first in a dashboard section. Check the cases from most to least urgent; the first match wins.type: markdowntext_only: truegrid_options: columns: fullcontent: |- {%- set temp = states('sensor.outdoor_temperature') | float(none) -%} {%- if not has_value('switch.device') -%} ## Device offline The plug isn't responding. Check that it has power and Wi-Fi. {%- elif is_state('switch.device', 'on') -%} ## Running now On since {{ (states.switch.device.last_changed | as_local).strftime('%H:%M') }}. {%- elif is_state('input_boolean.device_schedule', 'off') -%} ## Schedule off Nothing runs until you switch it on. {%- else -%} {%- set next = today_at(states('sensor.device_next_run')) -%} {%- if next < now() -%}{%- set next = next + timedelta(days=1) -%}{%- endif %} ## Next run at {{ states('sensor.device_next_run') }} {%- set mins = ((next - now()).total_seconds() // 60) | int %} That's in {{ mins // 60 }} h {{ mins % 60 }} min. {%- endif -%}In a Sections view, add a card at the top of the section, open Edit in YAML and paste it. text_only: true drops the card background so the line reads as a heading for the tiles below it, and columns: full makes it span the section.
Writing the cases
Start with what can go wrong, then what is happening now, then what will happen next:
- Unavailable.
has_value('switch.device')is false when the entity is unavailable or unknown. Say what to check. - Active. The device is running. Say since when, or until when.
- Turned off by you. A schedule or mode is off. Say that nothing will happen on its own.
- Waiting. Everything is set. Say when the next thing happens.
Keep each headline to a few words. If a case needs a long explanation, it probably belongs on the project page, not on the dashboard.
Times and numbers
A few template details make the line read naturally:
{# A clock time from a state change #}{{ (states.switch.device.last_changed | as_local).strftime('%H:%M') }}
{# Decimal comma for Finnish dashboards #}{{ '%.1f' | format(states('sensor.outdoor_temperature') | float(0)) | replace('.', ',') }}
{# Time left until a clock time, rolling over to tomorrow if it has passed #}{%- set next = today_at('06:55') -%}{%- if next < now() -%}{%- set next = next + timedelta(days=1) -%}{%- endif -%}{%- set mins = ((next - now()).total_seconds() // 60) | int -%}{{ mins // 60 }} h {{ mins % 60 }} minHome Assistant’s own time_until() is handy, but it always writes English (“21 hours”) and returns the time itself if it has already passed, which is why the example above counts the minutes by hand.
Always give float() and int() a default, as in float(none) or int(0). Without one, a sensor that is briefly unavailable breaks the whole card.
Good to know
- Test in Developer tools → Template. Paste the content there and you see the result update live, including errors.
- It updates on its own. The card re-renders when any entity in the template changes, and every minute if the template uses
now(). - Hide states the line already tells you. If a tile’s state repeats the status line, set
hide_state: trueon it. It’s also a workaround when a state isn’t translated: in Finnish, smart plugs shown as outlets display “On” and “Off” instead of “Päällä” and “Pois”.