Page 1 of 1

event without an event

Posted: 20 Mar 2019, 13:16
by schnurzel59
Hi,
When will an event be triggered?
A simple test:
The following device is created.
Device.jpg
Device.jpg (40.46 KiB) Viewed 3899 times
A Rule for the Test:

Code: Select all

on Testdev#Testvalue do
  event,RuleIsBeingExecuted
endon
Here the Log:

Code: Select all

150758: EVENT: Testdev#Testvalue=0.00
150879: ACT  : event RuleIsBeingExecuted
150892: Command: event
150893: EVENT: RuleIsBeingExecuted
151150: ACT  : let,1,3.60*1.2
151164: Command: let

...........

160758: EVENT: Testdev#Testvalue=0.00
160879: ACT  : event RuleIsBeingExecuted
160893: Command: event
160894: EVENT: RuleIsBeingExecuted
161098: ACT  : let,1,4.32*1.2
161111: Command: let
So every 60 seconds the rule is started.Why? No value was changed in the device. That does not make sense.
It should only be displayed with a status change an event and an action to be performed. Or am I wrong?

Re: event without an event

Posted: 20 Mar 2019, 14:27
by grovkillen
You have set the interval to 60 seconds. Set it to 0 of you want it to be manually invoked.

Re: event without an event

Posted: 20 Mar 2019, 21:17
by schnurzel59
I can not set the interval to 0 It is automatically set to 60s.

Re: event without an event

Posted: 20 Mar 2019, 22:19
by Shardan
Which version are you using?

I'm just working on some Rules depending on a dummy variable and I'm able to set the the time intervall without problems?

(Tested with mega-20190311)

Re: event without an event

Posted: 20 Mar 2019, 22:34
by schnurzel59
I use the mega-20190315
I can set all values, only not 0.

Re: event without an event

Posted: 21 Mar 2019, 03:19
by ThomasB
Like some other ESPEasy devices, the dummy (P033) plugin does not support a zero interval value. That means it cannot be disabled. So you have to expect repeated (interval) data and handle it in your rules.

If the interval data is a deal killer in your application then there is a workaround if you don't mind compiling your own ESPEasy version. It requires adding one line of code in the device's PLUGIN_DEVICE_ADD code section.

In _P033_Dummy.ino find this line:

Code: Select all

Device[deviceCount].TimerOption = true;
And below it add this:

Code: Select all

Device[deviceCount].TimerOptional = true;         // Allow user to disable interval function.
This change will allow you to set the interval to zero.

- Thomas

Re: event without an event

Posted: 21 Mar 2019, 17:26
by schnurzel59
Hi,
I thought the interval only refers to the transfer of data to the controller. (Home Matic).
if I now set the interval to 0, the values are no longer transmitted automatically. But here is the second problem.
It does not matter which Arduino IDE version or directory structure I use in the libraries.
There are always compilation errors of different types. I'm programming my Arduinos for a few years
without any problems. But compiling the ESP stuff made my hair go gray.
So I have to adapt my rules to the circumstances.

Thank you anyway