ciao,
let's recap all the stuff....
I have a uservariable updated by a dzVents script, the variable is called PRESENTE (actually it counts the BLE devices discovered in the house)
I have a timer script that evaluates it:
if its values is setted to 0 more than 10 minutes ago then switch off lights
I would not use the .switchOff.afterMins(10) beacuse the command cannot be cancelled
the variable is updated by anothe device dzvents script that calculates it.
so... in a typical scenario I could have the variable at its state:

- Variabile PRESENTE
- varPRESENTE.jpg (3.93 KiB) Viewed 2430 times
(as you see the lastupdate is 2017-10-06 10:13:53... more or less 26 minutes ago)
I created a simple dzVents script to dump the value:
Code: Select all
return {
on = {
variables = {
'NUT_*'
}
},
execute = function(dz, var)
dz.log('Variable '..var.name..' was changed since '..var.lastUpdate.minutesAgo , dz.LOG_FORCE)
dz.log('Variable PRESENTE'..' was changed since '..dz.variables('PRESENTE').lastUpdate.minutesAgo , dz.LOG_FORCE)
end
}
(the trigger is another variable just to compare)
the log show
2017-10-06 10:36:33.265 dzVents: !Info: Variable NUT_Marco was changed since 30
2017-10-06 10:36:33.265 dzVents: !Info: Variable PRESENT E was changed since 168
...well... both variables are wrongly calculated... NUT_Marco should be 0 (it was the trigger), and PRESENTE would be 26...
thanks for your patience
ciao
M