time variable?

Post Reply
Posts: 93
Joined: Wednesday 28 January 2015 18:58
Target OS: Raspberry Pi
Domoticz version:

time variable?

Post by micksel » Sunday 28 May 2017 8:37

Hi everyone,
I would like to create something like this,

If power < 1w and nobodyhome=true and this has been like this for 5 min then
set switch of 300 min

Is this possible in blocky?

User avatar
Posts: 2715
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: Beta
Location: Beitem, BE

Re: time variable?

Post by Egregius » Sunday 28 May 2017 9:04

I suggest you look at the possible script languages like lua, php, shell, python,... Then everything is possible.

User avatar
Posts: 269
Joined: Monday 23 February 2015 13:45
Target OS: Windows
Domoticz version: 3.4834
Location: Netherlands

Re: time variable?

Post by mrf68 » Sunday 28 May 2017 11:11

Hi micksel,

as far as I know there's no Blockly component like "otherdevices_lastupdate" in LUA. But you can create your own timer. I'll show you an example:

I created a user variable with the name "teller" and the variable type = "Integer". I used an existing switch "OnOff 2" and created the following Blockly:
blocklytimer.jpg (136.1 KiB) Viewed 710 times
When the switch is Off, the "teller" will increase every minute untill it reaches "5". When the switch is On, it will set the "teller" to "0". There is one catch: status will only change on the full minute. So when the switch turns On at 13:42:02 and it turns Off at 13:42:56, the script will not set the "teller" to "0". And at exactly midnight (= 00:00) it will not do anything. ;)

Maybe this info helps a little.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest