Email notification setup
MTBHuw last edited by
Hi, I'm trying to get an email notification set up for one of my sensors. I'm experimenting (on my desk at the moment!) with a HC-SR04 sensor so that I can measure water level in a tank. The sensor is working fine, and sending consistent readings to My Controller via my Serial Gateway.
I would like it to send me an email when the water level reaches a threshold of "x"cm. I've set this up in Rules with Condition Type "threshold", trigger when value from sensor is >=50cm. Then under Operations, I've asked it to email me this.
I assume I need to set up the email account, SMTP etc under Settings, which I've tried, but I keep getting a "400: Bad Request" when I test the connection. I'm trying to use my gmail account with the following settings:
Port : 465
From address : my gmail
Use SSL chosen
My username and password.
Any help appreciated again.
@mtbhuw Your setup should be looking as follows,
Do you see any warning message on your email? You have to allow this device.
MTBHuw last edited by
Hi, yes that's how I have it set up in My Controller. I've also set gmail to allow "less secure apps". I was getting the "400: Bad Request" message but as I type this and retrying the Test Connection, it seems to be working now. I'll try it out....
Hi, MyController (1.0.0) is a great job:-), works with smartsleep very well so far.
I am trying to set up a gmail notification, does not work with the settings above however.
When I press the test button I get the 400 error ... the respective gmail account is configured for low security.
Has google changed something in between?
Is gmail still working for you guys?
Just need to add: I am running Mycontroller on Windows 10 for now, could that be the reason I'm not able to get gmail notification working?
@iahim67 Can you list complete error details?
I get this when I hit the "test connection" button
@iahim67 Can you test with SMTP port as 465 and Use SSL and user name with @gmail.com
I did that already with the same result ... then I tried STARTTLS & 587.
Are you able to "ping" the server from the command line?
You should see the output like below
# ping smtp.gmail.com PING gmail-smtp-msa.l.google.com (188.8.131.52) 56(84) bytes of data. 64 bytes from 184.108.40.206: icmp_seq=1 ttl=44 time=13.4 ms 64 bytes from 220.127.116.11: icmp_seq=2 ttl=44 time=15.7 ms 64 bytes from 18.104.22.168: icmp_seq=3 ttl=44 time=104 ms 64 bytes from 22.214.171.124: icmp_seq=4 ttl=44 time=73.2 ms 64 bytes from 126.96.36.199: icmp_seq=5 ttl=44 time=41.1 ms 64 bytes from 188.8.131.52: icmp_seq=6 ttl=44 time=37.7 ms 64 bytes from 184.108.40.206: icmp_seq=7 ttl=44 time=50.8 ms ^C --- gmail-smtp-msa.l.google.com ping statistics --- 7 packets transmitted, 7 received, 0% packet loss, time 6009ms rtt min/avg/max/mdev = 13.407/48.175/104.992/29.960 ms
Can you check if there are no spaces in the servername field in mycontroller itself?
Port 587 is the TLS port, try to disable SSL and use port 25
does that work?
Yes, seems I am able to ping the server:
okay that is good so we know we can at least connect to the server.
How about disable SSL and use port 25? does that work?
One more thing to note, perhaps it helps: I am using Domoticz in parallel and I can send email notifications from Domoticz, the following does work:
@iahim67 can you investigate on network response?
right click on MyController page, select
Inspectalso check mycontrollor.log is there any error?
I get this: