Hi,
I have data from a Photovoltaic Solar PowerPlant energy production already in Trends.
I'm trying to make a script to send an email with a CSV with the production from each day per each row of the CSV at the end of each month.
I have it already sending a CSV with a row for each 30min directly from trends (30min resolution) with the trend_export function.
My question is about changing from 30min per row to each day per row.
I'm trying now directly with the trend log functions:
If I set the resolution like this, will it calculate the correct value for each day?
EDIT: if used this way the values doesn't make much sense.
One more thing, in the visualization, if I export multiple trends to CSV I get each variable in each column. (see attachment)
Any way to do this via scripting in order to send via email ?
Thank you
I have data from a Photovoltaic Solar PowerPlant energy production already in Trends.
I'm trying to make a script to send an email with a CSV with the production from each day per each row of the CSV at the end of each month.
I have it already sending a CSV with a row for each 30min directly from trends (30min resolution) with the trend_export function.
My question is about changing from 30min per row to each day per row.
I'm trying now directly with the trend log functions:
Code:
require('trends')
-- will fetch data between 2016.04.15 00:00 and 2016.04.16 00:00
dates = {
['start'] = { year = 2022, month = 6, day = 1 },
['end'] = { year = 2022, month = 7, day = 1 },
}
-- fetch current value
day = trends.fetch('PV Total Energy', dates)
csv = table.concat(day, '\r\n')
If I set the resolution like this, will it calculate the correct value for each day?
Code:
day = trends.fetch('PV Total Energy', dates, 86400)
EDIT: if used this way the values doesn't make much sense.
One more thing, in the visualization, if I export multiple trends to CSV I get each variable in each column. (see attachment)
Any way to do this via scripting in order to send via email ?
Thank you