My old Home Assistant instance had 9 dashboards with more than 300 cards between them. While rebuilding the installation on a new machine I replaced them with a single one, a control room that started with 7 views and has 9 now, and its YAML comes out of a Python script. Checking the new dashboard against the old ones also turned up a clock problem that came from running both instances side by side.
Why there were nine dashboards
The nine had a simple structure: one per floor, one for lighting with 7 sub-views, and one each for topics such as solar, heating and the network. The overview dashboard alone consisted of 84 conditional cards, one per lamp, so that a lamp appeared there only while it was switched on.
One dashboard, generated by a script
The new dashboard is generated by a Python script. The generated YAML was about 3,000 lines in its first version and about 5,500 in November 2026. The lamps come from the KNX configuration, and the floor each lamp belongs to comes from the section comments in that same file. A new lamp in the KNX file means running the script once, and the lamp is on the dashboard.
The design system is 7 templates for the community card button-card: indicator field, reading, light, climate, contact, button and a base shape the others inherit from. An eighth one for the bathroom fans came later. The snippets below use these templates, whose definitions are not part of this post. The views are sections views, the layout I described in the five-step dashboard build.
The dashboard sits on the theme I built for the theme comparison: graphite, amber as the signal colour for energy, teal for climate. Every signal colour in the generated YAML is a theme variable such as var(--primary-color), and the theme sets darker tones in light mode, so the contrast holds in both modes. The history graphs are the exception. I could not get them to take their colours from the theme variables.


The 84 conditional cards are gone. Sections views can show or hide any card with a visibility condition, and two helper sensors count lights that are on and windows that are open directly from all KNX entities. The one below counts KNX light and switch entities plus the TP-Link lamps, so the KNX filter needs narrowing where KNX switches also control other equipment. It only counts the state on. A switch without a feedback object whose state is unknown is not counted, so Alles aus can appear while such a lamp is on. The excerpts are cut from my files and keep their German names and comments; Lichter an means lights on, and Alles aus means everything off:
# packages/leitstand.yaml (excerpt)
template:
- sensor:
- name: "Lichter an"
unique_id: leitstand_lichter_an
icon: mdi:lightbulb-group
state_class: measurement
# KNX-Lampen/-Schalter + TP-Link-Lampen (nur light.*, die TP-Link-
# Konfigurationsschalter wie "fliessende Uebergaenge" zaehlen nicht)
state: >-
{{ (integration_entities('knx') | select('match', '^(light|switch)\.') | list
+ integration_entities('tplink') | select('match', '^light\.') | list)
| select('is_state', 'on') | list | count }}
attributes:
liste: >-
{{ (integration_entities('knx') | select('match', '^(light|switch)\.') | list
+ integration_entities('tplink') | select('match', '^light\.') | list)
| select('is_state', 'on') | map('state_attr', 'friendly_name') | list }}# dashboards/leitstand.yaml (excerpt: section "Jetzt an", generated)
- type: markdown
content: Alles aus.
visibility:
- condition: numeric_state
entity: sensor.lichter_an
below: 1
card_mod:
style: 'ha-card { font-family: ''IBM Plex Mono'', ui-monospace, monospace; font-size: .8rem; color: var(--secondary-text-color); }'
# ... one card per lamp, here the kitchen spotlights
- type: custom:button-card
template: ls_licht
entity: switch.strahler_kuche
name: Küche Strahler
visibility:
- condition: state
entity: switch.strahler_kuche
state: 'on'
grid_options:
columns: 6The first version of the lights view showed 70 KNX lamps grouped by floor only, and the feedback was that on one floor you had to search through 20 tiles. The old dashboards had one view per room, which was more practical for switching. The script now adds a sub-heading per room inside each floor. The room comes from a keyword list matched against the lamp name, the first match wins, and the script checks that no lamp ends up without a room.
The annunciator panel and the phone layout
The top of the first view is an annunciator panel, 8 rectangular fields like the warning lights in a cockpit, for things such as windows, lights, heating, solar and faults. At rest they are dark. A field lights up only when there is something to report: amber for energy and light, teal for climate, red and blinking for a fault.

I checked the result with real screenshots on a desktop and on an iPhone, and two layout problems showed up. Grid cards do not get the full width in sections views, so the first version of the panel was 8 tiny fields with truncated text. The fix is grid_options with columns set to full. Fixed column counts also do not wrap, and eight fields on the iPhone would have been 40 px wide each. The generator therefore writes every such grid twice, each with a screen visibility condition and a media query, and the phone gets 4 by 2.
# dashboards/leitstand.yaml (excerpt: the annunciator panel, generated)
- type: grid
columns: 8
square: false
cards: &id001
# ... two fields omitted
- type: custom:button-card
template: ls_lampe
entity: sensor.fenster_offen
name: Fenster
triggers_update: all
variables:
aktiv: '[[[ return parseFloat((states[''sensor.fenster_offen''] ? states[''sensor.fenster_offen''].state : '''')) > 0 ]]]'
farbe: var(--primary-color)
zeile2: '[[[ return parseFloat((states[''sensor.fenster_offen''] ? states[''sensor.fenster_offen''].state : '''')) > 0 ? parseFloat((states[''sensor.fenster_offen''] ? states[''sensor.fenster_offen''].state
: '''')) + '' offen'' : ''alle zu'' ]]]'
blinken: false
# ... five more fields
grid_options:
columns: full
visibility:
- condition: screen
media_query: '(min-width: 701px)'
- type: grid
columns: 4
square: false
cards: *id001
grid_options:
columns: full
visibility:
- condition: screen
media_query: '(max-width: 700px)'
Indicators I removed because they could be wrong
The heating mode read Standby in every room while the rooms were in comfort mode. The controllers do not report their operating mode back to the bus. The dashboard now shows actual and target temperature only, and the mode selector is gone from the overview.
The covers were the larger case. 33 of 43 cover tiles showed Unknown. Most of the actuators have no object that could report a position, which I covered in the post on KNX covers without position feedback. Home Assistant only estimates the position from the travel commands it sees on the bus. The tiles no longer show a state text. The estimate is only in the icon colour: teal for probably open, grey for probably closed, pale for unknown.
Each light tile has a small square LED that is amber when on, dark when off and dashed when the state is unknown, which is the case for switches without a feedback object. The old instance simply showed those as off.
Checking the new dashboard against the old nine
I answered the question whether something was missing with a script that extracts every entity id from the old dashboards and compares the set with the new one. Four of the old dashboards referenced 150 entities, and all 150 were in the new dashboard. The other five referenced 142, of which 86 were there. Of the 56 missing ones I added those I wanted to keep, among them the live state of the motion sensors and firmware, schedules and restart for the repeaters. I left out pure diagnostic values such as radio signal strength, and one group of switches that moves later with its own part of the migration.
A comparison of entity ids does not tell me whether I carried over cards that use no entity, such as the media archive. The archive was a sub-view of one of the old dashboards. It is now a view of its own, and the card reads the same media folder through media_source without changes. My screenshot automation reported the videos as not available, because the Chromium builds that ship with Playwright cannot decode H.264. In real Chrome both videos played.
I then compared values. I queried all 77 numeric values that exist on both instances at the same time. 71 differed by no more than 2 %, and the other 6 have explanations such as the different memory and swap usage of the two machines. The comparison also surfaced a flat daily graph with two spikes on a day with 27 kWh of yield. The vendor cloud had delivered 155,650,372 W of PV power once. The live values on the dashboard now come locally from the inverter over Modbus, and the cloud sensors become unavailable above 50 kW.
Two instances setting the same device clock
While checking the media view I noticed that two devices were running one hour fast. Both Home Assistant instances set the clock of these devices every hour, and they calculate differently. The integration deliberately adds one hour during daylight saving time, a workaround for this device type. The old version asks for the time zone of the container. The old container runs on UTC, so there is no daylight saving time and no extra hour, and the result was correct by accident. The new version asks for the time zone configured in Home Assistant and adds the hour.
With both instances writing every hour, the device clocks jumped back and forth all day. The new version has a setting for the daylight saving offset. I set it to 0 and synchronised once by hand, and both devices are correct to the second. The archive stores its progress as a timestamp in device time, and a timestamp in the future would have meant skipped files. On both instances it was earlier than the corrected device time.
I had planned the parallel phase around automations, making sure none runs twice. Integrations also act on devices on their own, setting the time or checking firmware, and two versions of the same integration can disagree while doing it.
Frequently asked questions
How do I show only the lights that are on without one conditional card per lamp?
In a sections view every card accepts a visibility condition. I give each lamp card a state condition on its own entity, which replaced 84 conditional cards on my old overview.
Why do my KNX cover tiles show Unknown in Home Assistant?
In my installation 39 of the 43 covers sit on actuators that have no object for position feedback. Home Assistant then estimates the position from travel commands and after a restart it only has the last estimate. 33 of my 43 cover tiles showed Unknown when I checked. I hid the state text and kept the buttons.
How can I check that a new dashboard covers everything the old ones did?
I compare the entity ids of the old dashboards with those of the new one by script. Cards that use no entity, such as a media browser, I have to check by hand.



