Skip to content

wassy92x/lovelace-digital-clock

Repository files navigation

Digital Clock

A custom digital clock card for Home Assistant

GitHub Release hacs_badge License

Image of Digital Clock Card

Options

Name Type Requirement Description Default
type string Required custom:digital-clock
locale string Optional Locale to use for formatting. For example de locale set in your home assistant profile otherwise your browser locale
timeZone string Optional Time zone to use. For example Europe/Berlin time zone set in your home assistant profile otherwise your browser time zone
firstLineFormat | timeFormat object | string Optional Format of first line { hour: '2-digit', minute: '2-digit' }
secondLineFormat | dateFormat object | string Optional Format of second line { weekday: 'short', day: '2-digit', month: 'short' }

If firstLineFormat respectively secondLineFormat is a string, it can be every format, which is valid in Luxon. See: https://moment.github.io/luxon/#/formatting?id=toformat

If firstLineFormat respectively secondLineFormat is an object, it can be every valid object, which can be passed as options to the Luxon-function toLocalString(). See: https://moment.github.io/luxon/#/formatting?id=tolocalestring-strings-for-humans

If timeFormat is specified, it will override firstLineFormat and dateFormat will override secondLineFormat.

Example

type: 'custom:digital-clock'
dateFormat:
  weekday: 'long'
  day: '2-digit'
  month: 'short'
timeFormat:
  hour: '2-digit'
  minute: '2-digit'