Template time format still english instead german

That would look awesome Home Assistant Oktoberfest Edition :joy:

I understood dreiviertel to mean three/quarters so 3/4 eight is 15 mins to 8.?
I donā€™t understand ?
Would this be 12 hr or 24 hr ?
Iā€™m sure we could work something out but weā€™d need some more guidance for how to format the text.
For Example - all the minutes from (say) 3:00 to 4:00 and if that can be applied to all hours in the range.

1 Like

Yes. Dreiviertel Acht is 3/4 before eight and used in distinct areas in Germany. Honestly not all Germans get it ( mee too ) :sweat_smile:

I know that there is ā€œViertelā€ acht which is 7:15 (Seeā€¦itā€™s complicated.)

So basically he would need

xx:15 = viertel
xx:30 = halb
xx:45 = Dreiviertel

And in 12 hours format.

But I would wait till he replies if itā€™s a joke or not :smile:

I understood dreiviertel to mean three/quarters so 3/4 eight is 15 mins to 8.?

Yes, you have it right. German is so much more logical than English when it comes to spelling, pronunciation and grammar but there are some ā€œpeculiaritiesā€. Perhaps itā€™s a Bavarian thing. So while ā€œhalf eightā€ in English means half-past eight, in German it means half-way to eight, or 7:30. ā€œThree-quarter eight,ā€ similarly, is three-quarters of the way to eight. Itā€™s mind-boggling to an anglophone like myself but Iā€™m sure English is more maddening to learn for my German friends since there are more exceptions than rules :smiley:

My bucket list project is to build one of these clocks powered by a SBC or some sorts. Iā€™ll need to work out a way for it to display ā€œkurz nach dreiviertel achtā€ :rofl:
https://storede.qlocktwo.com/de/qlocktwo-large

Edit: I am joking about the script but if you wanted a challenge, then there you go! :smiley: I do want to build that clock though.

The way the script would work would be, that you have an automation that calls the script as soon as one of the relevant sensors change. The service call would contain the entity IDs which are needed to calculate the absolute humidity.
The problem with all this is, that - at least in the example - it just fires an event. But you could also trigger an automation, or manually set the state of some dummy-sensor. So how you are going to use it is up to you. I myself never used it, so I donā€™t know which route would make sense from a practical point of view. And as this is also quite old, the exact code how to fire an event might have changed as well. But I think youā€™ll find some useful information when you dig deeper here in the forum while searching for topics related to the python-script integration. :+1:

BTW: For those who struggle with ā€œviertel 8ā€, imagine the 8 is a Pizza. If you ate 3/4 of it, you only have ā€œviertel Pizzaā€ because you are 3/4 away from happiness.

1 Like

Iā€™m currently building a word clock 1m Square, so this is doable
Mine would have 5 minute resolution and a cheat 4 dots to add 0 to 4 mins to give me a full minute resolution.
Having said that I still donā€™t understand your resolution as it seems just be on the quarter hour. eg when would it change ?

Edit: It must change (for efficiency) on a whole minute, say at 7 or 8 minutes past not 7:30 m:s

Having said that I still donā€™t understand your resolution as it seems just be on the quarter hour. eg when would it change ?

This is getting off topic :slight_smile: Once I get started I might start a thread on the subject, but my idea was to copy the QCLOCKTWO but with less precision. That clock changes for every minute, ā€œEs ist sechs nach dreiā€, ā€œEs ist viertel nach funfā€, etc. I was thinking: +/- 1 minute of the quarters to just state the hour/halb/viertel/dreiviertel. For +2ā€™ to +7ā€™ have ā€œkurz nachā€ the respective quarter and for -7ā€™ to -2ā€™ have ā€œkurz vorā€ the respective quarter. If I need more precision that, I can look at my damn watch :wink: That gives me the hour broken down into 12 (not equal) segments. Should be amusing and give good enough time precision for a wall clock.

Hmmm off-topic ā€¦
The QClockTwo was one of the designs I looked at for my design and the weirdest was : -

I donā€™t like the moving parts though (maintenance)
I went with a 13 x 13 grid laser cut into 2mm copper plate
The hardest bit was selecting a good stencil font and squaring the resultant letter aspect ratios.
Yet to decide if Iā€™ll go Raspberry Pi Zero W or Arduino

But thatā€™s not my point if you can get your logic worked out to display we can get the text in a sensor, observe it over time and make any tweaks you need.

