Page 1 of 1

Extend triggers behaviour

Posted: Tue Dec 14, 2010 10:29 pm
by hplus
Hi,

It could be interesting to optionally extend the triggers not only to trigger on a value change but also on a value update (even if the value didn't change, it could be updated to the same value).
This option should be used carefully not to overload the event manager...

What do you this about that?

Hplus

Re: Extend triggers behaviour

Posted: Thu Dec 16, 2010 9:36 am
by RDNZL
What do you want to trigger/act on exactly?

Device triggers are based on field number, if none of the values have changed there is no trigger activated.
But we can create others like on lastseen field for example.

Re: Extend triggers behaviour

Posted: Thu Dec 16, 2010 3:39 pm
by hplus
What i wanted to have, is a trigger that fires each time an update from a device is received, even if the values field did'nt change.
This is useful to redo the actions associated with the states of the different values of the devices.
Am I clear?

Re: Extend triggers behaviour

Posted: Thu Dec 16, 2010 4:01 pm
by RDNZL
Not really.. a trigger is like a condition, it compares values to fields specified in the trigger to see which events needs to be run, where do you want to match on?

It seems you want to run a certain event every time regarding value changed or not.
But often you don't want to do that, so this conflicts... for example if device values x = on -> speak "device x is on" only runs when value has changed, not when previous value was on already.

Re: Extend triggers behaviour

Posted: Thu Dec 16, 2010 4:25 pm
by hplus
I understand this is not always suitable.
Maybe a solution could be to have in the trigger combo box (value, value1, value2, value3) an extra item which is "updated" or even lastseen as you suggested (this field will change at each update). This event will then fire each time a device is updated....

I have really a lot of problem generating a coherent rule set.... in fact even for a simple scenario i need a huge amount of rules, based on device update, global vars and timed event just to manage one heating point in my house... I am also dealing with what i call watchdogs to periodically resend the heater state according to a globalvar... To simplify the rule creation and management, i would need a more "cleaver" event engine.

Hplus

Re: Extend triggers behaviour

Posted: Thu Dec 16, 2010 4:35 pm
by RDNZL
Ok will implement something like that.

I know another user is coding a thermostat in DomotiGa, but don't know your setup well enough to see if you can benefit from this.

Re: Extend triggers behaviour

Posted: Sun Dec 19, 2010 2:11 pm
by RDNZL
Added support for triggers on lastseen value to revision http://domotiga.nl/changeset/508

Create a trigger with IF device lastseen <> " " (space) to trigger on every device update.