Moderator: RDNZL


RDNZL wrote:airox wrote:You can attach actions on the true side and on the false side. This is really what you want because often things need to be handled when the condition becomes false or true.
I thought about a few optimizations you can do when you need to fetch a lot of event data. This is something I never implemented because it's still fast enough for me (after adding indexes on all tables):
I'm really interested in the experiences you guys also have in other event architectures.
Having actions for true and false conditions is a very good idea!
I now have 2 events for a lot of things, "if device value = on then" and seperate "if device value is off then"...
I'm going to try to implement that.
A step further like hplus suggested earlier -having conditions for each action- is almost like having scripting capabilities, but I have not succeeded to implement that (i can only eval() basic gambas code, which returns true/false)
About your event architecture:
If I understand correctly you parse all your event conditions whenever there is something going on, either a device value changes, a lastchanged/seen time changes, time changes... you don't have trigger types on which you filter as first step, right?
I did that so triggertype 1 = cron/time, 2 = device value.. x = globalvar changes (for e-mail counters, callerid etc) and then I only checked if device and field matched, before i continued the parse...
Now (thanks to suggestions of hplus) I introduced multitrigger (as a test) so events can be triggered on various types.
We must gtalk some time, but we had that idea earlier if I remember correctly, a bit lack of time here..
<conditionBasedEvent id="LIGHTS_WHEN_NECESSARY" name="Zet lichten woonkamer aan wanneer nodig">
<conditions>
<equal>
<flagValue id="SECURITY">uit</flagValue>
<flagValue id="PRESENCE">ja</flagValue>
<lightDark id="LICHTSENSOR_WOONKAMER">0</lightDark>
</equal>
<conditions logical="OR">
<equal>
<motion id="BEWEGINGSENSOR_WOONKAMER">1</motion>
<motion id="BEWEGINGSENSOR_KEUKEN">1</motion>
</equal>
</conditions>
</conditions>
<actionsWhenTrue>
<switchOn device="TVLAMPEN" />
<dim value="47" device="KEUKENLAMP" />
</actionsWhenTrue>
<actionsWhenFalse>
<!-- switchOff device="TVLAMPEN" />
<dim value="0" device="KEUKENLAMP" / -->
</actionsWhenFalse>
</conditionBasedEvent>













Users browsing this forum: No registered users and 3 guests