• 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
Confusion/possible bug in pilight
#1
Hello!

Thanks for wonderful product! I have mostly managed pilight well, trying out all the API functionalities and so on. But one thing is confusing me. I have such a rule in pilight

"rule": "IF (ev1527.unitcode == 370832) THEN switch DEVICE doordisplay1 TO on FOR 1 MINUTE",

doordisplay1 is just one dummy switch in GUI. This rule works so that it turns doordisplay1 to ON but never turns it off after 1 minute. If rule could work we could do all kinds of things like "turn on lights for minute if pir is triggered" and so on.

I have checked the source code and from there it feels like maybe this feature does not exist in case of devices trigger (maybe only works in case of datetime).

Can you please confirm/help me out with this issue. I can get over the problem by developing some external software to subscribe to pilight events and do things externally. But I would not want to move away from pilight core functionality as I hope to see bright future for pilight in every aspect not only as receiver and sender of codes.




Greetings
Toomas
 
Reply
#2
Can you check debug output by running these commands:
Code:
sudo service pilight stop
sudo pilight-daemon -D
It should say whether the rule was executed or not. It probably won't run because you are triggering an infinite loop, as the unitcode of ev1527 never changes, which will immediately trigger the rule again.
 
Reply
#3
This kind of rule is only triggered if system receives message (from 433 receiver) with the defined unitcode. So in my opinion this is not a loop.

Rule is following:

"rule": "IF (ev1527.unitcode == 370832) THEN switch DEVICE doordisplay2 TO on FOR 1 MINUTE",

In Log is see (only if i trigger this ev1527 protocol (it's door switch)):


[Nov 06 11:00:39:379192] pilight-daemon: INFO: executed rule: door2rule
[Nov 06 11:00:39:379705] pilight-daemon: DEBUG: rule #2 door2rule was parsed in 0.000915 seconds
[Nov 06 11:00:39:381626] pilight-daemon: INFO: started "switch" action for device "doordisplay2"
[Nov 06 11:00:39:382803] pilight-daemon: INFO: stopped "switch" action for device "doordisplay2"


So it never waits anywhere for one minute to do something to turn off the switch.
 
Reply
#4
That's a functionality that I haven't used yet (receiving protocols to trigger rules), so I'm not 100% sure as to how it works. But it looks like you're using it right, as far as I can tell. Can you try narrowing down the example by using another generic_switch device to trigger the rule and seeing whether it works as expected then.

Please also post your (stripped) config.json and full pilight-daemon -D output.
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  pilight service not starting vlatko.jordanov 2 772 05-26-2018, 01:42 PM
Last Post: vlatko.jordanov
  tabs on pilight SeLi 5 2,770 05-31-2017, 09:25 PM
Last Post: NormBot
  alarm system using pilight rbrueckner 4 2,351 05-14-2016, 12:24 PM
Last Post: diman87
  Rules make pilight freeze koos147 5 2,256 05-04-2016, 08:11 PM
Last Post: curlymo
  Raspberry Freeze when starting pilight sunny20k17 2 1,451 03-18-2016, 12:29 PM
Last Post: sunny20k17
  pilight eventing rules terrar 94 42,459 02-18-2016, 10:21 PM
Last Post: brombeerwilli
  pilight after reboot SeLi 5 3,664 01-06-2016, 08:20 PM
Last Post: SeLi
  pilight eventing - sunset/sunrise/time Niek 14 11,467 04-27-2015, 05:20 PM
Last Post: troccolo
  Trigger a one-shot device from pilight Karel 5 3,480 03-12-2015, 03:54 PM
Last Post: martinr
Smile pilight eventing - randomization questor 8 4,730 01-29-2015, 04:21 PM
Last Post: Niek

Forum Jump:


Browsing: 1 Guest(s)