Page 1 of 1

I think this is wrong but ........

Posted: 20 Feb 2020, 02:14
by davecason
Hello,

Does anyone know if this is right for rule to sent a email?


Box#Temp do
if [Box#Temp]<97
notify,1,"Box temperature is [Box#Temp]°F!"
endif
endon


Cheers'
Dave :o

Re: I think this is wrong but ........

Posted: 20 Feb 2020, 03:08
by ThomasB
I see a typo on first line; Should be:

Code: Select all

on Box#Temp do
In case it matters, I would omit the first comma seen in your notify. Should be:

Code: Select all

notify 1, "Box temperature is [Box#Temp]°F!"
- Thomas

Re: I think this is wrong but ........

Posted: 20 Feb 2020, 03:33
by davecason
Hi Thomas,

Well thanks for the prompt reply - that was great !

So more like this, right !?


on Box#Temp do
if [Box#Temp]<97
notify 1,"Box temperature is [Box#Temp]°F!"
endif
endon


Cheers'
Dave

Re: I think this is wrong but ........

Posted: 20 Feb 2020, 14:28
by TD-er
Parsing of command parameters is maybe a bit counter-intuitive some times, but in the last few builds I made it a bit more user friendly.
See: https://espeasy.readthedocs.io/en/lates ... er-parsing

So the first comma should work also, as will the space.
When in doubt of strings not working, please try first to remove non standard ASCII characters, like the degree sign.
You can also replace that one with {D} See the system variables page on the node for more of these examples.