One thing you will need to do is to change the Gmail security settings to “less secure”. https://support.google.com/accounts/answer/6010255?hl=en
Wonderful news everyone!
First let me say thank you very much for your patience and recommendations.
What I have determined from your help of course is that there is some configuration/preference settings within Notepad ++ that is adding spaces and/or tabs in places that are not intended. It seems that when I enter the scripts through the configuration window there is no issue but when I go back and edit with Notepad ++ things begin to fall apart. When I use just plain old Notepad it works without issue.
I’ll take a long look at the setting in Notepad++ and try to figure out what’s going on there. In the mean time, when using the configuration and script information supplied here, it works perfectly.
Again, I very much appreciate your support
Sorry,…just had to express my delight once more. Beyond setting up a test script, I’ve configured an automation that if/when the switch is turned on, an email and SMS message are sent and it works very very smoothly.
Glad you got it working, don’t worry the beginning can be very hard and scary but it gets alot better.
Happy new year and happy automations
Great information You shared regarding gmail, The same issue I am also facing doing mails via my Android phone using AOL account.It restricts me while changing password, I also checked while doing Delete AOL Account , If any other solution strikes to anyone’s mind , Feel free to share
Hey gus please Help me try this more than a Week
first… Now have to run this and the script block say this:
Script script.test_notification already running
but every time to fired up does nothing
my configyaml file is this…
notify:
- name: NOTIFIER
platform: smtp
server: smtp.gmail.com
port: 587
timeout: 15
sender: [email protected]
encryption: starttls
username: [email protected]
password: xxxxxxxx
recipient:
- [email protected]
sender_name: My Home Assistant
and scripts.yaml is this
test_notification:
alias: Test Notification
sequence:
- service: script.test_notification
data:
message: 'This is a test notification!'
Hope you have a solution for me
I tested the same settings, works for me.
Only thing you may miss is to allow less secure apps access
You can find it under google account , security
Less secure app access
To protect your account, apps and devices that use less secure sign-in technology are blocked. To keep your account secure, Google will automatically turn this setting OFF if it’s not being used. Learn more
So your script ‘test_notification’ runs ‘script.test_notification’ !! Looks like a closed loop. Try ‘service: notify.notifier’ instead.
I am running in to issues notifications sent with Gmail as well. I have verified account is enabled for less secure Apps access> I am also using this same account in a similar application with another open source home automation tool and is working fine only difference bing it uses SSL vs. Starttls supported in Home Assistant.
i do see the automation rule being triggered when the state changes. I am also seeing a pop up on the phone app with the message as a notification but no emails to my gmail account. i tried using notify.gmail for service but it gives an error.
Any suggestions greatly appreciated. Home Assistant version is 0.107.5 running on Raspberry PI
I have set the logger to info and it shows following:
2020-03-22 21:27:36 INFO (MainThread) [homeassistant.components.automation] Executing email notification when centralite outlet is off
2020-03-22 21:27:36 INFO (MainThread) [homeassistant.components.automation] email notification when centralite outlet is off: Running script
2020-03-22 21:27:36 INFO (MainThread) [homeassistant.components.automation] email notification when centralite outlet is off: Executing step call service
2020-03-22 21:27:36 INFO (MainThread) [homeassistant.components.mobile_app.notify] mobile_app push notification rate limits for iPhoness: 2 sent, 150 allowed, 0 errors, resets in 21:32:23
2020-03-22 21:28:02 INFO (MainThread) [homeassistant.components.automation] Executing email notification when centralite outlet is off
2020-03-22 21:28:02 INFO (MainThread) [homeassistant.components.automation] email notification when centralite outlet is off: Running script
2020-03-22 21:28:02 INFO (MainThread) [homeassistant.components.automation] email notification when centralite outlet is off: Executing step call service
2020-03-22 21:28:03 INFO (MainThread) [homeassistant.components.mobile_app.notify] mobile_app push notification rate limits for iPhoness: 3 sent, 150 allowed, 0 errors, resets in 21:31:56
2020-03-22 21:28:18 INFO (MainThread) [homeassistant.components.automation] Executing email notification when centralite outlet is off
2020-03-22 21:28:18 INFO (MainThread) [homeassistant.components.automation] email notification when centralite outlet is off: Running script
2020-03-22 21:28:18 INFO (MainThread) [homeassistant.components.automation] email notification when centralite outlet is off: Executing step call service
2020-03-22 21:28:18 INFO (MainThread) [homeassistant.components.mobile_app.notify] mobile_app push notification rate limits for iPhoness: 4 sent, 150 allowed, 0 errors, resets in 21:31:41
configuration.yaml
notify:
- name: My_Home_Demo
platform: smtp
server: smtp.gmail.com
port: 587
timeout: 15
sender: [email protected]
encryption: starttls
starttls: true
username: [email protected]
password: mypass
recipient:
- [email protected]
sender_name: My Home Assistant
automation.yaml
id: '1584771360186'
alias: email notification when centralite outlet is off
description: ''
trigger:
- entity_id: switch.cent_outlet_7
from: 'on'
platform: state
to: 'off'
condition: []
action:
- data:
message: Testing
service: notify.notify
I have this resolved now. changed the configurations as follows:
notify:
- name: gmail
platform: smtp
server: smtp.gmail.com
port: 587
timeout: 15
sender: [email protected]
encryption: starttls
starttls: true
username: [email protected]
password: mypass
recipient:
- [email protected]
sender_name: My Home Assistant
id: '1584771360186'
alias: email notification when centralite outlet is off
description: ''
trigger:
- entity_id: switch.cent_outlet_7
from: 'on'
platform: state
to: 'off'
condition: []
action:
- data:
message: Testing
service: notify.gmail