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.

Trends API
#17
Hi

I am using a somewhat minimized version of this script. I have used it many times before, but today it wont work. I get the error 'Host not found'. I was thinking it was because I had set the IP address and password wrong in my first attempt, but no... still after changing, it did not work. Any idea where to look for errors?

I have the script in a Wiser FW 2.7.0 it that is important...

My script is this one:

Code:
require('json')
require('socket.url')
require('socket.http')

-- parameters
daily = 365*24*60 -- 1 day
daily1year = 365*24*12 -- 365 day
daily2year = 2*365*24*12 -- 365 day
year5_d = 5*365 -- 5 year
tag = 'nyNyTrend'

obj = grp.tag(tag)


for _, addr in ipairs(obj) do

  object = addr.address
  alias = addr.name

  trend = {
    object = knxlib.encodega(object), -- object id in db
    name = alias, -- trend name
    type = trend_type,
    resolution = 5, -- every 5 minute
    precision = 2, -- floating point precision
    count_resolution = 365*24*12, -- 1 year
    count_daily = 5*365 -- 5 years
  }

  data = json.encode(trend)
  post = 'data=' .. socket.url.escape(data)
  grp.removetags(addr.name, tag)

  res, err = socket.http.request('http://admin:qSHs5FAcfY@HRdn@192.168.68.249/scada-main/trends/save', post)
  log(res, err)

end




script.disable(_SCRIPTNAME)
There are 10 kinds of people in the world; those who can read binary and those who don't  Cool
Reply


Messages In This Thread
Trends API - by buuuudzik - 28.05.2016, 16:52
RE: Trends API - by Habib - 28.05.2016, 17:13
RE: Trends API - by Erwin van der Zwart - 28.05.2016, 22:01
RE: Trends API - by admin - 29.05.2016, 06:12
RE: Trends API - by buuuudzik - 29.05.2016, 11:22
RE: Trends API - by Erwin van der Zwart - 02.09.2016, 18:46
RE: Trends API - by admin - 05.09.2016, 06:01
RE: Trends API - by Erwin van der Zwart - 05.09.2016, 09:29
RE: Trends API - by Pawel - 07.12.2016, 20:15
RE: Trends API - by Domoticatorino - 19.02.2018, 15:39
RE: Trends API - by Erwin van der Zwart - 19.02.2018, 16:32
RE: Trends API - by Domoticatorino - 13.02.2018, 16:52
RE: Trends API - by Daniel - 13.02.2018, 18:49
RE: Trends API - by Domoticatorino - 19.02.2018, 16:33
RE: Trends API - by PassivPluss - 17.09.2019, 21:10
RE: Trends API - by admin - 24.09.2019, 06:53
RE: Trends API - by Trond Hoyem - 17.06.2022, 12:57
RE: Trends API - by admin - 17.06.2022, 13:20
RE: Trends API - by Trond Hoyem - 17.06.2022, 13:23
RE: Trends API - by admin - 17.06.2022, 13:23
RE: Trends API - by Trond Hoyem - 17.06.2022, 13:27
RE: Trends API - by admin - 17.06.2022, 13:30
RE: Trends API - by Trond Hoyem - 17.06.2022, 13:33
RE: Trends API - by admin - 17.06.2022, 13:34
RE: Trends API - by Trond Hoyem - 17.06.2022, 13:36
RE: Trends API - by admin - 17.06.2022, 14:15
RE: Trends API - by Trond Hoyem - 17.06.2022, 14:26
RE: Trends API - by admin - 17.06.2022, 14:32

Forum Jump: