Python script defined sensor not usable in template?

Hi,
I use a python script (home-assistant-config/jours_feries.py at 5d79a90310a25055a75d7a3a3e8357b6db9fe4d2 · papo-o/home-assistant-config · GitHub) that computes values daily and publish them has sensors. I can see them in the UI nicely.

I am trying now to use one of these value in template in order to send a notification to the companion app but it does not work.

If I test this template in the developper tools, I get “unknown” instead of the correct value.

{{ states("sensor.saint_du_jour") }}

Do you think it is a bug in homeassistant template or core or I miss something in my template expression ?

Thanks for your help,

Works for me

I assume you didn’t forgot to call the python_script.jours_feries service to actually populate the sensor values?

Thanks for your test.

I did nothing and after one night it worked…

Strange but no bug there so that’s cool.