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.

Data from http request - to JSON - to KNX
#3
(21.03.2018, 18:21)Erwin van der Zwart Wrote: Hi,

Try something like this:
Code:
require('socket.http')
require('json')

socket.http.TIMEOUT = 15

data, code = socket.http.request('http://10.0.0.xxx/output.json')

if data then
 data = json.pdecode(data)
end

if data then
 CurrentSummationDelivered = data['0015BC001B024257'].CurrentSummationDelivered
 InstantaneousDemand = data['0015BC001B024257'].InstantaneousDemand
 grp.update('1/1/1', tonumber(CurrentSummationDelivered))
 grp.update('1/1/2', tonumber(InstantaneousDemand))
end
BR,

Erwin

Something tells me that I am forgetting something? No action on the KNX-bus. (Picture attached)

Attached Files Thumbnail(s)
   
Reply


Messages In This Thread
RE: Data from http request - to JSON - to KNX - by Rune - 21.03.2018, 19:20

Forum Jump: