• 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
[Done] Event system
#1
Currently being implemented based on the pimatic rules system.
 
Reply
#2
Very good news (pimatic way to do that is very simple, close to human language) maybe it's not enough for complex rules but so far i am happy with it
 
Reply
#3
A little cross-posting from here: http://forum.pilight.org/Thread-Future-o...29#pid5329

It currently works like this:
Code:
IF kaku_switch.state IS on THEN ...

What happens are several things:
- The IF is statical, it needs to be there.
- Then you can have two types of variables:
1. A protocol variable (e.g. kaku_switch.state)
2. A config variable (e.g. living.mainlight.state)
- Then we have the operator. In this case the "IS". Operators are plugins so these can be expanded easily.

After that we have the THEN part. This is not done yet. What i'm going to create are event modules. So you can say for example:
Code:
THEN wakeup(bedroom.light, 45);
The wakeup light event can then let the bedroom.light get to full strength in 45 minutes. The wakeup light thread will then check if there is another event on the bedroom.light and will stop when needed.

Other ideas are:
Code:
THEN set(living.light, "on")
THEN set(living.light, "off")

This means that all events are modular.

Rules can be really advanced (also working):

Hooks (as much as you like):
Code:
IF ((kaku_switch.id == 123456 AND kaku_switch.unit == 0 AND kaku_switch.state IS off) OR (kaku_switch.id == 456789 AND kaku_switch.unit == 1 AND kaku_switch.state IS on)) AND (sunriseset.sunrise > 600 OR sunriseset.sun IS rise) THEN ...

Math:
Code:
IF (sunriseset.sunrise == ((datetime.hour * 100) + datetime.minute)) THEN ...

And of course, all rules will be checked for validity.
 
Reply
#4
GREAT NEWS!!
 
Reply
#5
You say currently working like this....

Is it actually working in the dev. Git? And if it is, where cani create some rules?
 
Reply
#6
It's posted in this topic because it's being worked on. So you can't test it yet.
 
Reply
#7
When did you plan to release the event system?
 
Reply
#8
The event system is done, but it requires a large rewrite of the config structure. There is another topic on that.
 
Reply
#9
Wich topic is it? Can you link it?
 
Reply
#10
Can you search for it Smile
 
Reply
  


Forum Jump:


Browsing: 1 Guest(s)