Hello,
Could you please clarify if I'm wrong or is it Rules malfunction?
I'm going to provide hysteresis to the heating system, so trying the next:
if [sniff2#1floortemp]<[targetT#1floor]-0.3 and [sniff#1floor]=1
mcpgpio,11,1
TaskValueSet 3,1,1
endif
sniff2#1floortemp and targetT#1floor are MQTT-import devices.
It seems that "-0.3" is ignored.
Is that normal behavior?
GIT version: mega-20190108
TIA
Alexander
Maths in Rules malfunction?
Moderators: grovkillen, Stuntteam, TD-er
-
- Normal user
- Posts: 10
- Joined: 05 Mar 2018, 23:06
Maths in Rules malfunction?
Rgds,
Alexander
Alexander
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Maths in Rules malfunction?
This is normal yes, for the if statement you cannot add maths. Use the formula within the task settings. For targetT#1floor you just add %value%-0.3 to the formula line.
The being said, you can use math in rules but not in the if statement.
The being said, you can use math in rules but not in the if statement.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
-
- Normal user
- Posts: 10
- Joined: 05 Mar 2018, 23:06
Re: Maths in Rules malfunction?
Thanks for reply.
Well, in my case formula won't help since the whole piece of rule is:
if [sniff2#1floortemp]<[targetT#1floor]-0.3 and [sniff#1floor]=1
mcpgpio,11,1
TaskValueSet 3,1,1
endif
if [sniff2#1floortemp]>[targetT#1floor] or [sniff#1floor]=0
mcpgpio,11,0
TaskValueSet 3,1,0
endif
As you can see, the next lines should use "clean" targetT#1floor, so the hysteresis is 0.5 degree.
Is there any other best practice except creating of dedicated dummy device?
TIA
Alexander
Well, in my case formula won't help since the whole piece of rule is:
if [sniff2#1floortemp]<[targetT#1floor]-0.3 and [sniff#1floor]=1
mcpgpio,11,1
TaskValueSet 3,1,1
endif
if [sniff2#1floortemp]>[targetT#1floor] or [sniff#1floor]=0
mcpgpio,11,0
TaskValueSet 3,1,0
endif
As you can see, the next lines should use "clean" targetT#1floor, so the hysteresis is 0.5 degree.
Is there any other best practice except creating of dedicated dummy device?
TIA
Alexander
Rgds,
Alexander
Alexander
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Maths in Rules malfunction?
Code: Select all
Let,1,[targetT#1floor]-0.3
If [sniff2#1floortemp]<[VAR#1] and [sniff#1floor]=1
mcpgpio,11,1
TaskValueSet 3,1,1
EndIf
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
-
- Normal user
- Posts: 10
- Joined: 05 Mar 2018, 23:06
Re: Maths in Rules malfunction?
Perfect! Thanks a lot.
I haven't heard about this function before.
Please consider adding it to the Wiki: https://www.letscontrolit.com/wiki/inde ... rial_Rules
TIA
Alexander
I haven't heard about this function before.
Please consider adding it to the Wiki: https://www.letscontrolit.com/wiki/inde ... rial_Rules
TIA
Alexander
Rgds,
Alexander
Alexander
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Maths in Rules malfunction?
That wiki is in the process of being replaced by "read the docs". It's not fully completed though.
https://espeasy.readthedocs.io/en/latest/
https://espeasy.readthedocs.io/en/latest/
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
-
- Normal user
- Posts: 10
- Joined: 05 Mar 2018, 23:06
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 36 guests