Just a small thing I made for own use, might be useful for somebody else.
This plugin calculates a daily average of a specified temperature sensor. It also calculates (weighted) degree days values for heating and cooling, these are often used in energy optimization projects. Furthermore it stores a daily high and low temperature.
If the day changes, yesterdays averages and other values are stored in separate variables so that they can be used or exported.
The code of version 1.1 is attached and free to use and modify, please let me know if you find this useful, have any questions or find any bugs.
- Initial release
Version 1.1 changes (submitted for approval 22-nov-2013):
- Weighting factors for calculation of degree days are now configurable.
- New variables added for tracking daily high and daily low temperatures.
Device ID of the temperature sensor that you would like an daily average of (ie. 121)
Poll timer of the temperature sensor. Standard (and minimal) value 60 seconds. Valid values between 60 and 7200. Value 0 disables refresh.
Variables Child device:
Last calculated average (rounded to one decimal)
Highest temperature value recorded today
Lowest temperature value recorded today
Reference temperature for calculation of heating degree days. Often 18 degrees is used (and this is the standard value) but it is also possible to use an other value or Fahrenheit.
Weighting factor for degree days calculation. If left untouched or if a month is not configured it defaults to 1.0
For example: [tt]1=1.1,2=1.1,4=0.8,5=0.8,6=0.8,7=0.8,8=0.8,9=0.8,11=1.1,12=1.1[/tt]
This string gives the weighting factors of plugin version 1.0 and configures the weighting factors as follows:
Nov, Dec, Jan, Feb => 1.1
Apr, Jun, Jul, Aug, Sep => 0.8
Mar, Oct are not specified so their weighting factor will default to 1.0
Same as degreeDaysHeatReferenceTemp but then for cooling. 22 degrees is standard value.
Same as degreeDaysHeatWeightingFactor but then for cooling.
Five variables that store yesterdays day average