This component is actually very useful, but it slows down my system and render it unuseable. I was almost not able to delete the component.
I did only setup one average sensor with 1 day period on a entity that updates data every second. How often do it calculate the state of this sensor? Should be a variable to specify update frequency to reduce processor use.
The idea is very good and I really find it useful, bud as it is now I cannot use it.
If the duration parameter is specified, updating the sensor value occurs regularly, but no more than once every 20 seconds;
If this parameter is not specified, the sensor value is updated every time any of the sensors is updated, where the source values come from.
To reduce processor load, reducing the refresh rate of source sensors will also help.
UPD. I double-checked. There is an inaccuracy in the quoted description: this is not about the duration parameter, but about any indication of the time period.
Hi and thank you for your work and for replying so quickly
That was how I understood the description as well. Reducing refresh rate on my sensor is not an option and should not be necessary as it should be handled by the component and not by altering the source.
Maybe you could look at adding a variable for calculation frequency? It would make it much more controllable and less “risky”. As I said I like this component and find it useful, but too unpredictable.
I got the sensor up with 4 sources but 0 available.
here are the logs:
2020-06-09 21:08:00 ERROR (MainThread) [custom_components.average.sensor] Could not convert value "rainy" to float
2020-06-09 21:08:00 ERROR (MainThread) [custom_components.average.sensor] Could not convert value "cloudy" to float
2020-06-09 21:08:02 ERROR (MainThread) [custom_components.average.sensor] Could not convert value "rainy" to float
2020-06-09 21:08:02 ERROR (MainThread) [custom_components.average.sensor] Could not convert value "cloudy" to float
Compare with the min-max sensor:
This sensor in the mean mode produces exactly the same average value from several sensors. But, unlike our sensor, it cannot receive the current temperature data from a weather, climate and water heater entities.
# Example configuration.yaml entry
sensor:
- platform: average
name: 'Average Temperature'
entities:
- weather.gismeteo
- sensor.owm_temperature
- sensor.dark_sky_temperature
Clearly you haven’t read it properly.
I will rephrase it for you so maybe you can understand better what is written:
Unlike our sensor ( the average, the one i want to configure) the min max sensor cannot read directly from weather entity. The min max sensor is the one that cannot read the weather not the average. In fact in the examples there is clearly a weather entity…
On the right side are the settings applied shown above.
Why does the behaviour change? What I would like to achieve is the average temperature at 23:59 of the previous 24 hours.