first of all, great work. I'm diving into Dzvents and am getting the hang of it. Still a beginner, so be easy on me
A strange thing occures when I use Historical variables API. Let me explain.
For a barometer, which reports to Domoticz, I want to calculate a forecast. The barometer doens't give these values and Domoticz doesn't calculate them by itself (as far as I know of, correct me if I'm wrong please).
To calculate I need the data of the last 180 minutes, getting new data every minute.
Then I want to calculate the average of 5 readings at 180 minutes and 5 readings at the moment. These values will be used to forecast. The historical variable would be perfect for it, because it shifts in new and shifts out old data.
However, it looks like the array is limited to 100 records. Once the script stored the 100 values, it just shifts out the old at (100) and enters new at (1).
Is this correct? Is the maxItems limited to 100? And is there a reason for it? Should I solve it differenlty?
Code: Select all
data = {
BaroPressure = {
history = true,
maxItems = 185
}
},Code: Select all
2017-07-18 21:38:00.449 dzVents: Info: ------ Start internal script: Combine_Barometer:, trigger: every 1 minutes
2017-07-18 21:38:00.487 dzVents: Info: Average BaroPressure: 1016.07 hPa
2017-07-18 21:38:00.487 dzVents: Info: Average BaroPressure: 101.607 kPa
2017-07-18 21:38:00.487 dzVents: Info: Average last 5 minutes: 101.6 kPa
2017-07-18 21:38:00.487 dzVents: Info: BaroPressure 1: 1016
2017-07-18 21:38:00.487 dzVents: Info: BaroPressure 2: 1016
2017-07-18 21:38:00.487 dzVents: Info: BaroPressure 3: 1016
2017-07-18 21:38:00.487 dzVents: Info: BaroPressure 4: 1016
2017-07-18 21:38:00.488 dzVents: Info: BaroPressure 5: 1016
2017-07-18 21:38:00.488 dzVents: Info: BaroPressure 6: 1016
2017-07-18 21:38:00.488 dzVents: Info: BaroPressure 7: 1016
2017-07-18 21:38:00.488 dzVents: Info: BaroPressure 8: 1016
2017-07-18 21:38:00.488 dzVents: Info: BaroPressure 9: 1016
2017-07-18 21:38:00.488 dzVents: Info: BaroPressure 10: 1016
2017-07-18 21:38:00.488 dzVents: Info: Size of history: 100
2017-07-18 21:38:00.488 dzVents: Info: Forecast: 0
2017-07-18 21:38:00.494 dzVents: Info: ------ Finished Combine_Barometer