Page 1 of 1

timer device and helpers

Posted: Thursday 06 June 2019 12:40
by poudenes
Hi All,

Is it possible to have a timer that get his value from a helper of value stored in global_data?

Code: Select all

devices = {[SwitchTEST]    = { 'at daytime'}},
timer = {'at daytime'},
global_data

Code: Select all

Dag                     = { 'at daytime'}
Nacht                   = { 'at nighttime'}
I want change this. When I need to test some script that are activate only on day or night. I can switch the values in global_data and then everything is reverse from day to night and vs.

Re: timer device and helpers  [Solved]

Posted: Thursday 06 June 2019 14:51
by waaren
poudenes wrote: Thursday 06 June 2019 12:40 Is it possible to have a timer that get his value from a helper of value stored in global_data?
Not directly because domoticz.helpers is not there yet when time is evaluated. Indirect you can get true or false but that will still not enable you to switch around day- and nighttime. Quickest working option I can think of is (in <domoticz dir>/dzVents.runtime/Time.lua) switch lines

Code: Select all

747       if (string.find(rule, 'at nighttime')) then
and

Code: Select all

755        if (string.find(rule, 'at daytime')) then

Re: timer device and helpers

Posted: Thursday 06 June 2019 14:53
by poudenes
Thanks. I will try that solution!