Sonoff TH10 floorheating

瀏覽次數:31 次
跳到第一則未讀訊息

Leo van Thuis

未讀,
2022年4月20日 凌晨4:23:492022/4/20
收件者:TasmotaUsers
Hello, I'm new to this group.
Use case:
My ground floor is heated by ground floor heating. I have a pump, that is controlled by a Sonoff TH10. Tghe Th10 is connected to 2 DS18B20 sensors. One before the pump en one after a thermostatic valve. I've made a rule for controlling the pump. See below. The pump should be working for about 2 minutes after every 24 to 48 hours after the last time the pump was used. Otherwise it is possible that the pump halts and will not start again.
I've decided that I want to be independent from my network and internet for this situation. That means that I want to use rules at the Th10 instead of using my home automation, which is openHAB.

The rule used now:
Rule1
ON DS18B20-1#Temperature>=31.0 DO Var1 1 ENDON
ON DS18B20-1#Temperature<28.0 DO Var1 0 ENDON
ON DS18B20-2#Temperature>39.0 DO Var1 0 ENDON
VAR2=VAR1
ON VAR1<2 DO POWER1 %Var1% ENDON
Rule is activated with: rule1 5
This part is working well.

I want to extend the rule with:
ON VAR2=0 DO RuleTimer1=65535 ENDON
ON Rules#Timer=1 DO Ruletimer2=20865 ENDON
ON Ruler#Timer=2 Do Power1 1; RuleTimer3=120 ENDON
ON Rules#Timer=3 DO POWER1 0; VAR2=0 ENDON

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

Philip Knowles

未讀,
2022年4月20日 清晨7:16:392022/4/20
收件者:Leo van Thuis、TasmotaUsers

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.

 

Leo van Thuis

未讀,
2022年4月30日 清晨6:53:122022/4/30
收件者:TasmotaUsers
Changed the rule to:
Rule2
Blinktime 1200
Blinkcount 1
ON Time#Minute=720 DO POWER 3 ENDON
Activated the rule with:
Rule2 1

As far as I"m able to notice, the rule doesn't start or may be does start but without any result--> Pump not ON

Must this be the first rule and my first rule the second one?
Or did I made a mistake in the second rule its self?

Op woensdag 20 april 2022 om 13:16:39 UTC+2 schreef knowles...@gmail.com:

Philip Knowles

未讀,
2022年4月30日 中午12:08:322022/4/30
收件者:Leo van Thuis、TasmotaUsers

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

Leo van Thuis

未讀,
2022年5月1日 清晨5:28:102022/5/1
收件者:TasmotaUsers
I have no POWER1 or POWER2, but only POWER. Maybe I have to stop Rule1 first and strat Rule1 again when POWER 3 is finished.. The temperature sensors values could be the problem of directly turn off the POWER. I'll give that a try.

Op zaterdag 30 april 2022 om 18:08:32 UTC+2 schreef knowles...@gmail.com:

Philip Knowles

未讀,
2022年5月1日 上午8:24:072022/5/1
收件者:Leo van Thuis、TasmotaUsers

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

Leo van Thuis

未讀,
2022年5月2日 下午1:06:432022/5/2
收件者:TasmotaUsers
@Philip,
Many thanks for your advise, help and time you're spending at this issue
I'm testing the rules on a SonOFF Dual R2.
I started to test Rule1
rule1 on system#boot do var2 0 endon on time#minute|1 do add2 1 endon on var2#state=24 do backlog power1 3; var2 0 endon. I've made one modification; that is time#minute|1.
The good news is that adding by 1 every minute is okay.
The bad news is, that the counting keeps on going when var2#state=24 and goes on to 25, 26, 27, 28 and so on. When I look in the syslog of this device I see the adding is okay but goes on. It seems, that the part on var2#state=24 do backlog power1 3; var2 0 endon is not triggered. In the syslog I also see no activity of this rule.
I've changed the rule a bit in this way.
rule1 on system#boot do var2 0 endon on time#minute|1 do add2 1 endon on var2#state=24 do backlog power1 1; delay 120; power1 0; var2 0 endon.
Restart the device
The behavior is the same as I described above.
I have tested in the console of the device power1 3, power1 1 and power1 0. Power1 3 toggles a couple of times between On and OFF, while power1 1 goes ON and power1 0 goes OFF. So these commands are okay.
Question:
Must one and/or more SetOptions be changed?

Regards,

Leo



Op zondag 1 mei 2022 om 14:24:07 UTC+2 schreef knowles...@gmail.com:

Philip Knowles

未讀,
2022年5月2日 下午2:04:572022/5/2
收件者:Leo van Thuis、TasmotaUsers

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.

Leo van Thuis

未讀,
2022年5月2日 下午3:20:002022/5/2
收件者:TasmotaUsers
Tested rule1. Works like charm. Thanks. I only had to increase blinktime to 1200 to get 2 minutes. Does the modification made mean, that you can not use the equal sign in rules? The power1 in the syslog keeps OFF. Is there a way to get this to ON when the command power1 3 is sent?

Op maandag 2 mei 2022 om 20:04:57 UTC+2 schreef knowles...@gmail.com:

Philip Knowles

未讀,
2022年5月2日 下午5:19:152022/5/2
收件者:Leo van Thuis、TasmotaUsers
No but the change happens in the same ruleset and it compares the value at the start. There's a note in the rules page. Blink shows differently than power. Yes it's 0.1 of a second so 1200.

Regards

Phil K


From: sonof...@googlegroups.com <sonof...@googlegroups.com> on behalf of Leo van Thuis <lvt0...@gmail.com>
Sent: Monday, May 2, 2022 8:20:00 PM
To: TasmotaUsers <sonof...@googlegroups.com>

Philip Knowles

未讀,
2022年5月3日 凌晨2:19:372022/5/3
收件者:Leo van Thuis、TasmotaUsers

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

回覆所有人
回覆作者
轉寄
0 則新訊息