I have searched all over but can’t find exactly what I am looking for here. I have an input helper for a single date. Let’s call it lastDate. So input_datetime.lastDate. I manually update this field. I would like to have another sensor that is the average time between the date values. For example, if the current value is 3/21/24 and the previous value was 3/19/24 and before that 3/15/24. I would want the AverageLength sensor to have the value of 3. Every time a new value is set for lastDate. I would want the average length to update. For example, if the next value is 3/30/24, then the new AverageLength would be 7.
I have tried several things but everything is either based on the date of the value change or is not an available statistic. Any help would be appreciated!