Hey all, this is a custom lovelace card for selecting the time of Input Datetime entities.
I developed this because I often found myself trying to change my alarm time on my phone, which can be a bit frustrating with the default datetime card. I wanted a more mobile friendly UI - buttons you can tap to quickly change the time.
The design is not that great Iām open to suggestions.
Hope someone else finds this useful! Let me know what you think
For more details and examples, see the Github repo:
I was just thinking about itās interactions with themes. Most of the themes on HACS wonāt have your variables and the text will always be white in those situations.
Sure, but just to reiterate what @petro said - this is a generic card for setting an input_datetime. So donāt expect it to do the automations for you
Hereās an example in yaml:
# Create input_datetime.
input_datetime:
alarm_time:
name: Wake up time
has_date: false
has_time: true
# Create a time sensor, so you can use it in automations:
sensor:
- platform: time_date
display_options:
- "time"
# Automation that triggers at the time specified by input_datetime.alarm_time
automation:
- alias: wake up
trigger:
platform: template
value_template: "{{ states('sensor.time') == states('input_datetime.alarm_time')[0:5] }}"
action:
- service: media_player.select_source
data:
entity_id: media_player.bedroom
source: "Wake Up Playlist"
Then, you can use this card to change input_datetime.alarm_time - put this in your lovelace config:
That wasnāt clear from the docs. Also not clear from the docs is if you can select a theme and how to do it if you can.
On a related note, I suggest using āādisabled-text-colorā for the unselected AM/PM option and use the primary color for the one that is selected. I think that would make it more obvious which one is selected.
Right now the accent color being used for the selected value is kind of visually jarring. And since the times use the primary color then the everything that is currently active would all be the same color.
@finity, I think using --disabled-text-color is a great idea, thanks! I just released v 0.0.4 using that.
Here are some screenshots after the update:
Iām not sure where the confusion for the themes is coming from. I added this to the doc, hope it clears things up:
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 theme variables
Theme variables are usually setup in your theme config, not in the card config. Say youāre using a custom theme like noctis, you can add theme variables to the theme yaml file.
I never knew that was available in the theme file itself. Good to know.
Iāve created a few lovelace control rows for various items and I just coded the custom themes directly into my ācardā config.
See here for an example:
In my mind it makes more sense to configure those variables at the card level instead of the theme file level. That way all of the config for the card is all in the same place instead of being spread out between the card config and multiple theme files.