• 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
Currently being implemented based on the pimatic rules system.
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
A little cross-posting from here: http://forum.pilight.org/Thread-Future-o...29#pid5329

It currently works like this:
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:
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:
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):
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 ...

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

And of course, all rules will be checked for validity.
You say currently working like this....

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

Forum Jump:

Browsing: 1 Guest(s)