-
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
Multi-trigger PowerDelta Rule - only one trigger firing #4927
Comments
lets put an example
No |
Thanks - I think I finally understand the operating principle of So, the question now is why the Rule isn't firing the other triggers.
This is what I thought should happen:
What am I missing? What do you think is going on with the Thanks Mike |
This 2 rules are contradictory:
Both will try to be triggered. If you have power=2.5 both will trigger.
So, If power is more than 75 you want powedelta 2 is this correct? If so, you indeed need Break command in rules. So, in pseudo code will be something like:
So, in rules could be something like:
|
I was not considering that the Rules were using real numbers. I was treating them as Integers especially since Rules don't support >= & <= In your suggested solution, will either trigger fire if Power=2.0? Is this (floating point values) valid syntax for the trigger portion?
This is what I'm trying to accomplish: So, the example you have does what I need with the minor adjustment of a threshold of 3 instead of 2. I'll give it a try and if it works as desired, I'll close this issue. Thanks. |
Exactly, you need to make triggers for each comparison >, <, =
Yes, exactly |
OK, I had in my mind that Rules were integer comparisons. Learn something new about TASMOTA all the time! However, now the rule
isn't triggering at all. |
Ok, so troubleshooting questions:
|
Yes, I have the Rule on. The is no output in the Console WebLog other than the periodic STATE and SENSOR messages. I'm at 6.3.0.14 (self compiled with 2.3.0). I went back to a version of the rule where only one trigger has a BREAK directive and the rule is triggering. OK, it's still not completely doing what I want, but it fires. I went back to a Rule with more than one BREAK and it quits firing. I wonder if the multiple BREAK directives are causing some issues with the Rules engine? Mike P.S. I'm quite hesitant to go to 6.4.1.x because I'd be exposing myself to potentially having to first troubleshoot the right ESP Core to use based on all the issues people are having. P.P.S. The SENSOR JSON payload always has Power as an integer value. You are certain that inside the software the Rule trigger value comparison is being performed against floating point values for Power? It is the fact that the JSON has only integers for Power as the reason I used integers in the first version of my rule. Thinking of those whole numbers as floating point when writing the Rules logic is a bit non-intuitive. If it's truly the case that Rules are working against "internal" values that may not correspond to the printed log values, the Rules wiki probably needs to point this out in big bold letters. This is what I was working toward thinking that ENERGY#Power was strictly an integer value as the JSON payload implies:
|
It is an old version. Sorry. The BREAK command was added in 6.3.0.15 You should update.
If you don't want to use core 2.4.2 or 2.5.0, there is no problem, you can use core 2.3.0 with latest Tasmota. There is no issue. The version 6.4.1 with core 2.3.0 is available for download at http://thehackbox.org/tasmota/release/020300/ Or you can just selfcompile.
It is TEXT comparison, so it will work. There is no internal variables or something weird. Just text comparison. For Example, VARs MEMs and all that are also TEXT. When you use ADD Tasmota transform it to number, do the math and put as text again. So you are free to use VARs as whatever you want. Please, update and try again the rule:
|
I'm closing this issue due to it isn't a Tasmota Bug, but we will continue with this thread until you make it work. Hope it is ok for you. |
I'll try to get the S31 to take an OTA. I'll close this issue for now. |
Finally got the S31 to successfully OTA. Now at 6.4.1 (release) with 2.3.0. Still had to play a little with the Rule to get the desired behavior I outlined in the pseudo code example. For the sake of documenting the outcome:
|
I'm trying to find a solution to my specific scenario. I am adapting the example provided in #4905.
status 0
:I'm not clear on what
Rule1 5
("Enable one-shot detection (Perform commands once until trigger is not met)") does exactly.I'm looking to implement a variation of your scenario:
My rule:
Note that I am using
BREAK
so that if the Power>75 is triggered, the Power>2 won't also trigger.I want the rule to trigger only once for when Power<3 until Power>75 (and then only once) or until Power>2 (and then only once). So, I want it to trigger each time one of the triggers is met, but only once until one of the other conditions occur to trigger the rule.
Is this what
Rule1 5
will does?The rule seems to trigger (each time) when Power<3 threshold is crossed (
PowerDelta 0
).However, when power was greater than 2 (e.g.,
Teleperiod
message with power=4), the rule (PowerDelta 5
) did not trigger. However, when power went back under 3, the rule (PowerDelta 0
) triggered once again.I also tried putting the
Energy#Power<3
trigger at the end.The result was the same.
Is the use of sensor values in Rule triggers case sensitive?
The SENSOR and SNS messages
/SENSOR = {"Time":"2019-01-14T09:48:20","ENERGY":{"TotalStartTime":"2018-11-30T12:07:13","Total":235.699,"Yesterday":0.035,"Today":0.013,"Period":0,"Power":1,"ApparentPower":31,"ReactivePower":31,"Factor":0.04,"Voltage":122,"Current":0.251}}
/STATUS8 = {"StatusSNS":{"Time":"2019-01-14T09:56:40","ENERGY":{"TotalStartTime":"2018-11-30T12:07:13","Total":235.700,"Yesterday":0.035,"Today":0.014,"Power":2,"ApparentPower":4,"ReactivePower":3,"Factor":0.49,"Voltage":122,"Current":0.031}}}
ENERGY
is all uppercase andPower
is proper case. Do theON
triggers need to evaluate the parameters exactly as they are represented by TASMOTA in the JSON payload? Thus the trigger should beENERGY#Power
? I tried it both ways and the was no change in the outcome - only theENERGY#Power<3
ever seems to fire.Also, separately (related?), why is
Period
in theSENSOR
message coming back as 0 (zero) always? MyTelePeriod
is set to 300. The SENSOR messages are occuring every five minutes so Period ought not to be 0.Thanks.
Mike
The text was updated successfully, but these errors were encountered: