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.

Get data from Trend logs!
#3
Thank so much! Pro, i will try it ! Smile):
I have read the link you sent, I have tried the code like this. But it does not give the desired result, can you help me? I want to get these 2 values 2.03 and 1.47kwh
Thank so much everyone !
------------------------
require('trends')

-- fetch data for the previous day
dates = {}
dates['start'] = os.date('*t')
dates['start'].day = dates['start'].day - 1
dates['end'] = os.date('*t')
-----------
dates1 = {}
dates1['start'] = os.date('*t')
dates1['start'].day = dates['start'].day - 2
dates1['end'] = os.date('*t')
-- fetch current value
day = trends.fetchone('Đo điện tầng 3', dates)
day1 = trends.fetchone('Đo điện tầng 3', dates1)
grp.write('1/1/1', day)
grp.write('1/1/2', day1)
------------------------
Reply


Messages In This Thread
Get data from Trend logs! - by phongvucba - 08.03.2025, 02:42
RE: Get data from Trend logs! - by phongvucba - 10.03.2025, 02:41

Forum Jump: