a-p-z / datetime-card

A minimalistic card for Home Assistant Lovelace UI which shows how many days it has been between any input_datetime and today.
21 stars 1 forks source link
home-assistant homeassistant lovelace lovelace-custom-card svelte

Datetime Card

A minimalistic card for Home Assistant Lovelace UI which shows how many days it has been between any input_datetime and today.

Useful to remind you how many days it has been since you replaced your water filter or you watered your favoirite plants.

chinese_money

Installation

hacs_badge

Or you can download datetime-card.js to your configuration/www folder and cofigure Lovelace to load it:

lovelace:
  mode: yaml
  resources:
    - url: /local/datetime-card.js
      type: module

Configuration

configuration

type: custom:datetime-card
title: Chinese money
image: /local/plant_chinese_money.png
show_names: false
flex_direction: row
entities:
  - id: input_datetime.plant_chinese_money_w
    max: 9
  - id: input_datetime.plant_chinese_money_m
    max: 5
  - id: input_datetime.plant_chinese_money_f
    max: 17

NOTE: lovelace-card-mod and lovelace-layout-card makes the visual editor crash because it tries to overwrite setConfig method, which in datetime-card is read-only. The code editor works, just ignore the error.

Actions

Note: the script needs tailoring for 3 things: