time variable?

Moderator: leecollings

Post Reply
micksel
Posts: 50
Joined: Wednesday 28 January 2015 17:58
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

time variable?

Post by micksel »

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: 2582
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: time variable?

Post by Egregius »

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

Re: time variable?

Post by mrf68 »

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 989 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