But this is displaying in the template editor (and the markdown card) as Monday August 8, instead of 9. Locale is set correctly (Europe/Zurich) in the UI and Windows 10 system time/date is also correct. Where else can I look to correct this?
Seems like a parser issue getting the 8/9 wrong, but I’ve no idea where else to troubleshoot. Ideas?
A long time ago, users were advised to avoid using the now() function in a template because it would not make the template update itself every minute. The recommendation was to use sensor.date_time or one of its variants (like sensor.date_time_iso or sensor.time).
That advice was withdrawn many versions ago when the now() function became a first-class citizen in templates (it causes the template to be evaluated every minute, on the minute). If you wish, your template can now be written like this:
That very same admonition did have me confused – my code has a mixture of now() and sensor.date_time, though I’d never really understood why both seemed to work perfectly well. Appreciate the education and will shift to consistent use of now()!