Please help with template for last motion

That works for me too. Funky. But you’re using your fakestate [[[ JavaScript ]]] to format the data.

I’ll rephrase. This thread started off talking about making a card that showed the last time any sensor was triggered, though formatted in a particular way, then you proposed a YAML template to format week, day, hour, min, sec right? That’s all pretty clear.

Then Alex posts that he got this working and shows an example like this, i.e. two different sensors each displaying their own formatted last_triggered, presumably via the YAML template.
image

The implication, as I read it, was that he used that generic template to somehow pass in a sensor name and output the fomatted last_triggered time for each sensor individually, not just one card with the name and last_triggered of the last sensor that called the automation, but multiple sensors on individual rows.

That’s the bit that stumps me… I feel like I’ve got that completely wrong and he just used JavaScript (much like your fakestate example) on a custom card like button-card (though not sure how he laid it out horizontally like that) and didn’t use the YAML template at all?

Maybe the question is, can you use a YAML template to format the label on custom cards or do you need to use JavaScript? If not, what was the point of writing the template? Was it only for that initial use case of showing the last sensor that triggered?