• 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
Rules make pilight freeze
#1
Hey

I created a virtual switch called "Leduit" to set 3 dimmers to 0 (since it is sometimes difficult from a smartphone)

Code:
        "Leduit": {
            "rule": "IF Leduit.state IS on THEN switch DEVICE Leduit TO off AND dim DEVICE LEDSlaapRood AND LEDSlaapGroen AND LEDSlaapBlauw TO 0",
            "active": 1
        },
When i do this the web interface stops working
- webinterface still react to clicks,
- clicks don't switch the real device
- processor and memory on the left top are shown "--"

So after this i changed the rule to the one bellow

Code:
        "Leduit": {
            "rule": "IF Leduit.state IS on THEN switch DEVICE Leduit TO off AND dim DEVICE LEDSlaapRood TO 0 AND dim DEVICE LEDSlaapGroen TO 0 AFTER 2 SECOND AND dim DEVICE LEDSlaapBlauw TO 0 AFTER 4 SECOND",
            "active": 1
        },

The first dimmer (Rood) will go to 0 (but not enable the on/off switch)
the other 2 will not react at all
the 2 seconds is to give pilight the ability to run twice through all rules (to be sure)

Please advice

full config attached.


Attached Files
.txt   config.txt (Size: 32.47 KB / Downloads: 0)
 
Reply
#2
Can you check if it works with the pilight rewrite code?
 
Reply
#3
Hey curlymo,

Thank you for the response.

at the moment i don't have time to collect all sd-cards for a backup and re-install pilight.
the last time i tried the rewrite it cost me a day to restore everything to the working state.

I will install a non production pi soon and see if i can reproduce the error here.
when this is confirmed i can update this one to the rewrite code.

Thanks
Mark
 
Reply
#4
(Slightly offtopic)
You don't need to remove/install pilight to try the rewrite version, all you need to do is clone the rewrite branch, run "cmake ." followed by "make" (NOT "sudo make install"). This will create the pilight binaries in the same folder, and will not install them system-wide. You can also keep your testing configuration in this folder, and run pilight like this:
sudo ./pilight-daemon -D -C config.json

That way you don't have to mess with your working setup, and if something doesn't work, it won't affect your regular pilight setup in any way. It works very well for me Smile
 
Reply
#5
@pilino

Cool that is new information for me. The last time I formated and reinstalled the whole raspberry.
I will try this as soon as I have time to test.
@curlymo
Sorry for my response didn't know your requests was so easy to complete.
 
Reply
#6
That's how i also regularly switch between various pilight versions.
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  [8.1.2] variables in rules -> error terrar 1 793 09-14-2018, 05:28 PM
Last Post: curlymo
  Rules wont work bdb 2 1,124 08-12-2018, 06:25 PM
Last Post: bdb
  Can't switch Relay device by rules: Error switch.lua:77 wobbi 6 1,567 07-31-2018, 06:25 AM
Last Post: curlymo
  Strange behavior of rules currock 4 1,355 06-28-2018, 05:57 PM
Last Post: currock
  pilight service not starting vlatko.jordanov 2 993 05-26-2018, 01:42 PM
Last Post: vlatko.jordanov
  feature request: switching rules terrar 7 1,903 05-05-2018, 09:23 PM
Last Post: trader23
  variable "label" not allowed in rules Niek 4 2,979 09-30-2017, 06:39 PM
Last Post: curlymo
  tabs on pilight SeLi 5 3,067 05-31-2017, 09:25 PM
Last Post: NormBot
  option "all" not sent in rules muecke 5 2,513 07-01-2016, 11:37 AM
Last Post: Niek
  alarm system using pilight rbrueckner 4 2,636 05-14-2016, 12:24 PM
Last Post: diman87

Forum Jump:


Browsing: 2 Guest(s)