Hello!
I'm doing time relays on sonoff th 16 and espeasy v2.0-20180126
I can not check the time via systime and syshour variables
Rules example:
on Clock#Time do
if %syshour% >= 22
SendToHTTP 192.168.1.100,80,/check?%syshour%
endif
endon
Log:
2602213 : ACT : SendToHTTP 192.168.1.100,80,/check?10
As we see in log - now is 10 hours
But "if" condition return 'true' ...
It's my mistake ( why ? ) or espeasy problem ?
The %systime% compare also problems to work ...
if %systime% >= 22:05:00 - compare return false at 22:05 ...
Michael
rules problems with %systime% and %syshour%
Moderators: grovkillen, Stuntteam, TD-er
Re: rules problems with %systime% and %syshour%
In my opinion, you can't use >= ! Instead use >21.
Re: rules problems with %systime% and %syshour%
Thanks!
Can you look to my systime problem too ?
Here is "strong" "large" compare:
Rules:
on Clock#Time do
if %systime% > 10:36:00
SendToHTTP 192.168.1.100,80,/check?%syshour%
endif
endon
Time from main page:
Local Time: 2018-02-25 10:37:54
Log:
4341761 : EVENT: Clock#Time=Sun,10:38
10:38 is greater than 10:36
But SendToHTTP not executed.
Is 10:36 in compare must be "localtime" or gmt ?
When i change 10:36 at rules example to 7:36 - it's work, but i'm afraid to use it ...
Can you look to my systime problem too ?
Here is "strong" "large" compare:
Rules:
on Clock#Time do
if %systime% > 10:36:00
SendToHTTP 192.168.1.100,80,/check?%syshour%
endif
endon
Time from main page:
Local Time: 2018-02-25 10:37:54
Log:
4341761 : EVENT: Clock#Time=Sun,10:38
10:38 is greater than 10:36
But SendToHTTP not executed.
Is 10:36 in compare must be "localtime" or gmt ?
When i change 10:36 at rules example to 7:36 - it's work, but i'm afraid to use it ...
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: rules problems with %systime% and %syshour%
The rules engine doesn't compute systime mathematically. I'd use this instead:
Maybe put that as a dummy value and do the logics test on that.
Code: Select all
(%syshour% * 10 + %sysmin%)
Maybe put that as a dummy value and do the logics test on that.
Re: rules problems with %systime% and %syshour%
1 syshour * 60 + sysmin to avoid collisions ?
2 rules tutorial https://www.letscontrolit.com/wiki/inde ... rial_Rules example for systime
If %systime% > 19:00:00
Gpio,16,1
Endif
my example is a copy example above ...
2 rules tutorial https://www.letscontrolit.com/wiki/inde ... rial_Rules example for systime
If %systime% > 19:00:00
Gpio,16,1
Endif
my example is a copy example above ...
Re: rules problems with %systime% and %syshour%
if %syshour% * 60 + %sysmin% > 520 // 8-40
SendToHTTP 192.168.1.100,80,/check?%syshour%
endif
also does not work for me
what may be wrong with sys(time|hour|min) calculation
SendToHTTP 192.168.1.100,80,/check?%syshour%
endif
also does not work for me
what may be wrong with sys(time|hour|min) calculation
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: rules problems with %systime% and %syshour%
That should have read :grovkillen wrote: ↑25 Feb 2018, 09:06 The rules engine doesn't compute systime mathematically. I'd use this instead:
Code: Select all
(%syshour% * 10 + %sysmin%)
Maybe put that as a dummy value and do the logics test on that.
Code: Select all
(%syshour% * 100 + %sysmin%)
Code: Select all
(10*100+32) =1032
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Who is online
Users browsing this forum: No registered users and 41 guests