Home

Awesome

Time Picker Card

HACS Downloads GitHub Release CI Project Maintenance License

Overview

This is a Time Picker Card for Home Assistant's Lovelace UI.

Requires an Input Datetime that has time (has_time: true).

Installation

HACS

Install using HACS and add the following to your config:

resources:
  - url: /hacsfiles/lovelace-time-picker-card/time-picker-card.js
    type: module

Manual

Download time-picker-card.js from the latest realease and place it in your config/www folder. Add the following to your config:

resources:
  - url: /local/time-picker-card.js
    type: module

Usage

Visual Editor

Time Picker Card supports Lovelace's Visual Editor. Click the + button to add a card and search for time picker.

Visual Editor

Examples

Default config - card name shown, 24 hour mode

Default theme with card name

type: 'custom:time-picker-card'
entity: input_datetime.alarm_time

Custom config - hidden card name, 12 hour mode

Default theme with no card name

type: 'custom:time-picker-card'
entity: input_datetime.alarm_time
hour_mode: 12
hide:
  name: true

Custom config - hidden card name, 12 hour mode with a "single" hour mode picker

Default theme with single hour mode

type: 'custom:time-picker-card'
entity: input_datetime.alarm_time
hour_mode: 12
layout:
  hour_mode: single
  align_controls: right
hide:
  name: true

Custom config - card name inside card and controls aligned right

Default theme with single hour mode

type: 'custom:time-picker-card'
entity: input_datetime.alarm_time
layout:
  name: inside
  align_controls: center

Dark theme, embedded layout

Dark theme embedded

Dark theme, thin layout

Dark theme thin layout

With a custom lovelace theme

Custom theme

Options

NameTypeRequirementDescriptionDefault
typestringRequiredcustom:time-picker-card
entitystringRequiredInput Datetime entity with has_time: true
namestringOptionalCard nameEntity's friendly_name
link_valuesbooleanOptionalIf enabled, will change hour when minutes overflow. E.g. will go from 11:55 to 12:00, instead of 11:00false
hour_mode12 or 24OptionalHour format. If 12, card will show AM/PM picker24
hour_stepnumberOptionalHour change when clicking arrows1
minute_stepnumberOptionalMinute change when clicking arrows5
delaynumberOptionalDelay in ms before updating entity0
layoutobjectOptionalCard Layout configurationnone
hideobjectOptionalHide objectnone
tap_actionactionOptionalHome assistant action to perform on tapmore-info
double_tap_actionactionOptionalHome assistant action to perform on tapmore-info
hold_actionactionOptionalHome assistant action to perform on tapmore-info

Layout Object

NameValueRequirementDescriptionDefault
hour_modesingle, doubleOptionalWhether to show both AM/PM or just the current mode. In single mode, tap the value to change it.double
align_controlsleft, center, rightOptionalHorizontal alignment of the controlscenter
nameheader, insideOptionalWhether to show the name as a header or inside the cardheader
embeddedbooleanOptionalRender with embedded style - disables padding, box shadow, and card headerfalse
thinbooleanOptionalRender with reduced paddingsfalse

Hide Object

NameTypeRequirementDescriptionDefault
namebooleanOptionalHides the card namefalse
iconbooleanOptionalHides the card icon (only with controls "inside")false
secondsbooleanOptionalHides seconds inputtrue

Theme Variables

Time Picker Card will automatically pick up colors from your lovelace theme, but if you want to customize some of them, you can use the following variables in your theme's config file:

NameDefaultDescription
time-picker-elements-background-colorvar(--primary-color)Background color for header and inputs
time-picker-icon-colorvar(--primary-text-color)Arrow color
time-picker-text-colorwhiteText color
time-picker-accent-colorvar(--primary-color)AM / PM active color
time-picker-off-colorvar(--disabled-text-color)AM / PM inactive color
time-picker-border-radiusvar(--ha-card-border-radius)Border radius of the card
time-picker-control-padding8pxPadding for interactive elements. Increase for larger hitboxes of the controls. Example: 10px 12px

Meta

Georgi Gardev