Lovelace: Wizarding Clock Card

State: GG’s House

Data:

{
“source_type”: “gps”,
“latitude”: xx.xxxxxxx,
“longitude”: -xx.xxxxxxx,
“gps_accuracy”: 15,
“battery”: 1,
“address”: null,
“at_loc_since”: “2019-04-17T01:28:24+00:00”,
“battery_charging”: false,
“driving”: false,
“last_seen”: “2019-04-18T00:35:53+00:00”,
“moving”: false,
“raw_speed”: 0,
“speed”: 0,
“wifi_on”: true,
“friendly_name”: “GG”,
“entity_picture”: “/local/gg.png”

Could you try removing the apostrophe from the zone name? See if that makes any difference.

Looking through my code I’m doing some fairly dodgy things when looking up/comparing zone names with the entity states, might need to rewrite some of it to get it to work with names that include apostrophes and other punctuation…

@CultusMechanicus suggested a neat function for drawing the location names on a curve around the clock face; and I’ve managed to integrate it, so there’s a new release available :slight_smile:

I’ll update the sample image when I get a chance…

2 Likes

Custom updater confuses me. For the last few months, 9 times out of 10, the only thing custom updater seems to be tracking is itself - and there seem to be tiny upgrades every few days - even though I have the life360 component also there needing to be tracked
dasdasdas

Custom updater does seem to get small and regular upgrades so I don’ think that is a problem. Why you have nothing else being tracked is though!

Do you have anything in your configuration.yaml? some components nned an entry there of which Life360 is one. For example I have the following…

custom_updater:
  track:
    - components
    - cards
    - python_scripts
  component_urls:
    - https://raw.githubusercontent.com/briis/smartweather/master/custom_updater.json
    - https://raw.githubusercontent.com/pnbruckner/homeassistant-config/master/custom_components.json
  card_urls:
    - https://raw.githubusercontent.com/kalkih/mini-media-player/master/tracker.json
    - https://raw.githubusercontent.com/kalkih/mini-graph-card/master/tracker.json
    - https://raw.githubusercontent.com/rdehuyss/homeassistant-lovelace-google-calendar-card/master/custom_updater.json
    - https://raw.githubusercontent.com/iammexx/home-assistant-config/master/ui/darksky/version.json
    - https://raw.githubusercontent.com/MizterB/lovelace-secondaryinfo-entity-row/master/custom_cards.json
    - https://raw.githubusercontent.com/malcolmrigg/WizardClock/master/repo.json

My config looks like this:-

custom_updater:
  track:
    - components
    - cards
    - python_scripts
  component_urls:
    - https://raw.githubusercontent.com/pnbruckner/homeassistant-config/master/custom_components.json
  python_script_urls:
    - https://raw.githubusercontent.com/pnbruckner/homeassistant-config/master/python_scripts.json
  card_urls:
    - https://raw.githubusercontent.com/malcolmrigg/WizardClock/master/repo.json

Seems to be the same problem as this

Sorry, that apostrophe was added by me. It’s not actually in the state or the zone/place name.

Ok, I’m a bit stumped then. There is likely an error message somewhere - they are sometimes written to the home assistant log, if not then you’ll need to look in the JavaScript console - that might help point to what the problem is.

Maybe this will help…

weasley-card.js?v=0.3.0:192 Uncaught TypeError: locations[locnum].toLowerCase is not a function
at HTMLElement.drawTime (weasley-card.js?v=0.3.0:192)
at HTMLElement.drawClock (weasley-card.js?v=0.3.0:103)
at weasley-card.js?v=0.3.0:77
at d31a7a5c51eccfda1fcf.chunk.js:1
drawTime @ weasley-card.js?v=0.3.0:192
drawClock @ weasley-card.js?v=0.3.0:103
(anonymous) @ weasley-card.js?v=0.3.0:77
(anonymous) @ d31a7a5c51eccfda1fcf.chunk.js:1
requestAnimationFrame (async)
window.requestAnimationFrame @ d31a7a5c51eccfda1fcf.chunk.js:1
set hass @ weasley-card.js?v=0.3.0:76
_createCardElement @ 26357108de036797f570.chunk.js:3210
_rebuildCard @ 26357108de036797f570.chunk.js:3210
t.addEventListener.once @ 26357108de036797f570.chunk.js:3210
i @ app-652a7f4d.js:410
(anonymous) @ 26357108de036797f570.chunk.js:4568
Promise.then (async)
gi @ 26357108de036797f570.chunk.js:4568
_createCardElement @ 26357108de036797f570.chunk.js:3210
(anonymous) @ 26357108de036797f570.chunk.js:3207
setConfig @ 26357108de036797f570.chunk.js:3207
yi @ 26357108de036797f570.chunk.js:4568
gi @ 26357108de036797f570.chunk.js:4568
value @ 26357108de036797f570.chunk.js:5685
async function (async)
value @ 26357108de036797f570.chunk.js:5685
value @ 26357108de036797f570.chunk.js:5685
performUpdate @ app-652a7f4d.js:2
_enqueueUpdate @ app-652a7f4d.js:2
async function (async)
_enqueueUpdate @ app-652a7f4d.js:2
_requestUpdate @ app-652a7f4d.js:2
initialize @ app-652a7f4d.js:2
initialize @ app-652a7f4d.js:2
T @ app-652a7f4d.js:2
U @ app-652a7f4d.js:2
o @ 26357108de036797f570.chunk.js:5468
_clone @ app-652a7f4d.js:2
_commitTemplateResult @ app-652a7f4d.js:2
commit @ app-652a7f4d.js:2
a @ app-652a7f4d.js:2
U.render @ app-652a7f4d.js:2
update @ app-652a7f4d.js:2
performUpdate @ app-652a7f4d.js:2
_enqueueUpdate @ app-652a7f4d.js:2
async function (async)
_enqueueUpdate @ app-652a7f4d.js:2
_requestUpdate @ app-652a7f4d.js:2
set @ app-652a7f4d.js:2
value @ 26357108de036797f570.chunk.js:5706
async function (async)
value @ 26357108de036797f570.chunk.js:5706
value @ 26357108de036797f570.chunk.js:5706
performUpdate @ app-652a7f4d.js:2
_enqueueUpdate @ app-652a7f4d.js:2
async function (async)
_enqueueUpdate @ app-652a7f4d.js:2
_requestUpdate @ app-652a7f4d.js:2
initialize @ app-652a7f4d.js:2
initialize @ app-652a7f4d.js:2
T @ app-652a7f4d.js:2
U @ app-652a7f4d.js:2
n @ 26357108de036797f570.chunk.js:5685
value @ app-652a7f4d.js:876
_currentLoadProm.c.then._currentLoadProm @ app-652a7f4d.js:876
Promise.then (async)
value @ app-652a7f4d.js:876
performUpdate @ app-652a7f4d.js:2
_enqueueUpdate @ app-652a7f4d.js:2
async function (async)
_enqueueUpdate @ app-652a7f4d.js:2
_requestUpdate @ app-652a7f4d.js:2
set @ app-652a7f4d.js:2
value @ app-652a7f4d.js:876
async function (async)
value @ app-652a7f4d.js:876
value @ app-652a7f4d.js:1287
value @ app-652a7f4d.js:1287
performUpdate @ app-652a7f4d.js:2
_enqueueUpdate @ app-652a7f4d.js:2
async function (async)
_enqueueUpdate @ app-652a7f4d.js:2
_requestUpdate @ app-652a7f4d.js:2
initialize @ app-652a7f4d.js:2
T @ app-652a7f4d.js:2
n @ app-652a7f4d.js:876
n @ app-652a7f4d.js:1287
_clone @ app-652a7f4d.js:2
_commitTemplateResult @ app-652a7f4d.js:2
commit @ app-652a7f4d.js:2
a @ app-652a7f4d.js:2
U.render @ app-652a7f4d.js:2
update @ app-652a7f4d.js:2
performUpdate @ app-652a7f4d.js:2
_enqueueUpdate @ app-652a7f4d.js:2
async function (async)
_enqueueUpdate @ app-652a7f4d.js:2
_requestUpdate @ app-652a7f4d.js:2
initialize @ app-652a7f4d.js:2
initialize @ app-652a7f4d.js:2
T @ app-652a7f4d.js:2
U @ app-652a7f4d.js:2
i @ app-652a7f4d.js:1287
_clone @ app-652a7f4d.js:2
_commitTemplateResult @ app-652a7f4d.js:2
commit @ app-652a7f4d.js:2
update @ app-652a7f4d.js:2
_commitTemplateResult @ app-652a7f4d.js:2
commit @ app-652a7f4d.js:2
a @ app-652a7f4d.js:2
U.render @ app-652a7f4d.js:2
update @ app-652a7f4d.js:2
performUpdate @ app-652a7f4d.js:2
_enqueueUpdate @ app-652a7f4d.js:2
async function (async)
_enqueueUpdate @ app-652a7f4d.js:2
_requestUpdate @ app-652a7f4d.js:2
set @ app-652a7f4d.js:2
value @ app-652a7f4d.js:1362
(anonymous) @ app-652a7f4d.js:1362
n @ core-9f50dfce.js:1
(anonymous) @ core-9f50dfce.js:1
Promise.then (async)
c @ core-9f50dfce.js:1
subscribe @ core-9f50dfce.js:1
T @ core-9f50dfce.js:1
(anonymous) @ core-9f50dfce.js:1
Promise.then (async)
157 @ core-9f50dfce.js:1
o @ core-9f50dfce.js:1
(anonymous) @ core-9f50dfce.js:1
(anonymous) @ core-9f50dfce.js:1
13weasley-card.js?v=0.3.0:192 Uncaught TypeError: locations[locnum].toLowerCase is not a function
at HTMLElement.drawTime (weasley-card.js?v=0.3.0:192)
at HTMLElement.drawClock (weasley-card.js?v=0.3.0:103)
at weasley-card.js?v=0.3.0:77
at d31a7a5c51eccfda1fcf.chunk.js:1

Thanks, that’s helpful, it looks like it’s managing to store something other than a string where it’s supposed to store the location name. I can probably add some checking code that’ll get around this, which will mean that the clock will start to render ok, though it may still not recognise this particular zone and mark you as lost when you’re at it…

Is there anything strange about the “GG” zone? Does it actually exist as a zone in the config?

GG is a person and GGs is her house. It exists as a zone in zones.yaml and in Life360 is was called GGs House. I have changed that now to match but she still does not show up, regardless of where she is.

@atomicpapa I’ve tried to add some error handling to the code that populates the “locations” array, which will hopefully tell you where the problem is - it’ll raise an error in the console if it tries to add something that’s not a string. Give it a shot and let me know if you find the problem.

A physical version of this would be…just wow

@atomicpapa @malcolmrigg

The state of any entity, including device_tracker entities, is always a string. It can’t be anything else. Even if a component/platform tries to write the state as a different type, the state machine will convert it to a string.

The life360 device_tracker platform has a lot of flexibility when it comes to determining what a device_tracker’s state will be. For more details please look here.

@atomicpapa, I see in your custom:weasley-card configuration, you have Home listed as a location. But a device_tracker’s state will never be Home; it will be home. Of course, I’m not sure what the custom card is using - the actual state, or the friendly_name of a zone. BTW, regarding zones, when in a zone, the device_tracker’s state will be the friendly_name of the zone, not the object_id. So, e.g., if it was in zone.my_work, where this zone’s friendly name was My Work, the state would be My Work, not my_work.

Hope this helps. Let me know if you have anymore questions about how the life360 platform works.

@pnbruckner Thanks for the info :slight_smile: I’ll have a read through that link to see if I’m handling life360 config correctly.

I think it’s possibly a bug in my code that’s trying to discover the friendly_name of the zones to display, though I’ve not managed to reproduce the problem that @atomicpapa is having.

@daneboom I was inspired by the physical versions that people have already made - there are quite a few examples out there! I wanted something a bit more flexible though, the idea was to have this permanently displayed on a cheap tablet. Eventually I want to create a physical housing with real hands controlled by a motor, but still using a display as the clock face so that locations can be added/changed at will.

1 Like

Hey, I love this card, it’s super awesome and the wife is a huge HP fan!

We just monuted a tablet to the wall using HADashboard - is there any way I could get this to display on a HADashboard widget? Has anyone attempted it or is there a variant that works with it? I’d love to put this on my wall on a screen for all to see! :smiley:

ahhh!
the Weasley clock, high on my HA want list for so long!
Thank you sir :wink:

1 Like

Should definitely be possible to turn it into a HAdashboard widget. However I’ve had a quick look at the widget development docs and the code for retrieving the entity state is different, so that part would need to be rewritten. If anyone has the time and inclination to do it that would be cool…

Thanks for this, it makes for a much prettier tracker than using device badges or the slightly stalker-ish map display!

I’ve tweaked it a little and sent you a pull request. Since only owntracks provides “travelling” and I’m using GMaps Location Sharing, I made it so that if you leave lost or travelling blank then they aren’t added to the face. I also added basic theme support, seems to play well with all the themes I have.

1 Like

That’s awesome, I’ll look at getting this merged in shortly, thanks!