But this value will the ‘raw’ state string (eg new_moon, waxing_crescent etc). Is it possible to load the translated value (eg from .translations/sensor.[lang].json) for use within these template fields?
It’s obviously possible to re-code a conditional statement into the value_template (eg if new_moon then print X) but that’s duplicating existing code plus it’s infeasible to support all the various translations
So is the translated state string available in some manner? Thanks!
There is still no answer for this? I have searched and still couldn’t find a solution that didn’t involve programming the translation like @davidjb said… Feels like unnecessary work since HA already knows the translations…
Looks like this is now possible using… {{ state_translated('sensor.moon') }}
…instead of… {{ state('sensor.moon') }}
Unfortunately this only translates text states, but it does not change the locale of numeric states, i.e. it does not convert 10.23 to 10,23 in German.
It’s been over 4 years. Is there an update to this?
I’d like to get the relative time of an entities last state change from a template like I see it in the ui