Timer between time/day and time day doesn't work

Moderator: leecollings

Post Reply
Ray-Man
Posts: 29
Joined: Friday 12 December 2014 19:03
Target OS: Linux
Domoticz version: 2021.1
Location: Zwolle
Contact:

Timer between time/day and time day doesn't work

Post by Ray-Man »

Version: 2021.1 (build 13203)
Build Hash: ab7a7bba3
Compile Date: 2021-04-19 12:38:14
dzVents Version: 3.1.7
Python Version: 3.8.5 (default, Jan 27 2021, 15:41:15) [GCC 9.3.0]

Hello all,

since the latest stable update (2021.1) the dz.time.matchesRule doesn't seem to work:

The code

Code: Select all

dz.time.matchesRule('between '..T01STARTTIJDOFFSET..' on '..T01STARTDAGOFFSET..' and '..T01STOPTIJDOFFSET..' on '..T01STOPDAGOFFSET) == true
which is

Code: Select all

between 7:30 on mon and 23:29 on mon
gives a false although it should be true (at the moment).

Updated to latest beta (build 13203) has no effect.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Timer between time/day and time day doesn't work

Post by waaren »

Ray-Man wrote: Monday 19 April 2021 15:40 since the latest stable update (2021.1) the dz.time.matchesRule doesn't seem to work:

Code: Select all

between 7:30 on mon and 23:29 on mon
Can you change the rule to "at 7:30-23:29 on mon" ?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Ray-Man
Posts: 29
Joined: Friday 12 December 2014 19:03
Target OS: Linux
Domoticz version: 2021.1
Location: Zwolle
Contact:

Re: Timer between time/day and time day doesn't work

Post by Ray-Man »

Yes, that works.

Problem with that solution (I understand it is part of the troubleshooting) is that the second date/time could be after midnight. E.g: between 7:30 on mon and 0:30 on tue. And I don't know how to make that work with 'at'.

Tried at 7:30 on mon and 23:29 on mon -> not working
Tried at 7:30 on mon-23:29 on mon -> not working
Ray-Man
Posts: 29
Joined: Friday 12 December 2014 19:03
Target OS: Linux
Domoticz version: 2021.1
Location: Zwolle
Contact:

Re: Timer between time/day and time day doesn't work

Post by Ray-Man »

Changed some parameters and I am now testing with 'at 7:30-0:29 on mon' which is working.

Question: does DzVents know that if the stop time is smaller then the start time, the stop day should be the next day and not the same as the starting day?
In other words: is 'at 7:30-0:29 on mon' the same as 'between 7:30 on mon and 0:29 on tue'?

If so, I have to make some changes in numerous scripts, but I can live with that... ;)
Last edited by Ray-Man on Monday 19 April 2021 17:08, edited 1 time in total.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Timer between time/day and time day doesn't work

Post by waaren »

Ray-Man wrote: Monday 19 April 2021 16:33 Problem with that solution is that the second date/time could be after midnight. E.g: between 7:30 on mon and 0:30 on tue. And I don't know how to make that work with 'at'.
You will have to use a combination of two rules for that

Code: Select all

if dz.time.matchesRule('at 7:30-23:59 on mon') or dz.time.matchesRule('at 00:00-00:30 on tue') 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