Page 1 of 1

ESPEASY V2.0 Notifications Syntax

Posted: 16 Apr 2017, 21:29
by Humanoidx
Does anyone know what the Rules Syntax is for the new Email Notifications on ESPEASY V 2.0?
I think the command is "Notify" but i'm not sure what is supposed to go after that.

Also, what is meant by domain in the notification setup page?
Image

I really appreciate the help.

Re: ESPEASY V2.0 Notifications Syntax

Posted: 18 Apr 2017, 21:07
by Martinus
The notification part within ESP Easy Mega is actually some unfinished development. I only ran some tests using the first entry in the notification list using a plain smtp server. There's a command to test this feature:

Notify <notification index id>,[<message body>]

I can use
Notify 1
or
Nofity 1,Demo Body text...

Re: ESPEASY V2.0 Notifications Syntax

Posted: 09 May 2017, 15:32
by alexpi01
To connect by SMTP to a mail server user/passw are needed. I don't see a way to connect...
Watching the log I could find that there was an attempt to connect but the connection was closed with error. Perhaps this is the error: no user/pass

Re: ESPEASY V2.0 Notifications Syntax

Posted: 04 Jun 2017, 23:32
by psy0rz
I created a practical example for notifications: https://www.letscontrolit.com/wiki/inde ... ifications

Re: ESPEASY V2.0 Notifications Syntax

Posted: 07 Jun 2017, 12:38
by BertB
v2.0.0-dev11is not yet available?

Re: ESPEASY V2.0 Notifications Syntax

Posted: 20 Jul 2017, 14:21
by subcamera
Hi,
is there any hint to solve the problem of required password while sending email-notifications?
THX
Joachim

Re: ESPEASY V2.0 Notifications Syntax

Posted: 28 Jul 2017, 02:24
by Carlini
psy0rz wrote: 04 Jun 2017, 23:32 I created a practical example for notifications: https://www.letscontrolit.com/wiki/inde ... ifications
How did you configured the SMTP ? Do you have emial without password ?

Re: ESPEASY V2.0 Notifications Syntax

Posted: 30 Jul 2017, 01:13
by psy0rz
yes i used my own mailserver so i didnt need a password.

find out your so called MX record of your maildomain, and deliver the mail directly on port 25.

you could use a site like https://mxtoolbox.com/ or just the "dig" command in linux.

Re: ESPEASY V2.0 Notifications Syntax

Posted: 30 Jul 2017, 01:14
by psy0rz
BertB wrote: 07 Jun 2017, 12:38 v2.0.0-dev11is not yet available?
it wasn't but it is now. :)

versions before dev11 have bugs in smtp notifications.

Re: ESPEASY V2.0 Notifications Syntax

Posted: 04 Jun 2018, 16:58
by riker1
Hi
is notification further developed?

Re: ESPEASY V2.0 Notifications Syntax

Posted: 04 Jun 2018, 18:25
by grovkillen
It's not prioritized no.

Re: ESPEASY V2.0 Notifications Syntax

Posted: 04 Jun 2018, 18:47
by riker1
ok, sad

Re: ESPEASY V2.0 Notifications Syntax

Posted: 05 Jun 2018, 07:18
by grovkillen
Yes, sad but we don't have very much time to spend on the project. Our daily job pays our bills.

Re: ESPEASY V2.0 Notifications Syntax

Posted: 05 Jun 2018, 14:09
by TD-er
Well, you can send emails using notifications from within rules.
But the number of mail-hosts accepting non-secure connections is rather limited.
I use SMTP2go as an intermediate, or you can use any Linux machine to route the mails.

Re: ESPEASY V2.0 Notifications Syntax

Posted: 02 Aug 2018, 12:50
by Sandominion
I ran crazy trying to send an E-Mail form my Sonoff before I found out about the missing SSL feature in ESPEasy.
Now I got a new account on one of the few providers left (smart-mail.de) with simple SMTP (w/o SSL), made it work with my device and found this discussion only afterwards.

Would be nice for the next users to add a NO-SSL hint in the corresponding Wiki article where this looks much easier:
https://www.letscontrolit.com/wiki/inde ... y_settings
I would change it by myself if the account Request for the Wiki wouldn't be more complex than for the SMTP-Email service.
It was difficult enough to register for this forum because I failed on your CAPTCHA check with drag and drop on different Android devices.

Can anybody tell me how to add a 2nd receipient?

