I just installed Domoticz, and I want to use it to display data which I can read out from a device via JSON.
What I did:
- Create Dummy Hardware
- Create Virtual Sensor, Type "Temp", which received the ID 14051
- Create Hardware "HTTP/HTTPS poller" with custom command file.
- I created the following lua file based on the example_json.lua file
Code: Select all
-- Retrieve the request content
s = request['content'];
-- Update some devices (index are here for this example)
local temp = domoticz_applyJsonPath(s,'temp')
domoticz_updateDevice(14051,temp,'')Code: Select all
Debug: CLuaHandler (updateDevice from LUA) : idx=14051 nvalue=23.5 svalue= invalue=23 signallevel=12 batterylevel=255couldn't find any documentation on the domoticz_updateDevice() command and had to try out to find that the second parameter is the nValue and the third one is an sValue.
Does anyone have a clue what I'm doing wrong?
Thank you!