Current light level compared to past 14 days at the same time of day

I’d like to compare a current measurement (e.g. light level, but also of interest: temperature) to the past ~14 days, as I want to know if it’s brighter/darker than “usual” at this time of day. How would I solve that?

One use case is controlling the blinds. Currently they react to the weather sensor (is it sunny or cloudy?), but for my geographical region the data isn’t useful. But if I’d know that its darker than usual, I’d know that it’s cloudy – and if it’s brighter than in the past 14 days at this time of day, then it’s certainly sunny.

Thanks for all your ideas!