Average Temperature Sensor

Really it’s up to the end user how they want to use things and requires a bit of imagination, but my thoughts are that you can use it to signify the start of warm or cool months. Here’s some that come into mind:

  • 5 day running average outside temperature above X degrees, it’s time to move the rabbit hutch into the shade.
  • 5 day running average outside temperature above/below X degrees, time to open the vents on your air conditioner/heater.
  • Long term climate control and energy management. Average temperature in your house is X degrees - this is warmer than it needs to be and you could consider lowering your heater.
3 Likes

Now I just testing the sensor - I wrote it a little more than a day ago.

Where I live, it is customary to change car tires twice a year for winter and summer tires. As a lazy person, I do not want to suffer every time the question of exactly how to do it. So I want to make a sensor that will remind me. :wink:

Absolutely. Just wanted to know how exactly the author uses his sensor(s) as there was a reason to create it, not just an vague need for something “different”…
Your thoughts are great, especially the first and the last ones… :wink:

So you have an automation that reminds you when the average temperature is above/below a certain level, or it’s something else?

Yes, I plan to have that automation, but No, I have not that automation for now — I just testing sensor… :slight_smile:

New version released. Now you able to use weather provider entities as a data sources.

An update has been released taking into account the new rules for the integration of components in Home Assistant versions 0.92+.

Unfortunately, updating through the custom-updater may not work. In this case, you need to update the component manually. In the future, automatic update will work again correctly.

What makes this sensor different from others built into HA:

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 initial temperature data from a weather object.

Compare with statistics sensor.
This sensor copes with the averaging of data over a certain period of time. However … 1) it cannot work with several sources at once (and can’t receive temperature from weather object, like min-max sensor), 2) when calculating the average, it does not take into account how much time the temperature value was kept, 3) it has a limit on the number of values ​​it averages - if by chance there are more values, they will be dropped.

I can add to this sensor ability to receive temperature data from other objects, like it receive data from weather object. Climate object, as example. Does it need to anybody?

I thought we just fill in the entities section with entities and that’s it, what else is needed to receive data?

You are right.

But this are so simple only if entities is temperature sensor.
Other entities have no so simple structure.
As example, climate entity are store many attributes, include current and target temperature.

All this special entities are process differently

well, attributes make it more difficult for sure.

in what way and does that really matter in your sensor’s context?

Special processing need special code for it. Current version of sensor are enough for me. But i can improve it if it need for others.

I wouldn’t overcomplicate it if not needed :wink:

1 Like

That post above I’ve published for future users. :wink:
Who knows what needed for them…

Of course. Will see…

Can i use this sensor to calculate average of non-temperature readings? I want to calculate average value of PM2.5 particle sensor.

Unfortunately, now the sensor only works with temperature data. If you try to use it somehow differently, it will throw errors, because It will not fade to convert the obtained values to temperature.

In the near future I will try to find the time and fix the sensor so that it understands other input data. Or, you can do it yourself and send a pull request.

UPD. Or you can use min-max sensor in mean mode. https://www.home-assistant.io/components/min_max/

Maybe this can do it…

1 Like