Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculate Mean Consumption from Hourly data #33

Open
reox opened this issue Dec 27, 2022 · 4 comments
Open

Calculate Mean Consumption from Hourly data #33

reox opened this issue Dec 27, 2022 · 4 comments

Comments

@reox
Copy link
Collaborator

reox commented Dec 27, 2022

Crosspost from https://community.home-assistant.io/t/create-daily-monthly-yearly-reports-for-energy-consumption/476352/2

This is a question related to #20 maybe someone has an idea...
I tried to get a mean value for the daily consumption as a UI panel. However, I can not select Mean in the statistic panel.
Maybe that is because I do not import the correct data into the statistics table? Do I have to use the mean as well? But what use is a hourly mean when I want the mean consumption per day of, say the last year?
Anyone has an idea how this could work? Does it work at all?

@reox
Copy link
Collaborator Author

reox commented Dec 27, 2022

Maybe https://community.home-assistant.io/t/total-average-daily-power-consumption/449095 solves this, I have setup an utility_meter now, but it looks like it needs some days to get the values and check if it will show a daily average.

I just fear that it will not work, because the last day is always imported in the night. And using another time for the reset will cause the meter to give averages between these times.... I think that HA is not made to do a lot of these calculations, with values from the past...

edit: the utility meter can possibly not work, because the sensor entity itself has no state, but we store only the statistics data...

@reox
Copy link
Collaborator Author

reox commented Dec 28, 2022

Yes, as suspected, the utility meter does not work when the sensor itself has no state. It stays at zero all the time. :/

@TheRealVira
Copy link
Contributor

Hey @reox I have added an utility meter locally to display "daily usage", which pretty much works except when WN reports nothing/0;

image

Utility Meter config:

{ 
    "entry_id": "REDACTED",
    "version": 1,
    "domain": "utility meter",
    "title": "Energy",
    "data": {},
    "options": { 
        "name": "Energy",
        "source": "sensor.REDACTED",
        "cycle": "daily",
        "offset": 0.0,
        "tariffs": [],
        "net_consumption": true,
        "delta_values": false 
}

Today I added a new filter sensor to my configuration.yaml, which should get rid of all 0 values afaik:

sensor:
  - platform: filter
    name: "energy_filtered"
    entity_id: sensor.energy
    filters:
      - filter: lowpass

And with this in place I should be able to set up statistics with correct daily usage data. I will follow up as soon as it fetches new values.

@reox
Copy link
Collaborator Author

reox commented Jan 22, 2023

@TheRealVira interesting! I tried also the utility meter and did not get it to work. Are you using the statistics branch or main? Maybe the problem is just that it does not work in combination with the statistics...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants