17.06.2022, 12:57
(This post was last modified: 17.06.2022, 12:59 by Trond Hoyem.)
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:
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