• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule executed at wrong time
#1
Hello community,

I just made my first config with pilight, but I don't understand, why the following rule was executed at a wrong time:

Rule
Code:
"sw02_kinderzimmer_eg_02": {
                        "rule": "IF (sunsetdev.sunset == DATE_FORMAT(DATE_ADD(currentdatetime, RANDOM(95, 115) MINUTE), \"%Y-%m-%d %H:%M:%S\", %H.%M)) AND Switch02.state IS off AND currentdatetime.second == 0 THEN switch DEVICE Switch02 TO on FOR RANDOM(70,110) MINUTE AND sendmail SUBJECT Licht Kinderzimmer EG MESSAGE Regel aktiviert TO me@mydomain.com",
                        "active": 1
                },

My Device for sunset/sunrise is:

Code:
"sunsetdev": {
                        "protocol": [ "sunriseset" ],
                        "id": [{
                                "longitude": 10.499216,
                                "latitude": 48.856102
                        }],
                        "sunrise": 7.09,
                        "sunset": 17.55,
                        "sun": "set"
                },

In Web-GUI sunset and sunrise is diplayed correctly. pilight Version is v7.0

But: at 16:11, the rule was executed. Why?
Sunset was at 17:55, so the switch should not be switched on before 19:25...

Whats wrong?

Regards
 
Reply
#2
Have you checked what how the rule is parsed by running pilight in debug mode?
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  puzzled by syntax when using RANDOM time Emiks5 4 866 03-04-2020, 10:57 PM
Last Post: Emiks5
  Rule triggers twice Thorben653 13 2,020 02-05-2020, 01:06 PM
Last Post: VicktorKopf
  Exclude Weekend from a rule PT-Biker 1 573 12-08-2019, 10:22 AM
Last Post: curlymo
  [Solved] On and Off for one device in one rule Oliver 3 657 10-28-2019, 06:55 PM
Last Post: Oliver
  [solved] sunset rule doesn't work fleisch 4 671 10-26-2019, 07:05 AM
Last Post: fleisch
  Rule with&without device. One working not the other... Tamadite 9 1,740 07-24-2018, 08:55 AM
Last Post: curlymo
  rule executed once at start up segalion 3 917 07-12-2018, 05:28 PM
Last Post: curlymo
  Problem with executing bash script via rule/program dYna 1 1,214 02-15-2018, 09:06 PM
Last Post: dYna
  Rule Sunset works, Sunrise not apartmedia 1 1,346 12-05-2017, 07:09 PM
Last Post: apartmedia
  Problem with a Rule for a One Button Switch martin-dj 1 1,503 03-06-2017, 12:01 PM
Last Post: pilino1234

Forum Jump:


Browsing: 1 Guest(s)