Need help with data template

Well you set r to the literal string {{ state_attr(timername, 'remaining') ~ '-0000' }}. And then yea when you asked it to parse the date time value out it yelled at you because that string is definitely not a timestamp.

I think you meant to do this to set r?

{% set r = state_attr(timername, 'remaining') ~ '-0000' %} 

Just get rid of the extra double brackets and quotes in there, it makes sense otherwise.

Also just an FYI you can just put data. You haven’t needed to use data_template to use a template for about 2 years (since this 2020 WTH)

1 Like