GithubHelp home page GithubHelp logo

Comments (10)

paolo-ermit avatar paolo-ermit commented on May 30, 2024 1

I'm having the same problem.
When a sensor becomes unavailable, the average value is wrong, considering the value as 0 instead of ignoring it

from ha-average.

xstrex avatar xstrex commented on May 30, 2024

Came here to report this; I now have millions of logs from this component because it can't find the average for an unknown or unavailable entity id.

from ha-average.

TTLucian avatar TTLucian commented on May 30, 2024

Hi. Even though in the documentation is stated that: "By default, undefined values are not included in the average calculation" upon HA core restart i get low and zero values:
image

I believe this happens because the availability of the sensors. It also causes issues with other entities that use the average sensor as input:
image

from ha-average.

drogfild avatar drogfild commented on May 30, 2024

For me it seems that this started when I updated HA from 2021.12.2 to 2021.12.8. At least for me this hasn't happened before that upgrade. Upgraded Average to 2.2.1 didn't help.

image

  - platform: average
    name: 'Average Temperature House'
    unique_id: __legacy__
    duration:
      minutes: 30
    entities:
      - sensor.kitchen_ble_temperature
      - sensor.guestroom_ble_temperature
      - sensor.livingroom_ble_temperature
      - sensor.xiaomi_temp_childrensroom_temperature

As you can see from the picture all entities are between 20.9 and 22.6, and still average is 16.26. One of those sensors is offline since 10:10. But that big drop happened at 11:05.

I would assume that one sensor would be ruled out as it has happened before. Could you please check into this?

Edit:
Added second average to verify my findings. Second average is with same setup but without livingroom_ble_temperature sensor. All other details are same, except this one calculates average without that one failed sensor. This one calculates average correctly. So ruling out bad sensors doesn't work as it supposed to.
image

from ha-average.

drogfild avatar drogfild commented on May 30, 2024

Any update on this one? I'm currently using built-in mean calculation instead of this, because it can handle missing values just fine. But it obviously isn't as versatile as this. And it doesn't calculate average during some time period. That's why I would like to use this component instead.

from ha-average.

lmagyar avatar lmagyar commented on May 30, 2024

I think the restart related part of this issue is related to #98. Though I wasn't able to figure out the root cause.

from ha-average.

xarly avatar xarly commented on May 30, 2024

Same here, I see problem still open

from ha-average.

Melkor82 avatar Melkor82 commented on May 30, 2024

I switched to the native HA average sensor in the helpers page. It is behaving as supposed

from ha-average.

lmagyar avatar lmagyar commented on May 30, 2024

Though the built-in HA integrations behave differently, eg. they go unavailable immediately after the sensor goes unavailable (eg. WiFi outage), and generic_thermostat will not change state on unavailable temperature.

In my case I've added a wrapper sensor to get a default value for the thermostat, and I use the built-in filter (average) integration sensor to draw graphs (without the jumps to the default temperature). See: https://community.home-assistant.io/t/average-sensor/111674/154

from ha-average.

JoryHogeveen avatar JoryHogeveen commented on May 30, 2024

Same issue here, an undefined value drops the average.

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.