-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugs on Rules #2778
Comments
Thnx again. Will study... |
There are bugs and there are features.... Once vars is made global these issues pop up for several reasons. Then vars were made global providing expectation that I didn't envision.
A working solution would be:
All items have workarounds. Some items have inherited results. They are all explainable fro some reason. Solutions:
|
Reconsidering! I'll make the var (and mem) options a command making handling a lot easier and more versatile. A command like var1 would show it's value. |
Thanks 😄 |
Right. So the following changes have been made:
|
Also note that the following won't work: Well at least not as you probably would expect. The var1 value used by the power1 command will be the value present before the backlog command is executed. This is so because the rule will replace %var1% BEFORE the backlog commands are put in the backlog-log ;-). |
Thanks a lot! Very happy with the rules feature |
Hi @arendst , There is a bug with:
Doing the command: If doing instead the rule with
It works as expected. |
I cannot reproduce:
There were problems before as noted in another issue (I can't find just now) but by moving the power handling to a sub-process that issue and the issue you encounter were gone... Is it reproducable in your case? Does it always fail? I could think of a scenario where it would fail when the event command is executed just before 0.1 second moment the power sub-process is started. |
Hi, I reflash with last version and works as expected. So may be I was testing on a device with old firmware. Sorry. Everything is working now. Thanks 👍 Closing... |
5.14.0a * Add rules %mem1% to %mem5% variable names storing data in flash (arendst#2780) * Add rules test on %varx% or %memx% (arendst#2780) * Fix anomalies in rules (arendst#2778)
Describe the bug
A clear and concise description of what the bug is.
Hi, found 3 Bugs on rules. Described below.
Also, make sure these boxes are checked [x] before submitting your issue - Thank you!
status 0
:To Reproduce
Steps to reproduce the behavior:
There are 3 Bugs on rules.
1 - When using
backlog
command, the value of the trigger event is not stored onvar1
.Example rule:
rule on event#setvar1 do var1 endon
<- works as expectedrule on event#setvar1 do backlog var1; power1 %value% endon
<-var1
is not updated2 - If it used
%var1%
without being set before, it is not replaced by zero.Example rule:
rule on event#setvar1 do var1 endon on event#info do publish stat/sonoff/info %var1% endon
Console:
3 - If it called
event
inside a rule withoutbacklog
Tasmota crash.Example rule:
rule on event#init do event outputs=0 endon on event#outputs do backlog power1 %value% power2 0 endon
Tasmota Crash when doing on the console:
event init
rule on event#init do backlog event outputs=0 endon on event#outputs do backlog power1 %value% power2 0 endon
Works as expected when doing on the console:
event init
Expected behavior
A clear and concise description of what you expected to happen.
1-
VAR1
saved if using backlog2-
%var1%
to be replaced by 0 if not set before.3- Use
event
withoutbacklog
commandScreenshots
If applicable, add screenshots to help explain your problem.
Not needed.
Additional context
Add any other context about the problem here.
Given above
(Please, remember to close the issue when the problem has been addressed)
The text was updated successfully, but these errors were encountered: