would need to add date and some variables in the email notification
Moderators: grovkillen, Stuntteam, TD-er
-
- Normal user
- Posts: 115
- Joined: 21 Dec 2017, 11:09
would need to add date and some variables in the email notification
I run a SONOFF S20 with the normal 1MB v2.0-20180120.
I use 3 different rules (boot, switched on , switched off) with 3 different "notify email" statements.
1) %sysmonth%, %sysyear% and %sysday% don't work.
I have read the forum but I don't understand if I would need to compile the sources by myself or if it is already or will be included in a "normal" version
2) Would be it possible to pass some parameters (variable) to the email notification, using a %xxx% that the rule would have stored. So the same "notify" could be used for different events.
3) Today the syntax is "notify 1,blabla" , It seems that "blabla" is used in the body of the mail, but whatever the event, it is always the "blabla" which comes from the event 1. The right "blabla" is written in the SYSLOG along with the notify command.
Thanks
Gilles
I use 3 different rules (boot, switched on , switched off) with 3 different "notify email" statements.
1) %sysmonth%, %sysyear% and %sysday% don't work.
I have read the forum but I don't understand if I would need to compile the sources by myself or if it is already or will be included in a "normal" version
2) Would be it possible to pass some parameters (variable) to the email notification, using a %xxx% that the rule would have stored. So the same "notify" could be used for different events.
3) Today the syntax is "notify 1,blabla" , It seems that "blabla" is used in the body of the mail, but whatever the event, it is always the "blabla" which comes from the event 1. The right "blabla" is written in the SYSLOG along with the notify command.
Thanks
Gilles
-
- Normal user
- Posts: 70
- Joined: 24 Jan 2018, 15:20
Re: would need to add date and some variables in the email notification
I would love to see this work also. Would be great at boot to email %sysname% and %ip% to myself.
-
- Core team member
- Posts: 9905
- Joined: 01 Sep 2017, 22:13
- Location: the Netherlands
Re: would need to add date and some variables in the email notification
Could you please test with one of the latest builds?
I have changed the way how system variables are used a few days ago and it was merged 3 or 4 days ago I guess.
The change is that now all occurrences of using these variables is now done the same way.
So all should now support the same variables.
See this pull request: https://github.com/letscontrolit/ESPEasy/pull/757
If it still doesn't work, please open an issue on Github for it.
I have changed the way how system variables are used a few days ago and it was merged 3 or 4 days ago I guess.
The change is that now all occurrences of using these variables is now done the same way.
So all should now support the same variables.
See this pull request: https://github.com/letscontrolit/ESPEasy/pull/757
If it still doesn't work, please open an issue on Github for it.
-
- Normal user
- Posts: 70
- Joined: 24 Jan 2018, 15:20
Re: would need to add date and some variables in the email notification
I will try this asap, likely Sunday or Monday.
Thanks
Thanks
-
- Normal user
- Posts: 115
- Joined: 21 Dec 2017, 11:09
Re: would need to add date and some variables in the email notification
It works,
congrat
Here is the configuration that I use :
THE RULE SECTION:
On AL do
gpio,12,1
notify 1
EndOn
THE NOTIFY SECTION:
Subject: %sysname% a été activée %sysday% %sysmonth% %sysyear% %systime%
Body : La prise 2 a été activée
The subject of the mail that I receive is :"Prise2 - Bureau a été activée 27 01 2018 18:30:52 " which is the subject of the notify section so is correct
The body of the mail contains the body of the mail from the Notify section("La prise 2 a été activée") so works well.
NB : I have tried to replace "notify 1" with "notify 1,La prise 2 a été activée". In this case the body of the mail that I receive contains the first word of the "notify 1,La prise 2 a été activée" command, I mean that I only receive the word "La". It overrides the configuration of the mail from the notify section, but it takes only the first word. If you link all the words with an underscore , then it will show you the entire sentence.
Hope it helps
Gilles
congrat
Here is the configuration that I use :
THE RULE SECTION:
On AL do
gpio,12,1
notify 1
EndOn
THE NOTIFY SECTION:
Subject: %sysname% a été activée %sysday% %sysmonth% %sysyear% %systime%
Body : La prise 2 a été activée
The subject of the mail that I receive is :"Prise2 - Bureau a été activée 27 01 2018 18:30:52 " which is the subject of the notify section so is correct
The body of the mail contains the body of the mail from the Notify section("La prise 2 a été activée") so works well.
NB : I have tried to replace "notify 1" with "notify 1,La prise 2 a été activée". In this case the body of the mail that I receive contains the first word of the "notify 1,La prise 2 a été activée" command, I mean that I only receive the word "La". It overrides the configuration of the mail from the notify section, but it takes only the first word. If you link all the words with an underscore , then it will show you the entire sentence.
Hope it helps
Gilles
-
- Normal user
- Posts: 115
- Joined: 21 Dec 2017, 11:09
Re: would need to add date and some variables in the email notification
nothing to add. Just to allow me to tick the "Notify me when a reply is posted" 

