Aside from the technical aspects, I would not hold my family members accountable for energy usage within these limits on a daily basis. These are purely theoretical limits derived from average usage for an average family with an average temperature.
For most families, gas usage is mainly determined by heating requirements. Cooking and hot water is just a small part of the gas usage. So, as an example, on a cold day, when temperatures are below long term averages, you daily usage will most certainly be higher than the theoretical table value, no matter how long the shower time is.
If you want to create a more realistic value out if it, you should take the actual measured average temperature and use that as a correction factor to the table value, similar to the concept of degreedays. You probably could indeed use degreedays directly as a correction factor (have a look at mindergas.nl or calculate it in domoticz). Even then I would work with averages (running averages) before being to harsh on the family members
Below is my code for degreeday calculation in domoticz. Note it takes as input some values from other scripts: it takes the gas used for heating from a gas classification usage script, and it takes sum of temperatures and number of temperature measurements to calculate an average temperature from a temperature tracking script.
Code: Select all
return {
on = {
timer = { 'at 23:53' }
},
logging = {
level = domoticz.LOG_INFO,
marker = 'degree day calc',
},
execute = function(domoticz)
-- idx numbers need to be adjusted for new installation
-- idx of devices
local idxSumDayTemp=37
local idxNumDayTemp=38
local idxAvgDayTemp=40
local idxGasP1=2
local idxDegreesBelow18Counter=96
local idxDegreeDaysCounter=97
local idxRealHeatingGas=87 -- from gas classification script
local idxRealGasPerDegreeDay=90
local sumTemp= domoticz.devices(idxSumDayTemp).sensorValue
local numTemp= domoticz.devices(idxNumDayTemp).sensorValue
local avgTemp=domoticz.utils.round(sumTemp/numTemp,1)
local DegreesBelow18=0
local DegreeDay=0
local GasPerDegreeDay=0
if avgTemp < 18 then
print ('below 18')
DegreesBelow18 = 18 - avgTemp
month = os.date("%m")
local degreeday_weight = 0
if month == "01" then degreeday_weight = 1.1 end
if month == "02" then degreeday_weight = 1.1 end
if month == "03" then degreeday_weight = 1.0 end
if month == "04" then degreeday_weight = 0.8 end
if month == "05" then degreeday_weight = 0.8 end
if month == "06" then degreeday_weight = 0.8 end
if month == "07" then degreeday_weight = 0.8 end
if month == "08" then degreeday_weight = 0.8 end
if month == "09" then degreeday_weight = 0.8 end
if month == "10" then degreeday_weight = 1.0 end
if month == "11" then degreeday_weight = 1.1 end
if month == "12" then degreeday_weight = 1.1 end
DegreeDay = domoticz.utils.round(DegreesBelow18 * degreeday_weight,1)
end
domoticz.devices(idxAvgDayTemp).updateTemperature(avgTemp)
domoticz.devices(idxSumDayTemp).updateCustomSensor(0)
domoticz.devices(idxNumDayTemp).updateCustomSensor(0)
-- degreeday with heating gas from gas classification script
local previousCounter=0
local divider=10
previousCounter=domoticz.devices(idxDegreesBelow18Counter).counter
domoticz.devices(idxDegreesBelow18Counter).updateCounter(DegreesBelow18*divider + previousCounter*divider)
previousCounter=domoticz.devices(idxDegreeDaysCounter).counter
domoticz.devices(idxDegreeDaysCounter).updateCounter(DegreeDay*divider + previousCounter*divider)
domoticz.log('DegreesBelow18 = ' .. DegreesBelow18 .. ' ', domoticz.LOG_INFO)
domoticz.log('DegreeDays = ' .. DegreeDay .. ' ', domoticz.LOG_INFO)
domoticz.log('DegreesBelow18Counter = ' .. DegreesBelow18*divider + previousCounter*divider .. ' ', domoticz.LOG_INFO)
domoticz.log('DegreeDaysCounter = ' .. DegreeDay*divider + previousCounter*divider .. ' ', domoticz.LOG_INFO)
local RealHeatingGas=domoticz.devices(idxRealHeatingGas).counterToday
local RealGasPerDegreeDay=domoticz.utils.round(RealHeatingGas/DegreeDay,3)
previousGCounter=domoticz.devices(idxRealGasPerDegreeDay).counter
domoticz.log('RealHeatingGas = ' .. RealHeatingGas .. ' ', domoticz.LOG_INFO)
domoticz.log('RealGasPerDegreeDay = ' .. RealGasPerDegreeDay .. ' ', domoticz.LOG_INFO)
domoticz.log('previousGCounter = ' .. previousGCounter .. ' ', domoticz.LOG_INFO)
domoticz.devices(idxRealGasPerDegreeDay).updateCounter(RealGasPerDegreeDay*1000+previousGCounter*1000)
end
}