GithubHelp home page GithubHelp logo

Comments (4)

Limych avatar Limych commented on May 31, 2024 1

The principle of specifying the duration parameter is uniform across multiple components in HA. It is always a single, inseparable period of time. If you and I begin to invent a new meaning for it, we will get a huge confusion in the minds of users. And this is very bad.

The only way that I see for solving your problem is to make two levels of calculation. In the first one, calculate the average value for the required period of the current day, and with the second sensor, calculate the average value of the average values for the week.

# Example configuration.yaml entry
sensor:
  - platform: average
    name: 'Daily Average Temperature During Sun'
    start: '{{ now().replace(hour=19).replace(minute=0).replace(second=0) }}'
    duration:
       hours: 20
    entities:
      - sensor.temperature_measurement

  - platform: average
    name: 'Average Temperature During Sun'
    duration:
       days: 5
    entities:
      - sensor.daily_average_temperature_during_sun

from ha-average.

AceoStar avatar AceoStar commented on May 31, 2024

Good point! I'll give that a shot. I never thought about averaging the average sensors. :D

from ha-average.

AceoStar avatar AceoStar commented on May 31, 2024

This seems to be working well. I don't know if there's a good way to inspect the values that are recorded to "test" the calculation, but it looks right at a glance. Thanks again for the help!

from ha-average.

github-actions avatar github-actions commented on May 31, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from ha-average.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.