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.

Help to read html code
#14
Finally I can do it, but not trough modbus, because when I inserted new modbus device, the software ask for the IP and one port. I don't had idea what port wibeee uses for this task.
So, searching info on the manual I founded that wibeee can answer to html request for one item.
With this info, I have used the scrip from @Erwin van der Zwart and modify to request only for the items I wanted.
This is the final script:
Code:
require('socket.http')
socket.http.TIMEOUT = 5
pact = socket.http.request('http://192.168.1.238/services/user/values.xml?var=WIBEEE.pact')
i1 = socket.http.request('http://192.168.1.238/services/user/values.xml?var=WIBEEE.irms1')
en = socket.http.request('http://192.168.1.238/services/user/values.xml?var=WIBEEE.eac1')

-- Check if response value is received
if pact then
      p_activa = pact:match([[<value>(.-)</value>]])
      p_activa = tonumber(string.trim(string.gsub(p_activa, "W", "", 1)))
      grp.write('32/3/1', p_activa)
end
 
if i1 then
    int_f1 = i1:match([[<value>(.-)</value>]])
      int_f1 = tonumber(string.trim(string.gsub(int_f1, "W", "", 1)))
    grp.write('32/3/2', int_f1)
end

if en then
  energia = en:match([[<value>(.-)</value>]])
  energia = tonumber(string.trim(string.gsub(energia, "W", "", 1)))
  grp.write('32/3/3', energia)
end

I launch it every 5 minutes, and works pretty well  Rolleyes

Thanks to all, for the help.
Reply


Messages In This Thread
Help to read html code - by peyoe - 21.11.2019, 22:13
RE: Help to read html code - by peyoe - 22.11.2019, 08:01
RE: Help to read html code - by admin - 22.11.2019, 08:04
RE: Help to read html code - by peyoe - 22.11.2019, 08:35
RE: Help to read html code - by admin - 22.11.2019, 09:03
RE: Help to read html code - by peyoe - 22.11.2019, 09:30
RE: Help to read html code - by Daniel - 22.11.2019, 09:57
RE: Help to read html code - by peyoe - 22.11.2019, 10:22
RE: Help to read html code - by peyoe - 22.11.2019, 15:07
RE: Help to read html code - by Daniel - 22.11.2019, 15:15
RE: Help to read html code - by peyoe - 22.11.2019, 15:30
RE: Help to read html code - by peyoe - 25.11.2019, 12:30
RE: Help to read html code - by Joep - 14.12.2019, 15:09

Forum Jump: