domoticz.time.hour question

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

Moderator: leecollings

Post Reply
kroonp
Posts: 43
Joined: Friday 17 July 2020 11:03
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

domoticz.time.hour question

Post by kroonp »

A question from a beginner.

This works:

Code: Select all

 if (domoticz.time.hour > 11 and domoticz.time.hour < 12) then
But how can i this working?

Code: Select all

 if (domoticz.time.hour > 11:15  and domoticz.time.hour < 12:20) then
Thanks,
Peter
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: domoticz.time.hour question

Post by waaren »

kroonp wrote: Sunday 19 July 2020 22:41 This works:

Code: Select all

if (domoticz.time.hour > 11 and domoticz.time.hour < 12) then
It will work but it will never evaluate to true. dz.time.hour is an integer and there are no integers between 11 and 12.

But how can i this working?

Code: Select all

 if (domoticz.time.hour > 11:15  and domoticz.time.hour < 12:20) then

Code: Select all

if domoticz.time.matchesRule('at 11:15-12:19') then
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest