Comparing average value of days 1-7 and the average value of days 8-14 of a sensor

Im trying to take data from my scale to average my weight over the past seven days and compare it to the average weights of the past 8-14 days. I figure the easiest way to do this would be to have sensor A that calculates the average of sun-sat and then a dummy sensor that gets set to Sensor A at 1159 Saturday so Sunday to Saturday the previous week’s change can be seen. I want it to be a rolling comparison though every day any ideas for me.

SQL Sensor


Use a trigger-based template sensor to store the history and do the math.

awesome ty so much gives me another docker to set up