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!
#1
Hi everyone, I have a little trouble, hope everyone can help
I want to get the value of Trend logs to put into a specific address. for example 1.1.1 and 1.1.2, how do I do it. Here I want to get the value of 2.03kwh and 1.47kwh into 1.1.1 and 1.1.2
If anyone can help, I would be very grateful! Smile

Attached Files Thumbnail(s)
   
Reply
#2
https://kb.logicmachine.net/libraries/trends/
Reply
#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


Forum Jump: