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

Daily load consumption? #208

Open
elektrinis opened this issue Nov 12, 2023 · 11 comments
Open

Daily load consumption? #208

elektrinis opened this issue Nov 12, 2023 · 11 comments

Comments

@elektrinis
Copy link

We have daily import and export, daily battery charge and discharge, daily PV generation... One thing I can't find is daily load consumption, basically I have no idea how much my house has consumed daily and overall?
I would love to have this number so I could list all other consumers and see what's missing. This should look awesome on Sankey card.
example-energy

@mkaiser
Copy link
Owner

mkaiser commented Nov 12, 2023

Integrated it some days ago :)

Check

- name: Daily consumed energy

image

@mkaiser
Copy link
Owner

mkaiser commented Nov 12, 2023

How many energy meters do you have installed? looks very fine-grained :)

@dylan09
Copy link
Contributor

dylan09 commented Nov 13, 2023

Integrated it some days ago :)

Check

- name: Daily consumed energy

Is the sensor Daily consumed energy working without spikes? When displaying as graph I have a lot of spikes. I think they are related to timing issues when they are delivered by modulus integration.
I have changed it to a trigger template. Time pattern. Calculated every 55 seconds. Since I have changed this, they are mostly gone.

Looks like this. And this sample only shows small spikes. Sometimes they was very heavy.
Bildschirmfoto 2023-11-13 um 14 16 01

@mkaiser
Copy link
Owner

mkaiser commented Nov 13, 2023

in my installation it does "ripple" a bit too. Additionally I had an "undershoot" at midnight.

image

I guess we can overcome this by using a lopass filter:

https://www.home-assistant.io/integrations/filter/#low-pass

    filters:
      - filter: outlier
        window_size: 4
        radius: 4.0
      - filter: lowpass
        time_constant: 10
        precision: 2

(values are from the HA doc, did not test or change)

The energy sensors are read every 10min.
So maybe a large window size would be good

I am not at home at the moment. Could someone test?

@dylan09
Copy link
Contributor

dylan09 commented Nov 13, 2023

I have added a new filtered sensor to test If filtering will work.

@dylan09
Copy link
Contributor

dylan09 commented Nov 16, 2023

As expected. The filter will smooth to much.
I tried:

  filters:
    - filter: outlier
      window_size: 4
      radius: 4.0
    - filter: lowpass
      time_constant: 5
      precision: 2

First the graph without the filter (I use a time_pattern trigger every 55 seconds.
Bildschirmfoto 2023-11-16 um 20 06 05

Second the graph from sensor with filter applied:
Bildschirmfoto 2023-11-16 um 20 06 50

@mastameista
Copy link
Contributor

mastameista commented Dec 19, 2023

I have some log entries (level warning) from recorder integration:

Logger: homeassistant.components.sensor.recorder
Source: components/sensor/recorder.py:288
Integration: Sensor ([documentation](https://www.home-assistant.io/integrations/sensor), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+sensor%22))
First occurred: 12:15:10 PM (1 occurrences)
Last logged: 12:15:10 PM
Entity sensor.daily_consumed_energy from integration template has state class total_increasing, but its state is not strictly increasing. Triggered by state 17 (18.0) with last_updated set to 2023-12-19T11:12:36.581022+00:00. 

The time relates to a point at the "ripple".

image

And I also have some "underruns" almost every night.

@mkaiser
Copy link
Owner

mkaiser commented Dec 19, 2023

oh, almost forgot this issue ;)

I tried another filter, which seems promising.

Add a new sensor section above the existing template: section

sensor:
  - platform: filter
    name: "Daily consumed energy (filtered)"
    entity_id: sensor.daily_consumed_energy
    filters:
      - filter: time_simple_moving_average
        window_size: "00:05"
        precision: 2

# 'virtual' template sensors for better readability
template:

image

Can someone with "some sun" confirm? Over the last dark days I had only around 1 kWh/day yield....

@dylan09
Copy link
Contributor

dylan09 commented Dec 20, 2023

Put it on my list for next year. Currently no sun also. I think my test will start mid of january.

@mastameista
Copy link
Contributor

@mkaiser Thx! I've added the new sensor. We had some nice sunny days this week but now its bad weather until Monday. Will update here after some measuring in the next weeks.

@mastameista
Copy link
Contributor

mastameista commented Jan 19, 2024

@mkaiser
Filtered version looks good! There's just one "glitch" I can't explain. But it's definitely not systematic anymore. and i don't have negative / below zero values anymore :)

image

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

4 participants