• 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
Infinite loop on sunrise rule caused by currentdatetime
#1
Does anybody else face the same issue? I did not change anything in my configuration.
It happens since the update from 8.1.1 to 8.1.2
Rules and devices are configured according to the manual. Worked well since 7.0.
 
Reply
#2
Can you be more verbose, like posting the config, debug output of the issue...
 
Reply
#3
(07-24-2018, 12:21 PM)curlymo Wrote: Can you be more verbose, like posting the config, debug output of the issue...

Relevant config.json portion:

{
        "devices": {
                "voodoo-cam": {
                        "protocol": [ "rsl366" ],
                        "id": [{
                                "systemcode": 3,
                                "programcode": 1
                        }],
                        "state": "off"
                },
                "currentdatetime": {
                        "protocol": [ "datetime" ],
                        "id": [{
                                "longitude": 11.14387,
                                "latitude": 49.52943
                        }],
                        "year": 2018,
                        "month": 7,
                        "day": 21,
                        "hour": 21,
                        "minute": 55,
                        "second": 54,
                        "dst": 1,
                        "weekday": 7
                },
                "localsunriseset": {
                        "protocol": [ "sunriseset" ],
                        "id": [{
                                "longitude": 11.14387,
                                "latitude": 49.52943
                        }],
                        "sunrise": 5.32,
                        "sunset": 21.13,
                        "sun": "set"
                }
        },
        "rules": {
                "localsunrise": {
                        "rule": "IF ((localsunriseset.sunrise == DATE_FORMAT(currentdatetime, %H.%M)) AND (currentdatetime.second == 5)) THEN switch DEVICE voodoo-cam TO on",
                        "active": 1
                },
                "localsunset": {
                        "rule": "IF ((localsunriseset.sunset == DATE_FORMAT(currentdatetime, %H.%M)) AND (currentdatetime.second == 5)) THEN switch DEVICE voodoo-cam TO off",
                        "active": 1
                }
        },



Log file (level 6):


[Jul 24 17:15:09:893191] pilight-daemon: INFO: datetime currentdatetime 11.143870:49.529430 seems to be in timezone: Europe/Berlin
[Jul 24 17:15:09:918861] pilight-daemon: INFO: sunriseset localsunriseset 11.143870:49.529430 seems to be in timezone: Europe/Berlin
[Jul 24 17:15:10:364167] pilight-daemon: INFO: rule #1 localsunrise was parsed in 0.009058 seconds
[Jul 24 17:15:10:372334] pilight-daemon: INFO: rule #2 localsunset was parsed in 0.008127 seconds
[Jul 24 17:15:10:381656] pilight-daemon: INFO: rule #3 homeeup was parsed in 0.009278 seconds
[Jul 24 17:15:10:390839] pilight-daemon: INFO: rule #4 homedown was parsed in 0.009130 seconds
[Jul 24 17:15:10:523757] pilight-daemon: ERROR: cannot bind to the ssdp multicast network
[Jul 24 17:15:10:634577] pilight-daemon: ERROR: skipped rule #1 because of an infinite loop triggered by device currentdatetime
[Jul 24 17:15:11:635757] pilight-daemon: ERROR: skipped rule #1 because of an infinite loop triggered by device currentdatetime
[Jul 24 17:15:12:636695] pilight-daemon: ERROR: skipped rule #1 because of an infinite loop triggered by device currentdatetime
[Jul 24 17:15:13:638390] pilight-daemon: ERROR: skipped rule #1 because of an infinite loop triggered by device currentdatetime
[Jul 24 17:15:14:649317] pilight-daemon: ERROR: skipped rule #1 because of an infinite loop triggered by device currentdatetime
[Jul 24 17:15:15:650219] pilight-daemon: ERROR: skipped rule #1 because of an infinite loop triggered by device currentdatetime
[Jul 24 17:15:16:649502] pilight-daemon: ERROR: skipped rule #1 because of an infinite loop triggered by device currentdatetime
[Jul 24 17:15:17:650463] pilight-daemon: ERROR: skipped rule #1 because of an infinite loop triggered by device currentdatetime
 
Reply
#4
Code tags please.

Also, can you try manually compiling staging with these code block removed?
https://github.com/pilight/pilight/blob/...2014-L2022

Not sure if that's still needed with the new eventing parser. I will also test myself when i have time.
 
Reply
#5
Just try it out. It complies 100% to the manual. And as said: It worked perfectly since 7.0 until 8.1.1. And btw. downgrade doesn't work (just try it out)
 
Reply
#6
1. Again, you still haven't used code tags in your previous post?
2. Have you tried my fix?

3. And for the second time, it doesn't help developers if you just post about an error, without actual output.
 
Reply
#7
Hi,

perhaps you try the following code in the rule for datetime:

Code:
(sunrisesetdevice.sunset == DATE_FORMAT(DATE_ADD(currentdatetime, '+5 SECONDS'), '%Y-%m-%d %H:%M:%S', %H.%M))

With your device:

Code:
"rule": "IF (sunrisesetdevice.sunset == DATE_FORMAT(DATE_ADD(currentdatetime, '+5 SECOND'), '%Y-%m-%d %H:%M:%S', %H.%M)) AND voodoo-cam.state == off AND currentdatetime.second == 0 THEN switch DEVICE voodoo-cam TO on",
 
Reply
#8
Did you test it on 8.1.2? I'm asking because of the same error message.
 
Reply
#9
(07-26-2018, 06:39 PM)Trashware Wrote: Did you test it on 8.1.2? I'm asking because of the same error message.

This will be the last time i will be asking it. Please fix your post according to the forum rules by using code tags.

Did you test my fix with a manually compiled version?
 
Reply
#10
I deleted this entry. So nothing to fix anymore according to the rules. And please see my original post. I was asking there if others have the same issue. Nothing more and nothing less
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  Connection lost, trying to reconnect — loop apartmedia 5 431 03-16-2019, 09:41 AM
Last Post: curlymo
  [split] pilight Error : pilight hangs in a loop Tommybear1979 5 1,954 07-01-2016, 08:27 AM
Last Post: Tommybear1979
Bug Bug report: segmentation fault using rule with AFTER woutput 3 2,475 11-22-2015, 12:27 PM
Last Post: woutput

Forum Jump:


Browsing: 1 Guest(s)