lazloman
(Lorenzo THurman)
June 9, 2021, 10:00pm
1
I’m trying format a time, but there is no change to the formatting.
type: entities
entities:
- entity: light.porch_light_2
type: custom:multiple-entity-row
secondary_info: >-
Last OFF: {{ state_attr('automation.turn_off_outside_lights',
'last_triggered') | timestamp_custom('%H:%M') }}
title: Second
state_color: true![Screen Shot 2021-06-09 at 4.53.03 PM|690x233](upload://iNdy8Ti5btblTmCEN4URDbBA3oG.jpeg)
Any ideas?
lazloman
(Lorenzo THurman)
June 9, 2021, 10:37pm
2
I figured it out. I’m get a string back from the state_attr call, not a date object. That string has to be parsed into a date and only then can be formatted:
type: entities
entities:
- entity: light.porch_light_2
type: custom:multiple-entity-row
secondary_info: >-
Last OFF: {{ state_attr('automation.turn_off_outside_lights',
'last_triggered').strftime('%Y-%m-%d %H:%M:%S') }}
title: Second
state_color: true