Hey,
I am trying to get an entity, that gives me the daily average of energy consumption of the past week.
I searched a lot and found many articles, but not one helped me especially in this case
I have an entity for power consumption and need to build and entity, that gives me the value of power consumption exactly 7 days ago from now (no defined time)
So I could calculate the difference between the value of 7 days ago and the actual to get the consumption of the last 7 days at total.
EDIT: my previous answer here did not fit, because I realized you might mean something else. First, make sure we’re on the same page on power vs energy. They are different things, but you use both words as if they mean the same.
Are we talking kWh values, or kW? kWh makes more sense, but is a bit harder. That is because the day value is only fully known the day after. So you want to average one kWh usage value per day, seven days, always counting from yesterday?
You also ask for the day value 7 days ago (I assume the same weekday as today) - that is something different. Also note that day is part of the average, because the average cannot make use of consumption for today.
Can I ask what you mean to accomplish by comparing these values? There may be easier ways to reach the goal.