09-21-2019, 06:21 PM
Dear all,
I'm a long time and very happy user of pilight. pilight was working like a charm for many years, managing the lights in my house. It runs on a Raspberry Pi, until the SD card stopped working recently. I've now replaced the SD card and re-installed the latest version of pilight . I had to fix some minor rules, but surprisingly this wasn't that much work. There is one rule though that refuses to work in version 8, which worked fine in version 5.
Whenever I want to test if the sun has status 'set' or 'rise' in a rule, the parser throws an error and refuses to start pilight:
The rule looks as follows:
When I remove the rule, it starts fine.
Below you can find my config (the essential part of it). Who knows what I'm doing wrong here? I've looked everywhere and spent hours, but can't find a solution that works. It used to work in an old version of pilight.
Thanks in advance for your help and ideas!
Kind regards,
Dennis.
I'm a long time and very happy user of pilight. pilight was working like a charm for many years, managing the lights in my house. It runs on a Raspberry Pi, until the SD card stopped working recently. I've now replaced the SD card and re-installed the latest version of pilight . I had to fix some minor rules, but surprisingly this wasn't that much work. There is one rule though that refuses to work in version 8, which worked fine in version 5.
Whenever I want to test if the sun has status 'set' or 'rise' in a rule, the parser throws an error and refuses to start pilight:
Code:
(/home/pilight/source/daemon-dev/libs/pilight/events/events.c #285) [Sep 21 17:09:17:376111] ERROR:
... sunrisesetdevice.sun IS set AND currentdatetime.second ...
^ unexpected symbol, expected a condition
The rule looks as follows:
Code:
"rules": {
"opstaan": {
"rule": "IF sunrisesetdevice.sun IS set AND currentdatetime.second == 0 AND currentdatetime.minute == 30 AND currentdatetime.hour == 7 AND currentdatetime.weekday != 1 AND currentdatetime.weekday != 7 THEN switch DEVICE front TO on",
"active": 1
}
},
When I remove the rule, it starts fine.
Below you can find my config (the essential part of it). Who knows what I'm doing wrong here? I've looked everywhere and spent hours, but can't find a solution that works. It used to work in an old version of pilight.
Thanks in advance for your help and ideas!
Kind regards,
Dennis.
Code:
{
"devices": {
"currentdatetime": {
"protocol": [ "datetime" ],
"id": [{
"longitude": 1.2345,
"latitude": 12.3456
}],
"year": 2019,
"month": 9,
"day": 21,
"hour": 18,
"minute": 50,
"second": 19,
"weekday": 7,
"dst": 0
},
"sunrisesetdevice": {
"protocol": [ "sunriseset" ],
"id": [{
"longitude": 1.2345,
"latitude": 12.34567
}],
"sunrise": 7.55,
"sunset": 17.55,
"sun": "rise"
},
"front": {
"protocol": [ "kaku_switch" ],
"id": [{
"id": 1234567,
"unit": 0
}],
"state": "off"
},
},
"rules": {
"opstaan": {
"rule": "IF sunrisesetdevice.sun IS set AND currentdatetime.second == 0 AND currentdatetime.minute == 30 AND currentdatetime.hour == 7 AND currentdatetime.weekday != 1 AND currentdatetime.weekday != 7 THEN switch DEVICE front TO on",
"active": 1
}
},
"gui": {},
"settings": {
"log-level": 6,
"pid-file": "/var/run/pilight.pid",
"log-file": "/var/log/pilight.log",
"webserver-enable": 0,
"gpio-platform": "raspberrypi2",
},
"hardware": {
"433gpio": {
"sender": 0,
"receiver": 1
}
},
"registry": {
"pilight": {
"version": {
"current": "8.1.5"
}
}
}
}