domoticz.time.minute exist?

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
TheCondor
Posts: 78
Joined: Thursday 18 June 2015 10:32
Target OS: Linux
Domoticz version:
Contact:

domoticz.time.minute exist?

Post by TheCondor »

Hi, i've an old and working script which opens gradually the blinds every morning in 3 step but i want to optimize. Considering that in the time trigger i've that:

Code: Select all

   on = {
        timer = {
            'at 22:30',
            'at 7:45',
            'at 8:45'
            },
now i need an 'if' statement build in this way:

if domoticz.time.hour is 7 AND DOMOTICZ.TIME.MINUTE IS 45 then
open blind at level 20
elseif domoticz.time.hour is 8 AND DOMOTICZ.TIME.MINUTE IS 00 then
open blind at level 40
elseif domoticz.time.hour is 8 AND DOMOTICZ.TIME.MINUTE IS 15 then
open blind at elevel 100



i've tried but domoticz.time.minute seems to not exist in dzvents, correct?
Thanks in advance.
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: domoticz.time.minute exist?

Post by dannybloe »

It should be

Code: Select all

domoticz.time.minutes
(plural). See the docs :-). Same as hours and seconds.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: domoticz.time.minute exist?

Post by waaren »

TheCondor wrote: Sunday 26 August 2018 11:20
if domoticz.time.hour is 7 AND DOMOTICZ.TIME.MINUTE IS 45 then
open blind at level 20
elseif domoticz.time.hour is 8 AND DOMOTICZ.TIME.MINUTE IS 00 then
open blind at level 40
elseif domoticz.time.hour is 8 AND DOMOTICZ.TIME.MINUTE IS 15 then
open blind at level 100
i've tried but domoticz.time.minute seems to not exist in dzvents, correct?
Lua and dzVents are case sensitive and to check the minutes use domoticz.time.minutes (plural also for seconds but not for hour)
You can also use

Code: Select all

 if domoticz.time.matchesRule('at 7:45') then
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
TheCondor
Posts: 78
Joined: Thursday 18 June 2015 10:32
Target OS: Linux
Domoticz version:
Contact:

Re: domoticz.time.minute exist?

Post by TheCondor »

Thanks both! I used match timing forn now. That's will help to male more simple and interactive my script.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest