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.

Reading trends from RRD in Lua
#14
Please update library, This should work:

Code:
require('user.trends_pro')

-- Export data
name = 'Kitchen_Temperature'
dates = {}
dates['start'] = { year=2017, month=4, day=5, hour=0}
dates['end'] = "now"

name, csv = trend_export(name, dates, 'csv')

-- Send an email with data
attachement = { {filename=name .. '.csv', filedata=csv, mimetype='text/csv'} }
mailattach('example@gmail.com', 'Report from trend ' .. name, 'CSV file attached', attachement)

script.disable(_SCRIPTNAME)

The result is mail with csv which has such content:

Attached Files Thumbnail(s)
   
Reply


Messages In This Thread
Reading trends from RRD in Lua - by buuuudzik - 06.04.2017, 16:53
RE: Reading trends from RRD in Lua - by buuuudzik - 25.02.2018, 11:46
RE: Reading trends from RRD in Lua - by iJAF - 07.07.2022, 17:09

Forum Jump: