How to know the last update data for Scene?

Moderator: leecollings

Post Reply
bigpea
Posts: 91
Joined: Thursday 11 August 2016 12:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: IT
Contact:

How to know the last update data for Scene?

Post 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.
User avatar
jvdz
Posts: 2334
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

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

Post by jvdz »

No it isn't possible as a Group or Scene is just a set of Devices with an accompanying action.

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
bigpea
Posts: 91
Joined: Thursday 11 August 2016 12:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: IT
Contact:

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

Post 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
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest