New rules engine

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Wiki
Normal user
Posts: 146
Joined: 23 Apr 2018, 17:55

New rules engine

#1 Post by Wiki » 28 Jan 2019, 12:59

Hi,
I am trying to get the new rules engine to run.

- Adding new event named rule#1
- putting inside a rule, e.g.

Code: Select all

on Clock#Time=All,**:*0 do
Publish domoticz/in,{"idx":53,"nvalue":0,"svalue":"%uptime%"}
endon
- submitting, file "rules/rule/1.txt" is created
- nothing happens, I can see. edit and delete the rule, but the rule itself is never running

Tried with ESP_Easy_mega-20190108_normal_core_241_ESP8266_4096.bin

User avatar
grovkillen
Core team member
Posts: 3331
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: New rules engine

#2 Post by grovkillen » 28 Jan 2019, 19:43

The name of the file must be the name of the event. So in your case that will only trigger when the event "rules#1" happens.

Naming it "Clock#Time" and it will be triggered every minute.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Wiki
Normal user
Posts: 146
Joined: 23 Apr 2018, 17:55

Re: New rules engine

#3 Post by Wiki » 29 Jan 2019, 01:04

Thank you, now the example works, the naming convention makes sence in this case.

But if I define my own event named "startwatering" to trigger it by

Code: Select all

http://<ip>/control?cmd=event,startwatering=1
how do I have to name the rule that it is saved without the formats error message and is running afterwards correctly?

User avatar
grovkillen
Core team member
Posts: 3331
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: New rules engine

#4 Post by grovkillen » 29 Jan 2019, 05:38

Yep, it's a work in progress... So the event need to be of the abc#def syntax. You can try to change the event to start#watering perhaps?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Wiki
Normal user
Posts: 146
Joined: 23 Apr 2018, 17:55

Re: New rules engine

#5 Post by Wiki » 29 Jan 2019, 11:02

OK, I'll try and will report.

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests