I am trying to subtract to values in a rule, but it looks like I am missing on the syntax. I have set up the following rule:
on BadNede do
TaskValueSet 2,1,%eventvalue%
if [Variables#BadNede]>32
TaskValueSet,2,1,32
endif
TaskValueSet 2,2,[Variables#BadNede - Floor#Bad-Nede]
timerSet,1,5
endon
Everything works as expected, except the line TaskValueSet 2,2,[Variables#BadNede - Floor#Bad-Nede], so there must be a syntax error. Can someone please correct me?
The log from ESPEasy shows the following:
EVENT: BadNede=28.50
310694: ACT : TaskValueSet 2,1,28.50
310705: Command: taskvalueset
310768: ACT : TaskValueSet 2,2,
Best regards
Ulf
Subtracting values of variables in rules
Moderators: grovkillen, Stuntteam, TD-er
Subtracting values of variables in rules
Last edited by ulfh2018 on 17 Mar 2019, 11:16, edited 1 time in total.
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Subtracting values of variables in rules
Code: Select all
TaskValueSet 2,2,[Variables#BadNede]-[Floor#Bad-Nede]
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
Re: Subtracting values of variables in rules
Thank you for your reply (Have'nt I seen you on another forum - you are Swedish if I'm not totally wrong)
Tried that. Result in the log file is like this:
504587: EVENT: BadNede=29.50
504609: ACT : TaskValueSet 2,1,29.50
504619: Command: taskvalueset
504679: ACT : TaskValueSet 2,2,29.50 - 25.69
Tried that. Result in the log file is like this:
504587: EVENT: BadNede=29.50
504609: ACT : TaskValueSet 2,1,29.50
504619: Command: taskvalueset
504679: ACT : TaskValueSet 2,2,29.50 - 25.69
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Subtracting values of variables in rules
Then do this:
And yep, I'm swedish. Located in Hudiksvall and part of the core team of ESP Easy. If you want, join the FB group "ESP Easy Sweden".
Code: Select all
TaskValueSet 2,2,([Variables#BadNede]-[Floor#Bad-Nede])
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
Re: Subtracting values of variables in rules
I'll be happy to join the group!
Still not working.
Have checked that there is a legal value of Floor#Bad-Nede and Variables#BadNede, but the log file now shows me the following result:
330822: HTTP: event,BadNede=29.00
330864: EVENT: BadNede=29.00
330884: ACT : TaskValueSet 2,1,29.00
330894: Command: taskvalueset
330954: ACT : TaskValueSet 2,2,(29.00-25.69)
It's a hard life
Still not working.
Have checked that there is a legal value of Floor#Bad-Nede and Variables#BadNede, but the log file now shows me the following result:
330822: HTTP: event,BadNede=29.00
330864: EVENT: BadNede=29.00
330884: ACT : TaskValueSet 2,1,29.00
330894: Command: taskvalueset
330954: ACT : TaskValueSet 2,2,(29.00-25.69)
It's a hard life
Re: Subtracting values of variables in rules
Sorry, must have had a typo. Now it works!
Thank you SOOOOO much
Thank you SOOOOO much
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 47 guests