How to access historical sensor data?
Posted: Thursday 11 June 2020 14:54
Hi,
I'm slowly starting to learn DzVents and using it for extra functions, but run into questions on how to solve things.
So now, this is my situation:
I have built a DzVents script that needs to calculate the average power from my Solar-system every minute, over the last 3 or 5 minutes, to activate or stop the charging my car.
I have got this working by storing the values of the Domoticz Electricity device in a (global) persistent variable with history, and then use the "avgSince" function to get the average. That works fine.
However: I was wondering: the Domoticz Electricity Device is already logging the history of the actual power in the Domoticz database. It therefore seems redundant to store the (short term) history as wel in the DzVents persistent variable.
Is there a way to get the historic values of the Electricity Device from the Domoticz database in DzVents for use in the avgSince calculation? I couldn't find that in the documentation or in this forum.
I'm slowly starting to learn DzVents and using it for extra functions, but run into questions on how to solve things.
So now, this is my situation:
I have built a DzVents script that needs to calculate the average power from my Solar-system every minute, over the last 3 or 5 minutes, to activate or stop the charging my car.
I have got this working by storing the values of the Domoticz Electricity device in a (global) persistent variable with history, and then use the "avgSince" function to get the average. That works fine.
However: I was wondering: the Domoticz Electricity Device is already logging the history of the actual power in the Domoticz database. It therefore seems redundant to store the (short term) history as wel in the DzVents persistent variable.
Is there a way to get the historic values of the Electricity Device from the Domoticz database in DzVents for use in the avgSince calculation? I couldn't find that in the documentation or in this forum.