For all who’d like to have a large analog clock somewhere on their Lovelace Interface (Kiosk, mode, “Houston Control” style screens…) how’s this for a first work:
The second hand actually moves like the real one, stopping at 12 for 1.5 seconds, before moving on…
The clock itself is animated SVG, using embedded JS. Due to being SVG, it can scale to any size without pixeling… The Background image isn’t SVG, but can be adapted in the calling index.html.
and a packaging index.html file, with a CSS Background Image representing the clock background.
All in all, only 3 files needed on the web server!
I can provide these files, but I have no idea how or where to post them.
Also someone might provide me with some tips, how i could place this stuff in /local/analog-clock (CONFIG/www/analog-clock) instead of using an external web-server - making this simple clock self-contained…
Not sure if this is the proper way but I created a folder ‘clock’ in ‘/config/www/community/’ and then placed two files (not using a CSS background yet) in this folder: german-clock.svg + clock.html (as generated by the 3quarks site).
After that I created an iFrame tile with the following script:
Only for some reason changing the settings in my html file does not change the clock view. Not sure why. For the moment I stick with the preconfigured german-clock.svg. In that case the index.html file is not even required.
Tried the config that you send me. Works as well, but still with the same problem: the settings in the html are not executed. Whatever I change, the behavior of the clock stay the same. All parameter settings in the index.html are ignored.
Maybe another docker or whatever could provide a non lovelane webserver…
Like the plug-ins for PI-Hole, Traccar and plenty of others use (nginx webserver is pretty lean…).
I intend to look into this, but that has to wait 'til I’m home…
I quite agree that a dedicated webserver maybe overkill. But I have a few other tricks up my sleeve in petto, they could use a webserver too…
Like a card displaying the next five public holidays (from NethServer, Google Calender or any other CalDAV compatible calender. Same for an Agenda Tile, displaying your next appointments.
Or a card displaying german pollen for 15 “gras/pollen” sorts…
Another one displaying the next five busses leaving, another for trains. I live exactly opposite from a train station here in Switzerland, and the public transport services here are excellent!
As long as you’re using it for private purposes, it’s actually legal in Switzerland.
And I DO hope that your home control is not available to public view of anyone!
Swiss copyright law is fairly liberal so far. It’s actually legal to download even copyrighted stuff, just not to further “share” it. Bittorrent shares at the same time as downloading, so that doesn’t count as legal here, at least not for copyrighted stuff.
The website which created the SVG clock has been informed by the Swiss Federal Railways, the swiss design isn’t available online.
Besides which, I am Swiss, live in Switzerland, and my grandfather worked for the Swiss Federal Railways. I PAID my part, with tax money, among others!
AND: I don’t provide any code or whatever, just an idea and a static image. This image can be considered as free marketing for that clock, the Image shown is from their online store. The clocks available at the SVG Analog Clocks author site are - like mentionned above - NOT of SBB / Hilfiker Design. The German Railways clock is NOT copyrighted, as they themselves used the Swiss design even down to the Second Stop. They just changed the second hand, using one with a hole.
And they DIN-normed the whole thing with german thouroughness.
I support and adhere to European Copyright standards - NOT to american notions of interlectual property.
A nice analog Clock is something I was missing in HA. And I’ve always liked the Swiss Railway Clock best as a wall clock, it’s really well readible even at a distance.
I’m not new to Home Automation, just new to HA.
I can handle Linux, been doing so for the past 20 years as a vocation. So I just tried the easiest way to reimplement what I found missing…
If you want it, send me a PM with your mail, I’ll send it back there.
If I’m mailing it individuelly, it can’t be constituted as mass, anonymous distribution…
Besides which, I don’t like the idea of anyone outside seeing my home control, even less Using it!
I’d first need to make a lovelace card, with the necessary “backend” bit, which CAN be run from CONFIG/www. But there are still a few glitches…
Grabing the iFrame from any other webserver works perfectly.
Using CONFIG/www works, but any background image isn’t respected or shown. Just the bare SVG Analog clock.
That IS nice, especially on BIG screens, as it’s a SVG Vector, no pixalations…
But I still like having the Backgrounds for smaller Images. Unless I can get that into the SVG too, but that will take a bit more work, vectorizing an Image in decent enough quality…
Once I get the glitches straightened out, and played around with the “sample” Module/Card, I’ll open up my GitHub account…
I do not use ANY positioning in the Webcard nor in the index.html (Somtimes I use that).
The only positioning I use is the sizing, to keep the background image centric.
I pasted the analog_clock url into another Webpage card, and you’re right, it is centered. When copying and pasting the code from view source into my local file the clock is left-aligned again, very strange.
You mentioned above you might make a custom card, do you think this is possible? I would like to customize the clock a little (remove background…)