• 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) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Incompatibility in handling of rules:
#19
Hey guys,
I'm finally on the rewrite branch (*yay*) and yep I have some strange issues here as well.
Used the existing device/rules/gui configuration. Then when I start pilight and then stop (using pilight-daemon -D), each time a different device state changes to something meaningless.
On first run, it happened to elro_800_switch devices:
Code:
"wzkette": {
                        "protocol": [ "elro_800_switch" ],
                        "id": [{
                                "systemcode": 18,
                                "unitcode": 8
                        }],
                        "state": "connected"
                },
Second run, now it hapened to the kaku_switch_old devices:
Code:
"balkon": {
                        "protocol": [ "kaku_switch_old" ],
                        "id": [{
                                "unit": 2,
                                "id": 0
                        }],
                        "state": "alarm"
                },
Apart from this, there's an error while triggering rules via received protocol signals. Error:
Code:
[May 25 22:51:32:666374] ERROR: rule #10 invalid: trying to compare string variable "kaku_switch_old.unit" to an integer
[May 25 22:51:32:666502] INFO: rule #10 was parsed until: ... kaku_switch_old.unit == 0 AND kaku_switch_old.id == 1 THEN switch DEVICE swi-bedlamp-dima TO on
[May 25 22:51:32:666613] INFO: rule #10 10-kaku-lampe-dima-on was parsed in 0.000521 seconds
Rule:
Code:
"10-kaku-lampe-dima-on": {
                        "rule": "IF kaku_switch_old.state IS on AND kaku_switch_old.unit == 0 AND kaku_switch_old.id == 1 THEN switch DEVICE swi-bedlamp-dima TO on",
                        "active": 1
                },
Did I miss here something?

I will keep looking for more occurences Smile
Should I rather put these issues to new (separate) topics?

EDIT:
I've double-checked the installation. It's the rewrite branch, current commit:
Code:
root@srvpi01:/home/pi/pilight# pilight-daemon -V
pilight-daemon version ea7098d
Seems like the config.json file is updated with wrong values on pilight shutdown. Following is valid for both gui and rules:
- When changing states of an elro_800_switch, the states are changed between "opened" and "closed"
- When changing states of an elro_800_contact, the states are changed between "on" and "off"
- This should be exactly the opposite way.
This is the shell output while switching an elro_800_switch to off:
Code:
[May 26 00:24:55:834315] DEBUG: **** RAW CODE ****
300 900 900 300 300 900 900 300 300 900 300 900 300 900 300 900 300 900 300 900 300 900 300 900 300 900 900 300 300 900 900 300 300 900 900 300 300 900 900 300 300 900 900 300 300 900 300 900 300 10200
[May 26 00:24:55:835484] DEBUG: **** RAW CODE ****
[May 26 00:24:56:254287] DEBUG: successfully send elro_800_switch code
[May 26 00:24:56:255116] DEBUG: possible pollin protocol
[May 26 00:24:56:255237] DEBUG: recevied pulse length of 301
[May 26 00:24:56:255317] DEBUG: caught minimum # of repeats 1 of pollin
[May 26 00:24:56:255392] DEBUG: called pollin parseRaw()
[May 26 00:24:56:255744] DEBUG: possible elro_800_switch protocol
[May 26 00:24:56:255846] DEBUG: recevied pulse length of 301
[May 26 00:24:56:255917] DEBUG: caught minimum # of repeats 1 of elro_800_switch
[May 26 00:24:56:255994] DEBUG: called elro_800_switch parseRaw()
[May 26 00:24:56:256304] DEBUG: possible elro_800_contact protocol
[May 26 00:24:56:256396] DEBUG: recevied pulse length of 301
[May 26 00:24:56:256472] DEBUG: caught minimum # of repeats 1 of elro_800_contact
[May 26 00:24:56:256546] DEBUG: called elro_800_contact parseRaw()
[...]
[May 26 00:24:56:276304] DEBUG: broadcasted: {"message":{"systemcode":28,"unitcode":1,"state":"off"},"protocol":"elro_800_switch","uuid":"0000-b8-27-eb-22d88b","repeats":1}
[May 26 00:24:56:278938] DEBUG: broadcasted: {"message":{"systemcode":28,"unitcode":1,"state":"off"},"origin":"receiver","protocol":"pollin","uuid":"0000-b8-27-eb-22d88b","repeats":1}
[May 26 00:24:56:281736] DEBUG: broadcasted: {"message":{"systemcode":28,"unitcode":1,"state":"off"},"origin":"receiver","protocol":"elro_800_switch","uuid":"0000-b8-27-eb-22d88b","repeats":1}
[May 26 00:24:56:284893] DEBUG: broadcasted: {"message":{"systemcode":28,"unitcode":1,"state":"closed"},"origin":"receiver","protocol":"elro_800_contact","uuid":"0000-b8-27-eb-22d88b","repeats":1}
[...]
(removed unnecessary parts)
Thus I guess that there's a bug in updating the config file. pilight itself is running well though, but in case of a restart (for whatever reasons), pilight won't start because the config is then screwed.
I'm still monitoring for further issues.
 
Reply
  


Messages In This Thread
RE: Incompatibility in handling of rules: - by diman87 - 05-26-2016, 12:41 AM

Forum Jump:


Browsing: 1 Guest(s)