(17.05.2020, 11:52)Erwin van der Zwart Wrote: Hi,
Yes you can, you have seen the script for fetching the values from a trend, combine it with this script and modify the sql queries and you have what you need, it’s just a matter of creating a script with the samples you have..
BR,
Erwin
Thanks Erwin, it's difficult for me because I'm not a programmer but I'll try
I did a test fetching values from a trend with the next code:
Code:
require('trends')
name = 'testswitch'
dates = {}
dates['start'] = { year = 2020, month = 5, day = 17 }
dates['end'] = { year = 2020, month = 5, day = 18 }
-- resolution (in seconds) is optional
-- default trend resolution is used when not set
resolution = nil
res = trends.fetch(name, dates, resolution)
log(res)
but I have an error when I run script: