-
Notifications
You must be signed in to change notification settings - Fork 277
Description
Hello,
I’ve encountered a recurring rendering issue when embedding animated custom cards (such as analog clock cards) inside button-card using custom_fields.
Problem
When placing a custom analog clock card (e.g., gcclock-simple, or other clock-style custom cards) inside button-card as a custom_field, the child card sometimes fails to render correctly on initial load.
The card only appears after refreshing the dashboard a few times.
This issue is not specific to one clock card, as I tested three different analog clock cards, and all show the same behavior.
Expected Behavior
Child cards should render reliably inside button-card custom_fields without requiring multiple dashboard reloads.
Steps to Reproduce
Install any analog clock custom card (e.g., gcclock-simple).
Place it inside a button-card custom_field.
Reload the dashboard multiple times.
Observe that the child card sometimes does not render at all.
Example YAML
type: custom:button-card
custom_fields:
a:
card:
type: custom:gcclock-simple
showCardBackground: false
smoothMovement: false
Notes
Directly using the clock card outside of button-card works fine.
The issue seems to be related to how button-card initializes child custom cards inside custom_fields (possibly before the container has a proper size).
Adding triggers_update (e.g., with sensor.time) sometimes helps, but it feels like a workaround instead of a fix.
Environment
Home Assistant version: [2025.9.0]
Frontend version: [20250903.2]
Browser: [Edge 139.0.3405.125]
Device: [Windows 11 Desktop]
button-card version: [latest v4.3.0]
Could this be improved so that button-card ensures child custom cards are initialized properly?
Thank you!