-
- Core team member
- Posts: 9905
- Joined: 01 Sep 2017, 22:13
- Location: the Netherlands
Re: would need to add date and some variables in the email notification
Maybe @Grovkillen knows some workaround?
If not, then you may have found a bug (the first one in at least like... 5 minutes or so), which needs its own entry on the issue page of Github. https://github.com/letscontrolit/ESPEasy/issues
If not, then you may have found a bug (the first one in at least like... 5 minutes or so), which needs its own entry on the issue page of Github. https://github.com/letscontrolit/ESPEasy/issues
-
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
Re: would need to add date and some variables in the email notification
I think the way we allow spaces instead of only allowing comma (,) is the problem here.
This code will replace each and every one of the spaces in the command.
https://github.com/letscontrolit/ESPEas ... c.ino#L215 as an example...
Code: Select all
tmpString.replace(" ", ",");
https://github.com/letscontrolit/ESPEas ... c.ino#L215 as an example...
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



-
- Normal user
- Posts: 70
- Joined: 24 Jan 2018, 15:20
Re: would need to add date and some variables in the email notification
So, I am trying to set up a notifier to send email thru gmail.
The options I see are as follows:
Fully qualified domain name of SMTP service
Configuration requirements
smtp-relay.gmail.com
Options: Port 25, 465, or 587
Secure Socket Layer (SSL)/Transport Layer Security (TLS) protocols.
One or more static IP addresses are required.
smtp.gmail.com
Port 465 (SSL required)
Port 587 (TLS required)
Dynamic IPs allowed
aspmx.l.google.com
Port 25
TLS not required
Dynamic IPs allowed
Mail can only be sent to Gmail or G Suite users.
It looks like I would need to use the last option.
I have set the unit up to notify at boot to notify 1 with the listed options.... not sure what to put in the domain field.
I get the following errors logged on serial on boot:
ACT : Notify 1
Timeout while reading input data!
Timeout while reading input data!
Timeout while reading input data!
EMAIL: Connection Closed With Error
Has anyone made this work with gmail?
The options I see are as follows:
Fully qualified domain name of SMTP service
Configuration requirements
smtp-relay.gmail.com
Options: Port 25, 465, or 587
Secure Socket Layer (SSL)/Transport Layer Security (TLS) protocols.
One or more static IP addresses are required.
smtp.gmail.com
Port 465 (SSL required)
Port 587 (TLS required)
Dynamic IPs allowed
aspmx.l.google.com
Port 25
TLS not required
Dynamic IPs allowed
Mail can only be sent to Gmail or G Suite users.
It looks like I would need to use the last option.
I have set the unit up to notify at boot to notify 1 with the listed options.... not sure what to put in the domain field.
I get the following errors logged on serial on boot:
ACT : Notify 1
Timeout while reading input data!
Timeout while reading input data!
Timeout while reading input data!
EMAIL: Connection Closed With Error
Has anyone made this work with gmail?
-
- Normal user
- Posts: 115
- Joined: 21 Dec 2017, 11:09
Re: would need to add date and some variables in the email notification
I don't use gmail, but I think that you should configure your internet provider smtp server and domain instead of the gmail ones. There are a lot of posts about this.
Gilles
Gilles
-
- Normal user
- Posts: 88
- Joined: 01 May 2017, 20:35
Re: would need to add date and some variables in the email notification
I think gmail requires username and password which are not in ESPEasy.
Who is online
Users browsing this forum: Anthropic Claude Bot [bot] and 17 guests