This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Trend Log functions question
#1
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:

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
Reply


Messages In This Thread
Trend Log functions question - by iJAF - 05.07.2022, 16:24
RE: Trend Log functions question - by admin - 06.07.2022, 08:59
RE: Trend Log functions question - by iJAF - 06.07.2022, 10:43

Forum Jump: