not sure if this works
i know i can compare 1 or multiple variables but am not sure if i can do calculations
on MQTT#value do
if [AAA#Total] - [BBB#Total] =1
do your thing
endif
Endon
can i do this in rules
Moderators: grovkillen, Stuntteam, TD-er
Re: can i do this in rules
The calculations are not (yet) working everywhere, so it is best to store them in a variable first as the "Let" command (to store some value in a variable) is for sure calling all calculation functions.
Then you can compare based on this variable:
if [var#1] = 1 .....
or using the "int" representation of that same variable:
if [int#1] = 1 .....
N.B.
The recently introduced functions with {} are parsed first (just like %eventvalue%), before the calculation functions are called.
This means that if you need to calculate something first before you can use it in such a {} function, you should store it in a variable first.
Then you can compare based on this variable:
if [var#1] = 1 .....
or using the "int" representation of that same variable:
if [int#1] = 1 .....
N.B.
The recently introduced functions with {} are parsed first (just like %eventvalue%), before the calculation functions are called.
This means that if you need to calculate something first before you can use it in such a {} function, you should store it in a variable first.
Re: can i do this in rules
thanks.
changed the code so i can only check on 1 variable [VAR#2]
changed the code so i can only check on 1 variable [VAR#2]
Re: can i do this in rules
Good day. to not start a new topic, tell me.
I need to send a number in 3 character format like 071, 007 to the server.
71 or 7 is in this case the value of the temperature sensor.
can I create a rule with a dummy intermediate device with conventions where the result would be the addition of zeros?
let's say so:
...
TaskValueSet,3,2,00[BME#Temperature]
...
I need to send a number in 3 character format like 071, 007 to the server.
71 or 7 is in this case the value of the temperature sensor.
can I create a rule with a dummy intermediate device with conventions where the result would be the addition of zeros?
let's say so:
...
TaskValueSet,3,2,00[BME#Temperature]
...
Re: can i do this in rules
The value for TaskValueSet is stored in a type float variable, so any prefixing zeroes will get lost/ignored immediately.
Have a look at the formatting & justification feature of the variable expansion that you could apply when sending to a (external?) destination, documentation is over here
Edit:
You could use something like this:
Have a look at the formatting & justification feature of the variable expansion that you could apply when sending to a (external?) destination, documentation is over here
Edit:
You could use something like this:
Code: Select all
...
SendToHTTP,externalhost.com,80,/url/with?value=[BME#Temperature#D3]
...
/Ton (PayPal.me)
Re: can i do this in rules
thanks for the hint! it seems that this is just what is needed. I'm still a new user, and it's hard for me to understand. but I figured out what I needed to do!
Who is online
Users browsing this forum: No registered users and 25 guests