day_badges, and the card evaluates every badge against the day and its events — showing the badge on any day that satisfies the badge’s match block. Multiple badges can appear on the same day simultaneously, which makes them well-suited for layered annotations like recurring schedule reminders, birthday markers, or availability flags.
Badge Fields
Each entry inday_badges supports the following fields:
object
Advanced match block using the shared match schema. Use this to combine event and day conditions, e.g.
match: { event: { title_contains: 'Soccer' }, day: { weekend: true } }, or to use logical operators (any, all, not). when is accepted as an alias.object
Legacy shorthand for event-scoped matches. Equivalent to
match: { event: { ... } }. At least one event on the day must satisfy all specified conditions for the badge to appear. Either match or conditions is required.integer
default:"0"
Optional ordering hint used by tooling. Badges are evaluated independently and all matching badges are shown, so priority does not suppress other badges.
string
Optional string identifier. Auto-generated (
day-badge-1, day-badge-2, …) if omitted.string
The text label displayed inside the badge chip. You can use
text by itself or combine it with icon to show an icon followed by the label in the same badge.string
An MDI icon name (e.g.
mdi:cake-variant) displayed inside the badge. When text is also provided, the icon appears first, followed by the text, inside one badge.string
A hex color string for the badge’s background. Defaults to the card’s accent color if not specified.
string
A hex color string for the badge’s foreground (text and icon color). Controls the contrast against
background_color. If omitted, the card picks a readable color automatically.string | number
Overrides the overall size of the badge chip. Accepts a number (interpreted as pixels) or a CSS length string such as
'32px'.string | number
Overrides the font size of the badge label text. Accepts a number (interpreted as pixels) or a CSS length string such as
'11px'.Condition Keys
Theconditions object matches against events on each day. All specified keys must match at least one event on that day for the badge to appear. The following fields are supported:
string
A Home Assistant calendar entity ID (or virtual calendar ID). The badge appears on days where at least one event belongs to that calendar.
string
A substring to match against event titles on a given day. The badge appears on days that have at least one event whose title contains this string. Prefix with
exact: for an exact match or regex: for a regular expression.string
A substring to match against the event description field. Supports the same
exact: and regex: prefixes as title.string
A substring to match against the event location field. Supports the same
exact: and regex: prefixes as title.boolean
When
true, the badge appears only on days that have at least one all-day event. When false, only days with at least one timed event match.boolean
When
true, the badge appears on days where at least one event is in the past. When false, only days with non-past events match.Day-scoped badges
Badges can also fire purely from day-level state (no event required) by usingmatch.day. For example, mark every weekend with a chip:
Legacy condition aliases
For backward compatibility, the card silently accepts several alternative spellings of the condition keys above. New configurations should use the canonical names (title, summary, location, calendar, all_day), but the following aliases continue to work:
Examples
Show a cake icon on days with birthday events
This badge watchescalendar.birthdays and renders a pink cake icon on any day that calendar has an event.
Show a badge on days with a standup meeting
This badge appears on any day that has an event whose title contains “standup”, making it easy to spot those days at a glance.Show an icon and text in one badge
Set bothicon and text on the same badge when you want a compact chip with an MDI icon followed by a label. The card renders this as one badge, not two separate badges.
Use values from matched event metadata
Badge display fields can reference simple values from the event that matched the badge conditions. This is useful when a helper calendar stores day classification metadata in the event description. Only full-value path templates are supported. The whole string must be a template like{{ event.description_json.badge_text }}. Partial strings such as Type: {{ event.description_json.badge_text }} are not interpolated and remain literal text.
mdi:school icon, the School label, and the #EDE7F6 background color.
Supported dynamic display fields are icon, text, background_color, and color. Available paths include event.description_json.<field>, event.title, event.summary, event.calendar, event.entity_id, title, calendar, and date.
Dynamic badge values are intentionally narrow in scope:
- This is not a general-purpose template engine.
- JavaScript, expressions, function calls, conditionals, filters, arithmetic, bracket access, and mixed string interpolation are not supported.
- Invalid JSON descriptions are ignored.
- Missing fields are ignored safely.
- Values that resolve to objects or arrays are ignored for display fields.
- Dynamic
background_colorandcolorvalues must resolve to supported CSS color formats, such as hex,rgb()/rgba(),hsl()/hsla(), or a recognized named color. Invalid color values are ignored. - Dynamic resolution applies only to
day_badgesdisplay fields andtap_action.event_data, not matching, priority, or hidden calendar rules.
Fire a DOM event when tapping a badge
You can make an individual day badge clickable by addingtap_action. Currently, day badges support only action: fire-dom-event. Other Home Assistant actions such as navigate, url, call-service, more-info, hold_action, and double_tap_action are not supported for day badges.
tap_action.event_data supports the same safe full-value templates as dynamic badge text, icon, and color. Values can resolve from date, calendar, title, event, and event.description_json. Only scalar string, number, and boolean values are included in the dispatched event detail.
CustomEvent named open-day-detail. The event detail contains the resolved event_data values.
Mark all-day event days with an indicator
This badge shows a calendar icon on every day that has at least one all-day event.Combine conditions for precise targeting
You can stack multiple conditions in one badge. This example shows a star icon only on days that have an event fromcalendar.work with “review” in the title.
