ESPEASY V2.0 Notifications Syntax

Moderators: Voyager, BertB, rtenklooster, Stuntteam

Forum rules
You have entered the experimental forum, beware!!!
Post Reply
Message
Author
Humanoidx
Normal user
Posts: 8
Joined: 01 Apr 2017, 20:50

ESPEASY V2.0 Notifications Syntax

#1 Post by Humanoidx » 16 Apr 2017, 21:29

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.

Martinus

Re: ESPEASY V2.0 Notifications Syntax

#2 Post by Martinus » 18 Apr 2017, 21:07

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...

alexpi01
Normal user
Posts: 2
Joined: 20 Feb 2017, 13:26

Re: ESPEASY V2.0 Notifications Syntax

#3 Post by alexpi01 » 09 May 2017, 15:32

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

psy0rz
Normal user
Posts: 232
Joined: 02 Feb 2017, 12:12

Re: ESPEASY V2.0 Notifications Syntax

#4 Post by psy0rz » 04 Jun 2017, 23:32

I created a practical example for notifications: https://www.letscontrolit.com/wiki/inde ... ifications
Please support ESPEasy development via Patreon or buy us a coffee.

BertB
Normal user
Posts: 982
Joined: 25 Apr 2015, 14:39

Re: ESPEASY V2.0 Notifications Syntax

#5 Post by BertB » 07 Jun 2017, 12:38

v2.0.0-dev11is not yet available?

subcamera
Normal user
Posts: 2
Joined: 20 Jul 2017, 14:14

Re: ESPEASY V2.0 Notifications Syntax

#6 Post by subcamera » 20 Jul 2017, 14:21

Hi,
is there any hint to solve the problem of required password while sending email-notifications?
THX
Joachim

Carlini
Normal user
Posts: 16
Joined: 09 Apr 2017, 17:45
Location: Brazil

Re: ESPEASY V2.0 Notifications Syntax

#7 Post by Carlini » 28 Jul 2017, 02:24

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 ?

psy0rz
Normal user
Posts: 232
Joined: 02 Feb 2017, 12:12

Re: ESPEASY V2.0 Notifications Syntax

#8 Post by psy0rz » 30 Jul 2017, 01:13

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.
Please support ESPEasy development via Patreon or buy us a coffee.

psy0rz
Normal user
Posts: 232
Joined: 02 Feb 2017, 12:12

Re: ESPEASY V2.0 Notifications Syntax

#9 Post by psy0rz » 30 Jul 2017, 01:14

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.
Please support ESPEasy development via Patreon or buy us a coffee.

riker1
Normal user
Posts: 188
Joined: 26 Dec 2017, 18:02

Re: ESPEASY V2.0 Notifications Syntax

#10 Post by riker1 » 04 Jun 2018, 16:58

Hi
is notification further developed?

User avatar
grovkillen
Normal user
Posts: 2382
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: ESPEASY V2.0 Notifications Syntax

#11 Post by grovkillen » 04 Jun 2018, 18:25

It's not prioritized no.
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 :idea: :idea: :idea:

riker1
Normal user
Posts: 188
Joined: 26 Dec 2017, 18:02

Re: ESPEASY V2.0 Notifications Syntax

#12 Post by riker1 » 04 Jun 2018, 18:47

ok, sad

User avatar
grovkillen
Normal user
Posts: 2382
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: ESPEASY V2.0 Notifications Syntax

#13 Post by grovkillen » 05 Jun 2018, 07:18

Yes, sad but we don't have very much time to spend on the project. Our daily job pays our bills.
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 :idea: :idea: :idea:

TD-er
Normal user
Posts: 1158
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESPEASY V2.0 Notifications Syntax

#14 Post by TD-er » 05 Jun 2018, 14:09

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.

Sandominion
Normal user
Posts: 7
Joined: 02 Aug 2018, 12:36

Re: ESPEASY V2.0 Notifications Syntax

#15 Post by Sandominion » 02 Aug 2018, 12:50

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?

TD-er
Normal user
Posts: 1158
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESPEASY V2.0 Notifications Syntax

#16 Post by TD-er » 03 Aug 2018, 21:55

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.

Sandominion
Normal user
Posts: 7
Joined: 02 Aug 2018, 12:36

Re: ESPEASY V2.0 Notifications Syntax

#17 Post by Sandominion » 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?

TD-er
Normal user
Posts: 1158
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESPEASY V2.0 Notifications Syntax

#18 Post by TD-er » 04 Aug 2018, 11:49

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

Sandominion
Normal user
Posts: 7
Joined: 02 Aug 2018, 12:36

Re: ESPEASY V2.0 Notifications Syntax

#19 Post by Sandominion » 11 Aug 2018, 10:54

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?

TD-er
Normal user
Posts: 1158
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESPEASY V2.0 Notifications Syntax

#20 Post by TD-er » 11 Aug 2018, 13:11

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.

Sandominion
Normal user
Posts: 7
Joined: 02 Aug 2018, 12:36

Re: ESPEASY V2.0 Notifications Syntax

#21 Post by Sandominion » 12 Aug 2018, 12:51

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:

TD-er
Normal user
Posts: 1158
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESPEASY V2.0 Notifications Syntax

#22 Post by TD-er » 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?

Sandominion
Normal user
Posts: 7
Joined: 02 Aug 2018, 12:36

Re: ESPEASY V2.0 Notifications Syntax

#23 Post by Sandominion » 13 Aug 2018, 20:25

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?

TD-er
Normal user
Posts: 1158
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESPEASY V2.0 Notifications Syntax

#24 Post by TD-er » 14 Aug 2018, 13:49

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.

HomeJCL
Normal user
Posts: 47
Joined: 03 Feb 2018, 10:42

Re: ESPEASY V2.0 Notifications Syntax

#25 Post by HomeJCL » 11 Dec 2018, 13:34

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
Belgium and land of ESP ... counting :D

Sandominion
Normal user
Posts: 7
Joined: 02 Aug 2018, 12:36

Re: ESPEASY V2.0 Notifications Syntax

#26 Post by Sandominion » 12 Dec 2018, 11:44

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

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests