Page 1 of 1

How to know the last update data for Scene?

Posted: Tuesday 07 March 2017 10:09
by bigpea
Hi all,
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']
But I don't know if is possible to know the last update data for a scene.
It's possible?

Many thanks.

Re: How to know the last update data for Scene?

Posted: Tuesday 07 March 2017 12:37
by jvdz
No it isn't possible as a Group or Scene is just a set of Devices with an accompanying action.

Jos

Re: How to know the last update data for Scene?

Posted: Tuesday 07 March 2017 14:25
by bigpea
Ok thanks,
you are right.

I retrieved the data from the json:

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