time variable?

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

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
Egregius
Posts: 2416
Joined: Thursday 09 April 2015 12:19
Target OS: Raspberry Pi
Domoticz version: BetaRPi2
Location: Beitem, BE
Contact:

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
mrf68
Posts: 222
Joined: Monday 23 February 2015 13:45
Target OS: Windows
Domoticz version: 3.4834
Location: Netherlands
Contact:

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
blocklytimer.jpg (136.1 KiB) Viewed 480 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.
----------
3x RPi
1x W2k12 (vm)
3x RFXcom433e
1x Razberry board
KAKU: 9x APA3-1500R, 2x ACDB-7000C, 3x AMST-606, 1x APIR-2150, 1x AWS-3500, 1x ATMT-502
Z-wave: 8x Everspring AN145
Misc: 2x wireless doorbells

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest