i want to read the value from a server and display that value in Domotiqz
if i sned this command with forefox: http://172.16.100.207:8080/rest/v1/real ... /DP_665943
i got the response :
{
"name" : "Buiten Temperatuur",
"value" : 9.0,
"type" : "Numeric",
"path" : "/",
"time" : 1542295853053,
"xid" : "DP_665943",
"deviceName" : "Boiler",
"renderedValue" : "9.0 °C",
"unit" : "",
"status" : "ok"
}
I used this example modified it in de lua folder:
Code: Select all
-- Example of JSON parser handling data with the following structure
--{
-- "id": 13,
-- "name": "outside",
-- "temperature": 12.50,
-- "tags": ["France", "winter"]
--}
-- A test with curl would be : curl -X POST -d "@test.json" 'http://192.168.1.17:8080/json.htm?type=command¶m=udevices&script=example_json.lua'
-- Retrieve the request content
s = request['content'];
-- Update some devices (index are here for this example)
local id = domoticz_applyJsonPath(s,'.30')
local s = domoticz_applyJsonPath(s,'.value')
domoticz_updateDevice(30,'',s)

in the log from domotiqz i got this error:
018-11-15 16:50:05.930 Error: CLuaHandler (updateDevice from LUA) : Incorrect parameters type
2018-11-15 16:50:08.507 Error: CLuaHandler (applyJsonPath from LUA) : Invalid Json data received
2018-11-15 16:50:08.507 Error: CLuaHandler (applyJsonPath from LUA) : Invalid Json data received
Dont know what i am doing wrong
another question how do i see what the http poller receives
tia
Sprokkie