How to translate an attribute to local day and month for automations?

I would like to send a notification (and Google Home TTS) with translated days and months from the meteoalarm sensor “onset” and “expires” attributes. Right now, I’m sending a notification with timestamp_custom (e.g. Thu 13 or Jun 13) but it’s in English and I would like to have it translated into Slovak. This is how it looks like in attributes right now 2019-06-13T13:00:00+00:00

How do I translate it?

use a filter for this.
For example, {{state_attr("entity_domain.entity_name","last_updated") | timestamp_custom("%H:%M")}}
This page will give you the options for different display:

I want to translate names of months or days. I can display it but it’s in English.

Actually my previous template was not correct.
Here is an example you can use and adapt:

{% set month=["Jan","Feb","Mar","Apr","May","Jun", "Jul", "Aug","Sept","Oct","Nov","Dec"] %}

{{month[as_timestamp(state_attr("automation.all_lights_off", "last_triggered")) | timestamp_custom("%m", true) | int -1]}}

Thank you, that works! And how could I make it with weekdays? I’ve tried changing month to day and %m to %a but it shows only the last variable, in this case Sunday.

Here’s another example for you (translate months and weekdays):

Thank you, I was able to translate months and weekdays but how to use it with entity attributes in an automation?

Ok, I’ve figured it out. I should use %w instead of %a. Here’s my full translate of sensor attributes.

  {% set day = ["Nedeľa", "Pondelok", "Utorok", "Streda", "Štvrtok", "Piatok", "Sobota"] %}
{{day[as_timestamp(state_attr('binary_sensor.meteoalarm', 'onset')) | timestamp_custom('%w', true) | int ]}}

Is there any reason the day_setting variable is included in that solution?

You’re right, thanks! :slight_smile: I was editing an example you shared and it worked anyway. But it works without the variable as well. I’ve edited the answer.