25.11.2019, 12:30
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:
I launch it every 5 minutes, and works pretty well
Thanks to all, for the help.
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
Thanks to all, for the help.