malcolmrigg / wizard-clock-card

A wizarding clock Lovelace component for Home Assistant
53 stars 13 forks source link
lovelace-custom-card

WizardClock

A wizarding/location "clock" Lovelace component for Home Assistant

Example wizarding clock

About

I was suprised when I couldn't find something like this that somebody else had already made, so decided to give it a go myself! It took a few months due to not having much spare time, and javascript not being my first language, but I eventually got it working quite nicely for my purposes. It looks (and is) pretty basic so far.

I decided to make it public so that other (more skillful) people could make use of it and tweak it to improve it/make it look nicer - if you do use it and make any improvements please let me know so that I can incorporate them into my code!

Features

Installation

HACS

Use this repository as a custom repository in HACS.

Manual

  1. Copy wizard-clock-card.js to www/custom-lovelace/ in your home assistant folder, along with any particular font you want to use.
  2. Go to Settings -> Dashboards, then hit the three dots to open the custom Resources editor.
  3. Select "JavaScript Module" as the resource type, then add the URL "/local/custom-lovelace/wizard-clock-card.js?v=1" (note if you put the javascript file somewhere other than www/custom-lovelace/ you'll need to modify this accordingly).
  4. Hit save.
  5. Edit the dashboard you want to add it to, then add a "Manual" card.
  6. Add your config, see the example below

Updating

  1. Copy the updated wizard-clock-card.js over the old version
  2. Edit the url in the Resources editor to increment the version number, e.g:

    /local/custom-lovelace/wizard-clock-card.js?v=2

Config

type: 'custom:wizard-clock-card'
locations:
  - Home
  - Work
  - School
wizards:
  - entity: device_tracker.harrys_phone
    name: Harry
    colour: '#F00'
    textcolour: '#00F'
  - entity: device_tracker.hermiones_phone
    name: Hermione
    colour: '#0F0'
  - entity: calendar.ron
    name: Ron
  - entity: calendar.ginny
    name: Ginny
fontname: itcblkad_font
fontface: >-
  font-family: itcblkad_font;    src: local(itcblkad_font),
  url('/local/custom-lovelace/ITCBLKAD.TTF') format('opentype');
width: 500
lost: 'In mortal peril'
travelling: 'Between here and there'

Wishlist

These are features/ideas that I'd like to add at some point, but may not happen any time soon. Feel free to add them yourself and share your code if you're able!