alverman
(Alberto)
January 14, 2020, 10:07pm
1
good evening,
why, having set hassio in Italian (in fact in the hassio configuration pages I see the text in Italian), when I show the date with
‘timestamp_custom (’%A %-d %B’)’
I see it in English?
If I use timestamp_local I see it in Italian correctly but I need to customize it !!
Why ?
Thanks, Alberto
1 Like
alverman
(Alberto)
January 15, 2020, 7:10pm
2
no solution form this question ?
Mutt
(Muttley)
January 15, 2020, 7:28pm
3
Consult finity’s EPIC time manipulation thread.
Just type epic in the search box.
What actual format do you require as a text output ?
Mutt
(Muttley)
January 15, 2020, 7:47pm
5
Yeah, you said that.
Can you give me an example of your required format ?
alverman
(Alberto)
January 15, 2020, 8:50pm
6
{{ as_timestamp(states.calendar.lavoro.attributes.start_time) | timestamp_custom('%d %A %H:%M') }}
Mutt
(Muttley)
January 15, 2020, 8:52pm
7
Sorry, an example would be : - 2020/01/15, 20:52
alverman
(Alberto)
January 15, 2020, 9:14pm
8
Sorry Mutt, but I can’t understand your request.
Shouldn’t the date or time always be displayed in the local format?
If I use
timestamp_local
I see:
2020-01-16 09:00:00
but I need to break it down into several parts to make alexa say it so I need to use timestamp_custom like:
timestamp_custom ('% A% d% B')
Thursday 16 January
but I would need it in Italian:
Giovedì 16 Gennaio
Thanks, Alberto
Mutt
(Muttley)
January 16, 2020, 12:12am
9
Ah! Now a light comes on.
Sorry, not played with that sort of thing yet.
Maybe @finity could help ?
finity
January 16, 2020, 12:18am
10
Nope. I’ve got nothing on how to make sure that Alexa says the dates in a different language.
I don’t believe that’s a timestamp issue but instead an Alexa issue.
Mutt
(Muttley)
January 16, 2020, 12:58am
11
Yeah, I thought as much, but can you get “Thursday 12th January” maybe he can work from there.
finity
January 16, 2020, 1:04am
12
Mutt:
“Thursday 12th January”
the “Thursday” & “January” are easy.
I don’t see a directive that returns the “12th ” (the th is the issue).
As far as I know from my notes he is already using the correct directives to return the locales time (which should be in the correct language for that locale). Unless he has some other thing wrong with his configuration that doesn’t know it should be returning Italian instead of English. ??
Mutt
(Muttley)
January 16, 2020, 1:13am
13
Yep, got that but how about a macro in a template that in 1,21,31 gives st - 2,22 gives nd - 3,23 gives rd else th? Or will we need petro ?
That would be useful on its own (but specific to English) though from the example, easily modified
finity
January 16, 2020, 1:18am
14
I’m sure it would be possible to come up with something (maybe tomorrow…gotta sleep sometime…I’d like to think… ) but I still think the right answer is to figure out why the locale is wrong in the first place as opposed to trying to template around the issue.
petro
(Petro)
January 16, 2020, 1:22am
15
it requires setting the python installation to Italian. Which the dev’s will not do. Gotta convert the days and text yourself. Super annoying but it is what it is.
FYI the now object has these attributres and you don’t need to convert them to a timestamp.
- service: tts.google_say
data_template:
entity_id:
- media_player.camera_da_letto
message: >
{% set giorno = ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"] %}
{% set mese = ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"] %}
{% set giorno_della_settimana = gio…
2 Likes
Mutt
(Muttley)
January 16, 2020, 1:34am
16
An interesting read all on its own.
Many thanks.
I tried to bookmark, this and nearly flagged it instead. Oooooops
Edit, you weren’t tagged so I guess your ears must have been burning