i tested the code that you posted, the list says when i use for example %A for the weekday he takes my selected language in HA, but he always make the weekday english, my language is german.
this gives me the day as number, i think this is needed for the days variable. (its one day to much but i think i can adjust it with -1 because he counts from 0)
I tried my best knowledge, I don’t want to let anyone do the work for me here, or annoy me. but I needed the missing hint, what I just don’t know I can’t conjure up. that’s how you learn. I think that’s what the forum is for. nevertheless thank you very much
Wrap the sensor’s entity_id in quotes (without the quotes it’s handled as the name of an undefined variable) and remove device_class: timestamp (a timestamp sensor’s value must contain the date and time and this template is only providing the time).
I would like to use the format-tag for weekkday (%A) but HA shows only the en_US names and not the de_DE names. The UI is configured in gernman and I do not understand, why the weekday names are in english.
Home Assistant’s templating language is English and doesn’t support the operating system’s locale. That means strftime produce day and month names exclusively in English.
You’ll have to perform the translation yourself. For example:
I don’t know if this is the right thread to ask this question, but I am having seemingly a timezone issue with timedelta calculation.
I am trying to calculate the remaining printing time by calculating the time delta between now and the
{% set done = as_timestamp(states("sensor.octoprint_estimated_finish_time")) %}
{% set current = now().timestamp() %}
{% set delta = done - current %}
Estimated finishing point is {{ done | timestamp_custom("%H:%M:%S")}} # 15:09:00
Current time is {{ now().timestamp() | timestamp_custom("%H:%M:%S") }} # 15:08:00
The delta between them is {{ delta | timestamp_custom("%H:%M:%S")}} # # 01:01:00
I can see, that the timezone of my current time and the sensor are correct (UTC+1).
But how do I get the formatter to use the UTC-timezone now, since it only describes the timedelta and no timezone?