I have successfully created a statistics sensor for some temperature data. However I now want to display the max & min values so I used a template to extract the relevant data. But it’s not working. This is what I’ve got:
However both greenhouse_temp_min and greenhouse_temp_max are saying “Unknown” despite having values when I examine the “Greenhouse Stats” entity. There’s no errors/warnings in the logs concerning these entities.
I’m sure there’s some simple config error here I’m not seeing.
OK, so I cut it down to just one section in the template and it works without the _mean. So added the second one, and now that works as well. I have no idea why it didn’t work before.
I’m happy that it’s working properly, and thank you for your interest. But it’s frustrating that I followed what I could find in the manual and on the forum without any luck. Presumably something has changed in the last few years.
It used to create sensor.object_id_mean as the sensor entity id. It was changed to drop the _mean a few releases ago but the state is still the mean value. So if you saw an example somewhere it could be out of date.