Re: ESPEASY V2.0 Notifications Syntax

Posted: 03 Aug 2018, 21:55
by TD-er
I tried SMTP2go. Is also free, for a limited amount of mails per month (1000 I think)
Adding some warning on the info page on the wiki about it (and adding a link to the wiki if there isn't one of those questionmark buttons on the page) isn't a bad idea.

Re: ESPEASY V2.0 Notifications Syntax

Posted: 04 Aug 2018, 00:22
by Sandominion
TD-er wrote: 03 Aug 2018, 21:55 Adding some warning on the info page on the wiki about it (and adding a link to the wiki if there isn't one of those questionmark buttons on the page) isn't a bad idea.
Thanks for your answer. Indeed there is no hint or warning about SSL in your Wiki article about EasyNotifications (and I can't add any). Inside the Notification Settings of the running device there is a link to exactly this Wiki article already.

How about my question about 2nd Receiver? Do I have to separate them with comma or space or something or do I have to use another Notification for each recipient?

Re: ESPEASY V2.0 Notifications Syntax

Posted: 04 Aug 2018, 11:49
by TD-er
Sandominion wrote: 04 Aug 2018, 00:22
TD-er wrote: 03 Aug 2018, 21:55 Adding some warning on the info page on the wiki about it (and adding a link to the wiki if there isn't one of those questionmark buttons on the page) isn't a bad idea.
Thanks for your answer. Indeed there is no hint or warning about SSL in your Wiki article about EasyNotifications (and I can't add any). Inside the Notification Settings of the running device there is a link to exactly this Wiki article already.

How about my question about 2nd Receiver? Do I have to separate them with comma or space or something or do I have to use another Notification for each recipient?
You could try a comma separated list, as long as it fits in the fixed size "to" field.
See: https://tools.ietf.org/html/rfc2822#page-22

Re: ESPEASY V2.0 Notifications Syntax

Posted: 11 Aug 2018, 10:54
by Sandominion
Sandominion wrote: 04 Aug 2018, 00:22
TD-er wrote: 03 Aug 2018, 21:55 Adding some warning on the info page on the wiki about it (and adding a link to the wiki if there isn't one of those questionmark buttons on the page) isn't a bad idea.
Thanks for your answer. Indeed there is no hint or warning about SSL in your Wiki article about EasyNotifications (and I can't add any). Inside the Notification Settings of the running device there is a link to exactly this Wiki article already.
I've got an account for the Wiki and wrote not only a warning but a chapter about my experience:
https://www.letscontrolit.com/wiki/inde ... tification

TD-er wrote: 04 Aug 2018, 11:49
Sandominion wrote: 04 Aug 2018, 00:22 How about my question about 2nd Receiver? Do I have to separate them with comma or space or something or do I have to use another Notification for each recipient?
You could try a comma separated list, as long as it fits in the fixed size "to" field.
See: https://tools.ietf.org/html/rfc2822#page-22
I tried to seperate the Receivers with different seperators without success. What is the fixed size?

Re: ESPEASY V2.0 Notifications Syntax

Posted: 11 Aug 2018, 13:11
by TD-er
Sandominion wrote: 11 Aug 2018, 10:54 [...]
I've got an account for the Wiki and wrote not only a warning but a chapter about my experience:
https://www.letscontrolit.com/wiki/inde ... tification
Great :)
One remark about the examples given for the rules.
A space can be used in texts, since very recent builds, but then you have to use quotes like "This is a body with spaces"
I am not sure how spaces are currently interpreted in the rules parser, but at least in the past it was translated into a "," which is essentially a parameter separator.
Sandominion wrote: 11 Aug 2018, 10:54 [...]
I tried to seperate the Receivers with different seperators without success. What is the fixed size?
The fixed size is 64 bytes, which seems to include the trailing 0, so essentially it is 63 bytes.

A quick google search points me to this site: https://mailformat.dan.info/headers/from.html
If you need to put more than one e-mail address in a header, for instance when you wish to send a message to several people at once, the addresses are separated with commas, like this (with "simple" addresses):

jsmith@example.net, mjones@example.org

Or this (with names and addresses):

"John Smith" <jsmith@example.net>, "Mark Jones" <mjones@example.org>

The space after the comma is optional, but improves the readability. (The whitespace characters, space and tab, are allowed before or after each address within a header.)

Note that the comma (,) is the proper separator between multiple addresses, not the semicolon (;) or any other character. There are some mail programs that display lists of addresses with semicolons, and accept this format when taking input of addresses, but any standards-compliant program will actually use commas when transmitting the address list in a message header. There are reports that some mail programs launched by Web browsers in response to mailto: links require lists of multiple addresses within such a link to be separated by semicolons (and choke on comma-separated lists), while others are the opposite way; it is for reasons like this that it is not recommended that you use anything other than a single address in a mailto: link, even if there are standards documents allowing more complex values.

Re: ESPEASY V2.0 Notifications Syntax

Posted: 12 Aug 2018, 12:51
by Sandominion
Thanks for reading my Wiki artikle. I wasn't sure if somebody would be interested.
TD-er wrote: 11 Aug 2018, 13:11 A space can be used in texts, since very recent builds, but then you have to use quotes like "This is a body with spaces"
I am not sure how spaces are currently interpreted in the rules parser, but at least in the past it was translated into a "," which is essentially a parameter separator.
The body text in quotation marks works fine even inside Rules. I added it to the artikle. Thanks for the hint.

If you need to put more than one e-mail address in a header, for instance when you wish to send a message to several people at once, the addresses are separated with commas, like this (with "simple" addresses):

jsmith@example.net, mjones@example.org
That definitely does not work with ESPEasy Notifikation. I did many tests but the Email always goes out to the first Receiver only for example with filled in Receiver like:

Re: ESPEASY V2.0 Notifications Syntax

Posted: 12 Aug 2018, 21:39
by TD-er
I guess that's somewhere inbetween a "bug" and a "very much desired feature" :)
Can you make an issue for it on Github?

Re: ESPEASY V2.0 Notifications Syntax

Posted: 13 Aug 2018, 20:25
by Sandominion
TD-er wrote: 12 Aug 2018, 21:39 I guess that's somewhere inbetween a "bug" and a "very much desired feature" :)
Can you make an issue for it on Github?
I agree that it’s not really a bug.
According to the SMTP-Syntax in https://tools.ietf.org/html/rfc5321#section-4.1.1 the command RECIPIENT (RCPT) “is used to identify an individual recipient of the mail data; multiple recipients are specified by multiple uses of this command.”

I took a look inside the SMTP handling inside sources of ESPEasy and found the piece of code responsible for setting together the string for RCPT. There is foreseen the command only once for the one-and-only recipient:
if (!NPlugin_001_MTA(client, String(F("RCPT TO:<")) + notificationsettings.Receiver + ">", F("250 "))) break;
Seems it would be necessary to seek the string for (different) separators and distinguish the receivers. For each optional receiver there needs to be an extra RCPT command.
Are you sure it’s worth to create an issue for that (if nobody else has asked this feature)?

The alternative is to mention it in the Wiki that only one Receiver is allowed and you can create another notification with a second Receiver.
What do you think?

Re: ESPEASY V2.0 Notifications Syntax

Posted: 14 Aug 2018, 13:49
by TD-er
Just make an issue for it with your description of the request, just like you did here.
We also have to take a closer look at the size of some stored settings and how to use them.
This may be an excellent example how to improve it.

Re: ESPEASY V2.0 Notifications Syntax

Posted: 11 Dec 2018, 13:34
by HomeJCL
Hi

Lately SMTP2GO is getting erratic with Gmail (was announced from Gmail) but now arrives at a point to be nearly use less.

Has someone an alternative ?

Thanks

Re: ESPEASY V2.0 Notifications Syntax

Posted: 12 Dec 2018, 11:44
by Sandominion
HomeJCL wrote: 11 Dec 2018, 13:34 Lately SMTP2GO is getting erratic with Gmail (was announced from Gmail) but now arrives at a point to be nearly use less.
Has someone an alternative ?
For me www.smart-mail.de works fine.
In Wiki you find the server-settings etc. as Example 2:
www.letscontrolit.com/wiki/index.php/Ea ... tification

Re: ESPEASY V2.0 Notifications Syntax

Posted: 17 Dec 2018, 16:15
by angelo67
Hello,
sorry for my english (use google tratutore).
My question is this:
using email notification and everything works very well,
using its correct syntax :
"Notify <position>, [message_in_the_body]"

I would like to edit the text in the "[message_in_the_body]"
so that it is sent over several lines for an easier reading of the email.

I can change the text but everything is written on one very long line.
Type the <BR> command for the html.

thank you

Re: ESPEASY V2.0 Notifications Syntax

Posted: 17 Dec 2018, 18:32
by grovkillen
angelo67 wrote: 17 Dec 2018, 16:15 Hello,
sorry for my english (use google tratutore).
My question is this:
using email notification and everything works very well,
using its correct syntax :
"Notify <position>, [message_in_the_body]"

I would like to edit the text in the "[message_in_the_body]"
so that it is sent over several lines for an easier reading of the email.

I can change the text but everything is written on one very long line.
Type the <BR> command for the html.

thank you
You can try the system variables %R% and %N%

Re: ESPEASY V2.0 Notifications Syntax

Posted: 17 Dec 2018, 18:38
by grovkillen
%CR%, %SP% and %LF% might also be of help.

Re: ESPEASY V2.0 Notifications Syntax

Posted: 17 Dec 2018, 21:30
by angelo67
Hello,
thank you grovkillen

%CR% is very good
is like <BR> in HTML .
Now the email is very nice and simple to read

thank you

Re: ESPEASY V2.0 Notifications Syntax

Posted: 17 Dec 2018, 22:20
by grovkillen
Great! :)

Re: ESPEASY V2.0 Notifications Syntax

Posted: 18 Mar 2019, 10:46
by Temperotos
E-Mail at each time of sensor reading (becomes to many of them...)

Hello together,

I found quite a lot of information all over the wiki, got my notify rule running, but still one issue:
I basically want to get one mail, when it gets to cold and the danger of water could be freezing, which is damaging a pump.

on TEMP#Cel do
if [TEMP#Cel]<3.0
notify 1, "Temperature under 3°C! %CR% [TEMP#Cel]°C above the water."
endif
endon

But in this case I get a mail all 15 min, which is the interval of my sensor reading and gets annoying after a while.
I tried with a dummy switch, but there it's the same with the cycle I set. Just with a real GPIO - Switch input I find the toggling with e.g. a rising flank.

Is there any other idea or solution, maybe like latching, to do the event just one time, as long as the value is below the point and reset the latch after the temperature rises over 3°C again?

Thanks so far!

Re: ESPEASY V2.0 Notifications Syntax

Posted: 21 Mar 2019, 09:18
by Temperotos
I found a solution with a separate SW-switch, but if somebody has a more smart solution, let me know, cause here I need a switch for each temp. value I want a notification for.

on TEMP#Cel do
if [TEMP#Cel]>4.0
TaskValueSet 12,1,1
endif
endon
on Switch#Dummy1 do
if [[TEMP#Cel]<3 and [Switch#Dummy1]=1
notify 1, "Actual temp. above the water: [TEMP#Cel]°C"
TaskValueSet 12,1,0
endif
endon

Re: ESPEASY V2.0 Notifications Syntax

Posted: 15 Jul 2019, 04:42
by Sandominion
Temperotos wrote: 21 Mar 2019, 09:18 I found a solution with a separate SW-switch, but if somebody has a more smart solution, let me know...
I would solve it this way:

on TEMP#Cel do
if [TEMP#Cel]>4.0
TaskValueSet 12,1,0 //reactivate warning msg
endif
if [Switch#Dummy1]=0 do
if [TEMP#Cel]<3
notify 1, Actual_temp._above_the_water:_[TEMP#Cel]°C
TaskValueSet 12,1,1 //deactivate warning msg
endif
endif
endon

Re: ESPEASY V2.0 Notifications Syntax

Posted: 23 Mar 2020, 13:18
by duelago
Hello folks,

Old thread but I wonder if anyone else got this problem with email notifications. I'm running mega-20200310 and spent a couple of hours to get the notifications to work.
I have configured my device with a static ip and to use 8.8.8.8 as a dns. However, the only way to be able to communicate with an external SMTP-server is to use an IP-address instead of proper host name. I.e Everything works if I use 176.58.103.10 instead of mail.smtp2go.com No big deal as long as the mail service is not switching IP, but I would prefer a proper host name.

Any advice?

(I have followed the instructions at https://www.letscontrolit.com/wiki/inde ... ifications )

Best regards,
/David

Re: ESPEASY V2.0 Notifications Syntax

Posted: 23 Mar 2020, 19:53
by Shardan
At first check from a windows PC:
- open a CMD windows
- enter "nslookup mail.smtp2go.com" [enter]
nslookup should show the correct IP adress of the service.
If not, there is a problem with DNS in your network.

If the nslookup command works, check the DNS settings with the ESP,
there might be something wrong.