• 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:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pilight eventing rules
Accuracy yes but optional. Default in seconds.

I modified all my rules. Works great.
There is a problem, when re-triggering a rule with a timed switch.

        "pir2": {
            "protocol": [ "gpio_switch" ],
            "id": [{
                "gpio": 2
            "state": "off"

    "rules": {
        "licht-bewegung2": {
            "rule": "IF pir2.state IS on THEN switch DEVICE lichtgarage1 TO on FOR 20",
            "active": 1

When there is only one motion, the light switches on for 20 seconds. When there is a new motion in this time, the light stays on until switched manually.
That's correct behavior Smile

The new motion aborts the previous action. The state left by the previous action was on, so the new action will return to on as well.
this is then completely different from my timer and don't work for me. I've multiple Pir sensors which switch lights. As long there is motion, the light stays on. X seconds after the last motion, it switches off.
Does the PIR also send an off signal?
I guess it depends on the type of device.
The Home Easy HE851 PIR sensor (Elro, Conrad) sends an ON and OFF signal.
There are four configurable time intervals for the OFF signal (6s, 15s, 1min, 5min).
indeed. I'm using a very cheap PIR-Motion-Detector from banggood.com, which only can send ON-signals
I'm using wired pir sensors with "gpio_switch". There I get on and off.

Also I'm using a wireless kl690 which uses the sc2262 protocol. This one sends only closed.

I have modified the sc2262.c for this and integrated my timer.
After updating to:

[Mar 30 21:39:01:734874] pilight-daemon: INFO: version 6.0, commit 4d91bb9

I have these simple rules that are not working anymore.

"portiek_on": {
                        "rule": "IF sunriseset.sun IS set THEN switch DEVICE portiek TO on",
                        "active": 1
                "portiek_off": {
                        "rule": "IF sunriseset.sun IS rise THEN switch DEVICE portiek TO off",
                        "active": 1

This is the device configuration:

"sunriseset": {
                        "protocol": [ "sunriseset" ],
                        "id": [{
                                "longitude": 4.6,
                                "latitude": 52.3
                        "sunrise": 6.22,
                        "sunset": 19.13,
                        "sun": "set"

The rule should switch the lamp on if sunriseset.sun is "set" and even if I switch it off manually, the rule should switch it on again. At least, that is the way it worked before.
Can it be that these rules now are only triggered if the value of sunriseset.sun changes and is that how it is intended to work?


Also a rule like this is not triggered:

"portiek_on": {
                        "rule": "IF 1 == 1 THEN switch DEVICE portiek TO on",
                        "active": 1
That's how it always worked IMHO.

Possibly Related Threads...
Thread Author Replies Views Last Post
  [8.1.2] variables in rules -> error terrar 1 561 09-14-2018, 05:28 PM
Last Post: curlymo
  Rules wont work bdb 2 901 08-12-2018, 06:25 PM
Last Post: bdb
  Can't switch Relay device by rules: Error switch.lua:77 wobbi 6 1,094 07-31-2018, 06:25 AM
Last Post: curlymo
  Strange behavior of rules currock 4 1,046 06-28-2018, 05:57 PM
Last Post: currock
  pilight service not starting vlatko.jordanov 2 747 05-26-2018, 01:42 PM
Last Post: vlatko.jordanov
  feature request: switching rules terrar 7 1,475 05-05-2018, 09:23 PM
Last Post: trader23
  variable "label" not allowed in rules Niek 4 2,666 09-30-2017, 06:39 PM
Last Post: curlymo
  tabs on pilight SeLi 5 2,708 05-31-2017, 09:25 PM
Last Post: NormBot
  Eventing intervalls via webgui Shorf 3 1,741 08-30-2016, 06:18 AM
Last Post: Shorf
  option "all" not sent in rules muecke 5 2,218 07-01-2016, 11:37 AM
Last Post: Niek

Forum Jump:

Browsing: 1 Guest(s)