It runs a HTTP server that responds with:
Code: Select all
<current>
<light value="630"/>
<co2 value="238"/>
<temp value="25.70"/>
<presure value="103239"/>
</current>
Code: Select all
s = request['content'];
local light = domoticz_applyXPath(s,'//current/light/@value')
local co2 = domoticz_applyXPath(s,'//current/co2/@value')
local temp = domoticz_applyXPath(s,'//current/temp/@value')
local presure = domoticz_applyXPath(s,'//current/pressure/@value')
domoticz_updateDevice(2988507,'',light .. ";" .. co2 .. ";0;" .. temp .. ";0;" .. presure .. ";0")
Code: Select all
2016-11-30 00:03:45.346 CLuaHandler (updateDevice from LUA) : idx=2988507 nvalue= svalue=624;241;0;25.70;0;103246;0 invalue=0 signallevel=12 batterylevel=255
624 = lightsensor
241 = CO2
25.70 = temp
103246 = presure