I want to show a time stamp in my front end, when a certain script has been recently triggered.
script.__my_script_name__.attributes.last_triggered
delivers a time string with timezone offset information like
2019-03-30T17:07:26.035306+00:00
I want to convert this string into a more readable format with the help of strftime or strptime and write it to an input_text field.
- service: input_text.set_value
entity_id: input_text.last_reset_motion_count_einfahrt
data_template:
value: '{{ (script.reset_motion_counter_einfahrt.attributes.last_triggered).strftime("%A %d %b %H:%M") }}'
does not work.
Has anybody a hint for me, how to code the value part in order to receive a formatted timestring?