22.11.2019, 00:06
(This post was last modified: 22.11.2019, 00:07 by Erwin van der Zwart.)
Hi,
Try this:
BR,
Erwin
Try this:
Code:
require('socket.http')
socket.http.TIMEOUT = 5
data = socket.http.request('http://192.168.1.238/en/phase1.html')
-- Check if response value is received
if data then
-- Fetch values from HTTP response
p_activa = data:match([[<td id="p_activa">(.-)</td>]])
-- Remove units and trims leading and trailing spaces and decode to numberic
p_activa = tonumber(string.trim(string.gsub(p_activa, "W", "", 1)))
-- Write to KMX
grp.write('1/1/1', p_activa)
end
Erwin