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.

AP Systems EZ1-M integration
#2
Hi

Here is a code

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

local ip = "192.168.1.100" -- Replace with the actual IP
local url = "http://" .. ip .. ":8050/getOutputData"

local resp = http.request(url)

--log(resp)

resp = json.pdecode(resp)
--log(resp)

if( type(resp) == 'table' ) then
  log(resp.data)
  grp.checkwrite('1/1/1', resp.data.p1) -- power channel 1
  grp.checkwrite('1/1/2', resp.data.p2) -- power channel 2
  grp.checkwrite('1/1/3', resp.data.e1) -- Energy generation after startup - Channel 1 . Unit kWh
  grp.checkwrite('1/1/4', resp.data.e2) -- Energy generation after startup - Channel 2 . Unit kWh
  grp.checkwrite('1/1/5', resp.data.te1) -- Energy generation lifetime - Channel 1 . Unit kWh.
  grp.checkwrite('1/1/6', resp.data.te2) -- Energy generation lifetime - Channel 2 . Unit kWh.
end
Reply


Messages In This Thread
AP Systems EZ1-M integration - by Sral1987 - 10.02.2025, 14:04
RE: AP Systems EZ1-M integration - by RomansP - 10.02.2025, 15:02

Forum Jump: