HistoricState at specific point in time


I would like to check the sum of rain (from Netatmo) for the whole day yesterday.
So something like:
rain_yest_tmp = Netatmo_Rain_Sum.historicState(yesterday.23:59).state as DecimalType

This doesn’t work and I tried before:
rain_yest_tmp = Netatmo_Rain_Sum.historicState(now.minusDays(1)).state as DecimalType

The latter obviously returns the value of the Netatmp_Rain_Sum 24 hrs ago, but I would like to get the final Sum at 23:59 (there’s a reset at 12 am).

A short suggestion is greatly appreciated.

You are close.


rain_yest_tmp = Netatmo_Rain_Sum.historicState(now.minusDays(1).withTime(23,59,59,59)).state as DecimalType
1 Like

Hi @g_g_rich,

thanks a lot!
I’ll give it a try!