So ā€¦ Any time after (say) 7 (but not 7 itself) the hour is listed as 8 ??? with the minutes shown as ???
(just make it easy for me :rofl:
Burning, feel free to jump in any time here :switzerland:

1 Like

OK, just to get this thread fully off the rails. Hereā€™s how I see the ā€œlogicā€ :rofl:

might need to test it out. Also lingo is probably wrong around midnightā€¦ mainly because I donā€™t know german.

{% set hour = hour if minute < 8 else hour + 1 if hour + 1 < 24 else 0 %}
{% set i = minute // 15 - 1 %}
{% set quarters = ['viertal', 'halb', 'dreiviertel' ] %}
{% set quarter = quarters[i] if i >= 0 else '' %}
{% set remainder = minute % 15 %}
{% set end = 'Uhr' if i == -1 and remainder in [0,1] or i == 2 and remainder == 14 else '' %}
{% set shortly = 'kurts' if remainder not in [14,0,1] else '' %}
{% if remainder == 14 %}
  {% set quarter = quarters[i+1] if i + 1 < quarters | length else '' %}
{% endif %}
{% set beforeafter = '' %}
{% if shortly %}
  {% set beforeafter = 'nach' if remainder in range(2,8) else 'vor' %}
  {% if beforeafter == 'vor' %}
    {% set quarter = quarters[i+1] if i + 1 < quarters | length else '' %}
  {% endif %}
{% endif %}
{% set items = ['Es ist', shortly, beforeafter, quarter, hour | str , end] %}
{{ items | reject('eq','') | list | join(' ') }}
2 Likes

I havenā€™t been able to test it but, AWESOME! :smile:

Itā€™s different in Switzerland. The Swiss do it similar as you do it in English, except for half past the hour.

German / Swiss / English
7 Uhr / 7 Uhr / 7 oā€™clock
Viertel 8 / Viertel nach 7 / a quarter past 7
Halb 8 / Halb 8 / half past 7
Dreiviertel 8 / Viertel vor 8 / a quarter to 8

The ā€œviertel nach 7ā€ and viertel vor 8" is the normal German way too. My example above is the Bavarian variation only.

Ah, I see.

While I wrote it, I said to myself this is not how I remember Germans telling time, but the German guy said it so it has to be like this :rofl:

Your template was almost perfect.

I had two make two grammatical adjustments kurts = kurz and the other one Iā€™m not sure if it was a typo by @Bigfork do you really say viertal 8 and not viertel 8.
I also had to adjust the filter in the second last line from str to string

Otherwise it worked fine, I tested around 10 different examples and all of them were correct.

{% set hour = hour if minute < 8 else hour + 1 if hour + 1 < 24 else 0 %}
{% set hour = hour if hour < 13 and hour > 0 else hour - 12 if hour > 0 else 12 %}
{% set i = minute // 15 - 1 %}
{% set quarters = ['viertel', 'halb', 'dreiviertel' ] %}
{% set quarter = quarters[i] if i >= 0 else '' %}
{% set remainder = minute % 15 %}
{% set end = 'Uhr' if i == -1 and remainder in [0,1] or i == 2 and remainder == 14 else '' %}
{% set shortly = 'kurz' if remainder not in [14,0,1] else '' %}
{% if remainder == 14 %}
  {% set quarter = quarters[i+1] if i + 1 < quarters | length else '' %}
{% endif %}
{% set beforeafter = '' %}
{% if shortly %}
  {% set beforeafter = 'nach' if remainder in range(2,8) else 'vor' %}
  {% if beforeafter == 'vor' %}
    {% set quarter = quarters[i+1] if i + 1 < quarters | length else '' %}
  {% endif %}
{% endif %}
{% set items = ['Es ist', shortly, beforeafter, quarter, hour | string , end] %}
{{ items | reject('eq','') | list | join(' ') }}

Edit: I did some more tests with hours above 12 and then the outcome is wrong, as I assume @Bigfork wants to have a 12 hour clock, so 13 = 1. Itā€™s time to sleep over here, might take a look at it tomorrow to adjust this otherwise beautiful template.

Edit 2: found a solution, add the following after the first line:

{% set hour = hour if hour < 13 and hour > 0 else hour - 12 if hour > 0 else 12 %}

1 Like

Iā€™m not even German, I just live here (and like it so much I plan to stay for a long time).

1 Like

I had two make two grammatical adjustments kurts = kurz and the other one Iā€™m not sure if it was a typo by @Bigfork do you really say viertal 8 and not viertel 8 .

I noticed that too but @petro isnā€™t a German speaker so I wasnā€™t going to point out any spelling mistakes. I make enough in English and itā€™s my native tongue. The ā€œviertalā€ was my type-o. I didnā€™t spell check my spreadsheet :rofl:

1 Like

Read what I said above, researching my word clock I found out there were 22 regional variations on how to tell the time across Germany
:rofl:

What I canā€™t get my head round is (and a paraphrase here)
"How much cake do you have ? "
ā€œI have a FULL cakeā€¦ But someoneā€™s eaten half of itā€

"No, you just have ā€˜half a cakeā€™ "

But I suppose itā€™s the difference between ā€˜a glass glass half fullā€™ vs ā€˜a glass half emptyā€™

As an engineer, Iā€™d say that the glass was sub-optimally sized

Edit : so I missed out on that one as well, this time Petro stole our apples !
:rofl:
I was pulling our access area (porch, hall and two landings) wiring apart to label up for making smart :stuck_out_tongue_closed_eyes:

The only comment Iā€™d make is that it should read
Es ist dreiviertel eins
It is supposed to be a word clock after all

9/10 must try harder
:rofl:

A nice diversion, well done to all :+1:

@petro, you may need to add another column for the US as Iā€™ve often run into issues with ā€˜half pastā€™ in the US