Stuck on undefined strftime markdown error

Trying to setup Smart Home Junkies RSS feeder. I’m stuck on this line in a markdown card causing a UndefinedError: ‘None’ has no attribute ‘strftime’

({{ as_datetime(states(‘input_datetime.newsitem_date’)).strftime(‘%d-%m-%Y %H:%M:%S’) }}) - [Open link]({{ states(‘input_text.newsitem_link’) }})

I’m sure I’m missing something silly. Thanks for any leads!

what do you get if you go to dev-tools->template and put this in:

{{ states('input_datetime.newsitem_date') }}

that error most likely means this datetime helper isn’t resolving to a datetime …

total guess. i wonder if you had meant newitem_date instead of newsitem_date?

My test:

{{ states('input_datetime.test_datetime') }}
{{ as_datetime(states('input_datetime.test_datetime')) }}
{{ as_datetime(states('input_datetime.test_datetime')).strftime('%d-%m-%Y %H:%M:%S') }}

Assume I made a typo in the entity’s name or defined a non-existing entity in lines 1-2:

In this case I will get same error “‘None’ has no attribute ‘strftime’” if I wrongly type an entity_id in the 3rd line.