strftime uses pythons set language which will always be english. You’ll have to take those values and pass them through a template sensor. For that, it would probably be best to take your current sensors and change them all to numerical values, then you can you strptime to convert them into your values.
i´m actually stealing a theme and this has a cool Markdown card which shows the current date. My goal is to have it in the following format (in german )
“Mittwoch, der 28. Mai”
I have no idea about templating and where to put stuff so maybe one of you could help me on this. THis is how the code currently looks:
- type: markdown
content: |
{% if now().month in (1,) %}
## {{ now().day }} Januar
{% elif now().month in (2,) %}
## {{ now().day }} Februar
{% elif now().month in (3,) %}
## {{ now().day }} März
{% elif now().month in (4,) %}
## {{ now().day }} April
{% elif now().month in (5,) %}
## {{ now().day }} Mai
{% elif now().month in (6,) %}
## {{ now().day }} Juni
{% elif now().month in (7,) %}
## {{ now().day }} Juli
{% elif now().month in (8,) %}
## {{ now().day }} August
{% elif now().month in (9,) %}
## {{ now().day }} September
{% elif now().month in (10,) %}
## {{ now().day }} Oktober
{% elif now().month in (11,) %}
## {{ now().day }} November
{% elif now().month in (12,) %}
## {{ now().day }} December
{% endif %}
style: |
ha-card {
margin: 12px 14px -5px 14px;
box-shadow: none;
--paper-card-background-color: rgba(0, 0, 0, 0.0)
}
h2 {
font-size: 18px;
font-weight: 400;
padding-left: 10px;
border-left: 3px solid rgba(81, 134, 236);
}
Sorry, but
the first example does not fix the problem. The message “Invalid date” remains.
The second example gives me not the required format. Last seen info, i.e. 45 minutes, instead of the fixed datum: %d.%m.%Y %H:%M
I want to output a sensor value in a different formatting for a notification. I get under sensor.washer_remaining_program_time a value like 2022-09-07T12:48:33+00:00 and I don`t manage to extract the time. So for example 12:48.
Is this possible or do I have to create an extra sensor for this?