toto6976
(Toto6976)
September 22, 2024, 6:36pm
1
Good evening,
I am trying to send an image via gmail/smtp. I have this error in the yaml configuration logs
ERROR (MainThread) [homeassistant.components.automation] Automation with alias 'testNotifCapteurGmail' could not be validated and has been disabled: extra keys not allowed @ data['notify']. Got...........
Here is the yaml file :
- id: '1726841271819'
alias: testNotifCapteurGmail
description: ''
trigger:
- type: motion
platform: device
device_id: 739fb4b9a1cef0a2fe198b0425690bbe
entity_id: cc6af08550377575a85886a331a1a81c
domain: binary_sensor
for:
hours: 0
minutes: 0
seconds: 30
condition: []
action:
- action: camera.snapshot
metadata: {}
data:
filename: /media/Camera/Gabin.jpg
target:
entity_id: camera.192_168_1_xy
area_id: living_room
- action: notify.xxxxxx_gmail_com
data:
message: Gabin is at home
title: RetourGabin
notify:
- name: xxxxxx_gmail
platform: smtp
server: smtp.gmail.com
port: 587
timeout: 15
sender: [email protected]
encryption: starttls
username: [email protected]
password: abcdefghijklmnop
recipient:
- [email protected]
sender_name: toto
The notify
block:
notify:
- name: xxxxxx_gmail
platform: smtp
server: smtp.gmail.com
port: 587
timeout: 15
sender: [email protected]
encryption: starttls
username: [email protected]
password: abcdefghijklmnop
recipient:
- [email protected]
sender_name: toto
needs to go in configuration.yaml
… it doesn’t belong in your automations.yaml
file.
toto6976
(Toto6976)
September 22, 2024, 8:21pm
3
I don’t understand what you say.
tom_l
September 23, 2024, 2:37am
5
configuration.yaml
notify:
- name: xxxxxx_gmail
platform: smtp
server: smtp.gmail.com
port: 587
timeout: 15
sender: [email protected]
encryption: starttls
username: [email protected]
password: abcdefghijklmnop
recipient:
- [email protected]
sender_name: toto
automation.yaml:
- id: '1726841271819'
alias: testNotifCapteurGmail
description: ''
trigger:
- type: motion
platform: device
device_id: 739fb4b9a1cef0a2fe198b0425690bbe
entity_id: cc6af08550377575a85886a331a1a81c
domain: binary_sensor
for:
hours: 0
minutes: 0
seconds: 30
condition: []
action:
- action: camera.snapshot
metadata: {}
data:
filename: /media/Camera/Gabin.jpg
target:
entity_id: camera.192_168_1_xy
area_id: living_room
- action: notify.xxxxxx_gmail_com
data:
message: Gabin is at home
title: RetourGabin
toto6976
(Toto6976)
September 23, 2024, 7:11am
6
Good morning,
Thank you for your help. I read the article you sent me. That’s what I was planning to do but I’m not at home. However, I have access to my Home Assistant (NAT). On the other hand, I don’t have access to ‘File editor’!!
I can access File Editor via ssh??
A question: where should I enter the file in which the photo is located (/media/Camera/Gabin.jpg)? In Automations.yaml below - action: notify.xxxxxx_gmail_com? Or in configuration.yaml? In this case where?
tom_l
September 23, 2024, 7:15am
7
If you are running HA OS you can install this addon and access your config files over the web: Install VSCode Community Addon
toto6976
(Toto6976)
September 23, 2024, 7:17am
8
Hi,
No, i am running HA Supervised.
tom_l
September 23, 2024, 7:18am
9
You can install add-ons in that too.
toto6976
(Toto6976)
September 23, 2024, 7:20am
10
ok. I look at what it is.
toto6976
(Toto6976)
September 23, 2024, 7:58am
11
finally I saw that you could connect via ssh. I get along better with the console.
toto6976
(Toto6976)
September 23, 2024, 1:52pm
12
I changed as you told me but it’s still the same: I receive the notification without the image
Erreur : expected dict for dictionary value @ data['data']
tom_l
September 23, 2024, 9:54pm
13
Look at the examples here: https://www.home-assistant.io/integrations/smtp/#usage
action:
- action: notify.NOTIFIER_NAME
data:
title: "Good Morning"
message: "Rise and shine"
target:
- "[email protected] "
toto6976
(Toto6976)
September 24, 2024, 7:36am
14
Hi,
I think I read this article 10 times!! There’s definitely something I don’t understand !!!
Here is my ‘configuration.yaml’
notify:
- name: email
platform: smtp
server: smtp.gmail.com
port: 587
timeout: 15
sender: [email protected]
encryption: starttls
username: [email protected]
password: abcdefghijkl
recipient:
- [email protected]
sender_name: toto
data :
message: Gabin est rentré
title: RetourEcole
data:
file: /media/Camera/Gabin.jpg
And i call the ‘email.notify’ in the ‘automations.yaml’ like the example you told me about:
- action: notify.email
data:
title: RetourEcole
message: Gabin est à la maison
target:
- [email protected]
data:
images:
- /media/Camera/Gabin.jpg
Everything is ok. Thank you very much.