Running version 0.64.3 of HASS.IO, and I have a sensor that is reporting back in UTC date time. I would like to convert this to a custom local display β ideally accounting for daylight saving.
The original code for the template with an unformated time is,
- platform: template sensors: lounge_motion_updated: friendly_name: Lounge last movement detected value_template: "{{states.sensor.lounge_motion_sensor.attributes.last_updated}}"
I have used the Template Editor to try a number of different formats. They donβt return an error, but donβt return the expected result either. No matter what I try most return the same UTC date time.
For example,
{{states.sensor.lounge_motion_sensor.attributes.last_updated }}
returns [β2018-03-06β, β04:17:28β]. So does the following three lines,
{{states.sensor.lounge_motion_sensor.attributes.last_updated | timestamp_local }}
{{states.sensor.lounge_motion_sensor.attributes.last_updated | timestamp_custom(β%a:%d:%B:%H:%M:%pβ) }}
{{states.sensor.lounge_motion_sensor.attributes.last_updated | timestamp_custom(β%I:%M %pβ) }}
But,
{{states.sensor.lounge_motion_sensor.attributes.last_updated | timestamp_local(β%I:%M %pβ) }}
returns nothing.
I figure if I canβt get the right result in the Template Editor it wonβt matter about the configuration file entries. Is there something stupid I am doing wrong with the format??