Ruletimer2 is used to get 24 hours!!!
TH10 is running : 9.3.1(sensors)
I've two questions:
Can I put the first part and the second part together in one rule?
Do I achieve my goal in this way or not?
I think that simplifications of the rule are possible. Any help would be appreciated.
Leo
You need to be a bit careful when you have a rule trigger based on a variable changing earlier in a rule. It makes no odds if you have 2 rules so I wouldn’t worry about that.
If you use Blink you can simplify Rule 2
Blinktime 1200
Blinkcount 1
ON VAR2=0 DO RuleTimer1=65535 ENDON
ON Rules#Timer=1 DO Ruletimer2=20865 ENDON
ON Ruler#Timer=2 Do Power1 3; var2=0 ENDON
However, I know you want to be less reliant on the time, but it may be simpler to use a Timer to start the pump every day. Using Blink will keep the pump running if it was already running and run for only 2 minutes if it is off.
Regards
Phil K
Sent from Mail for Windows
--
You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/2121f815-149f-48b0-b620-caab34c2e385n%40googlegroups.com.
Not sure if it’s the issue but try power1 3
It’s always useful to try the commands in console that you are going to use in a rule. If power 3 doesn’t work then that’s the issue
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/35b4c0fd-741b-498e-ab24-1da539e797afn%40googlegroups.com.
If in doubt try the command without the rule in console power1 3 should just start the pump for 2 minutes.
The original Tasmota was for devices with only 1 output so power 1 worked. It is best practice to tell Tasmota which relay you are talking about hence power1 1 and power1 0 (for on and off). Blink is unaffected by the Power1 state but you have Rule1 set as a ‘one-shot’ which may give some strange results as you have 2 sets of conditions (but 1 set is incomplete).
Looking at your rule1 I don’t see how it works
Rule1
ON DS18B20-1#Temperature>=31.0 DO Var1 1 ENDON – if temp >= 31 var1 =1
ON DS18B20-1#Temperature<28.0 DO Var1 0 ENDON – if temp<28 var1 = 0
ON DS18B20-2#Temperature>39.0 DO Var1 0 ENDON - if temp2>39 var1 = 0
VAR2=VAR1 – There is no ‘on’ here so this won’t run and, if it did, it would need to be var2=%var1%
ON VAR1<2 DO POWER1 %Var1% ENDON – var1 is always less than 2 so this is always true
It looks like you want the pump to come on when the temperature hits 31 and stay on until the temperature falls below 28 unless temp2 goes over 39 (but you don’t seem to reset if the temperature comes down).
I think the following would work
rule1 on system#boot do var2 0 endon on time#minute|60 do add2 1 endon on var2#state=24 do backlog power1 3; var2 0 endon
rule1 1
Set pump time counter to 0 on boot; every 60 minutes add 1 to var 2; when var2 gets to 24 start the pump for 2 minutes
rule2 on DS18B20-2#Temperature>39.0 do backlog power1 0; var1 0; var2 0 endon on DS18B20-2#Temperature<39.0 do var1 1 endon
rule2 5
if temp2>39 then turn off the pump, set pump status to 0 and reset the pump time counter; if temp2<39 set pump status to 1
rule3 on DS18B20-1#Temperature>=31.0 do power1 %var1% endon on DS18B20-1#Temperature<28.0 do backlog power1 0; var2 0 endon
rule3 5
if temp1>=31 only start pump if pump status 1; if temp1<28 switch off pump and reset pump time counter to 0
To test change the time#minute in rule1 time#minute|1 and the rule2 temperatures to something suitably low. The pump should run briefly after 24 minutes
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/89131814-646c-42d5-998a-485c51f3212en%40googlegroups.com.
Ooops. I’ve fallen foul of the change a value in the ruleset problem. Try
on var2#state>24 do backlog power1 3; var2 0 endon
Check your blinkcount and blinktime values in console as you had them in a rule before – they should just be entered into console
In fact it’s worth putting into rule 1 to ensure it survives a partial reset.
rule1 on system#boot do backlog blinkcount 1; blinktime 120; var2 0 endon on time#minute|1 do add2 1 endon on var2#state=24 do backlog power1 3; var2 0 endon.
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/6b35f13d-50cc-43ba-a9d2-2eace56c4fb8n%40googlegroups.com.
You should see something in the log
07:16:00.794 CMD: power1 3
07:16:00.799 MQT: stat/Sonoff-Pump/RESULT = {"POWER":"Blink ON"}
So you should see something in openHAB too
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/8d59f760-f643-443e-8ae7-25c616abf2cbn%40googlegroups.com.