• 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
#17
I see similiar issue here. pilight version 8.1.2. Hardware is Raspberry Pi 3 with a 433nano device. The config file below results in:

Code:
[Oct 14 07:38:21:198446] pilight-daemon: ERROR: skipped rule #2 because of an infinite loop triggered by device date

but if the dummy rule is disabled with "active": 0 then there are no complaints in the log file. Am I doing something illegal in the config?


Code:
{
    "devices": {
        "Lamp0": {
            "protocol": [ "nexa_switch" ],
            "id": [{
                "id": 22700370,
                "unit": 2
            }],
            "state": "off"
        },
        "Lamp0-enable_sunset_rule": {
            "protocol": [ "generic_switch" ],
            "id": [{
                "id": 200
            }],
            "state": "on"
        },
        "Lamp0-enable_wkday_rule": {
            "protocol": [ "generic_switch" ],
            "id": [{
                "id": 202
            }],
            "state": "off"
        },
        "date": {
            "protocol": [ "datetime" ],
            "id": [{
                "longitude": 18.068580,
                "latitude": 59.329323
            }],
            "year": 2018,
            "month": 10,
            "day": 14,
            "hour": 9,
            "minute": 44,
            "second": 28,
            "dst": 1,
            "weekday": 1
        },
        "sun": {
            "protocol": [ "sunriseset" ],
            "id": [{
                "longitude": 18.068580,
                "latitude": 59.329323
            }],
            "sunrise": 7.22,
            "sunset": 17.46,
            "sun": "rise"
        }
    },
    "rules": {
        "Lamp0-sunset": {
            "rule": "IF (sun.sunset == DATE_FORMAT(DATE_ADD(date, '+15 MINUTE'), '%Y-%m-%d %H:%M:%S', %H.%M)) AND date.second == 0 AND Lamp0-enable_sunset_rule.state == on THEN switch DEVICE Lamp0 TO on",
            "active": 1
        },
        "dummy": {
            "rule": "IF '6.40' == DATE_FORMAT(date, %H.%M) AND date.second == 0 AND date.weekday == 1 AND date.weekday == 7 AND Lamp0-enable_wkday_rule.state == on THEN switch DEVICE Lamp0 TO on",
            "active": 1
        },
        "Lamp0-wkday": {
            "rule": "IF '6.40' == DATE_FORMAT(date, %H.%M) AND date.second == 0 AND date.weekday > 1 AND date.weekday < 7 AND Lamp0-enable_wkday_rule.state == on THEN switch DEVICE Lamp0 TO on",
            "active": 1
        }
    },
    "gui": {
        "Lamp0": {
            "name": "Lamp0",
            "group": [ "Home" ]
        },
        "sun": {
            "name": "Sunset / Sunrise",
            "group": [ "Automation" ]
        },
        "Lamp0-enable_sunset_rule": {
            "name": "Turn on Lamp0 at sunset",
            "group": [ "Automation" ]
        },
        "Lamp0-enable_wkday_rule": {
            "name": "Turn on Lamp0 06:40 on weekdays",
            "group": [ "Automation" ]
        }
    },
    "settings": {
        "log-level": 6,
        "pid-file": "/var/run/pilight.pid",
        "log-file": "/var/log/pilight.log",
        "actions-root": "/usr/local/lib/pilight/actions/",
        "functions-root": "/usr/local/lib/pilight/functions/",
        "operators-root": "/usr/local/lib/pilight/operators/",
        "webserver-enable": 1,
        "webserver-root": "/usr/local/share/pilight/webgui",
        "webserver-http-port": 80,
        "webserver-https-port": 5002,
        "webserver-cache": 1,
        "whitelist": "192.168.1.*",
        "gpio-platform": "none"
    },
    "hardware": {
        "433nano": {
            "comport": "/dev/pilight/433nano"
        }
    },
    "registry": {
        "pilight": {
            "firmware": {
                "version": 1,
                "lpf": 8,
                "hpf": 1600
            },
            "version": {
                "current": "8.1.2"
            }
        },
        "webserver": {
            "ssl": {
                "certificate": {
                    "secure": 0,
                    "location": "/etc/pilight/pilight.pem"
                }
            }
        }
    }
}
 
Reply
  


Messages In This Thread
RE: Infinite loop on sunrise rule caused by currentdatetime - by kylex - 10-14-2018, 08:49 AM

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

Forum Jump:


Browsing: 1 Guest(s)