in domoticz in a Lua script I can retrieve the last update data for a variable or a device:
Code: Select all
updTime = uservariables_lastupdate['xxx']
updTime = otherdevices_lastupdate['yyy']
It's possible?
Many thanks.
Moderator: leecollings
Code: Select all
updTime = uservariables_lastupdate['xxx']
updTime = otherdevices_lastupdate['yyy']
Code: Select all
json = (loadfile "/home/pi/domoticz/scripts/lua/JSON.lua")()
local config=assert(io.popen('curl http://192.168.0.1:8080/json.htm?type=scenes'))
local location = config:read('*all')
config:close()
local jsonLocation = json:decode(location)
--retrieve the data from idx 1
for i, singleScene in ipairs(jsonLocation.result) do
if (singleScene.idx == '1') then
lastUpdateScene = singleScene.LastUpdate
end
end
Users browsing this forum: No registered users and 1 guest