I’m trying to add an smtp notification component to this blueprint. I’ve added the notify_smtp: section and under action, the second alias. Admittedly, I don’t really know what I’m doing. I’ve just tried to replicate the notify mobile app sections, but that’s not working. I can’t get the selector to show my notify (smtp) options from my configuration.yaml. I just put config entry by guessing. Also, entity in the second action alias. Not sure what I should have in these places. Any help would be wonderful. thanks
blueprint:
name: Zone Notification
description: Send a notification to a device when a person leaves a specific zone.
domain: automation
source_url: https://github.com/home-assistant/core/blob/8d28da83ca4ac3a83617e0759fc17a559c7f288c/homeassistant/components/automation/blueprints/notify_leaving_zone.yaml
input:
person_entity:
name: Person
selector:
entity:
domain: person
zone_entity:
name: Zone
selector:
entity:
domain: zone
notify_device:
name: Device to notify
description: Device needs to run the official Home Assistant app to receive notifications.
selector:
device:
integration: mobile_app
notify_smtp:
name: Person to notify by text
description: Uses smtp.comcast.net to send text via email
selector:
config_entry:
integration: notify
trigger:
platform: state
entity_id: !input person_entity
variables:
zone_entity: !input zone_entity
# This is the state of the person when it's in this zone.
zone_state: "{{ states[zone_entity].name }}"
person_entity: !input person_entity
person_name: "{{ states[person_entity].name }}"
condition:
condition: template
# The first case handles leaving the Home zone which has a special state when zoning called 'home'.
# The second case handles leaving all other zones.
value_template: "{{ zone_entity == 'zone.home' and trigger.from_state.state == 'home' and trigger.to_state.state != 'home' or trigger.from_state.state == zone_state and trigger.to_state.state != zone_state }}"
action:
- alias: "Notify that a person has left the zone"
domain: mobile_app
type: notify
device_id: !input notify_device
message: "{{ person_name }} has left {{ zone_state }}"
- alias: "Notify that a person has left the zone"
domain: smtp
type: notify
entity: !input notify_smtp
message: "{{ person_name }} has left {{ zone_state }}"
My config.yaml section for notify smtp is like this:
# notifications via comcast smtp
notify:
- name: "ken"
platform: smtp
server: "smtp.comcast.net"
port: 587
timeout: 15
sender: "[email protected]"
encryption: starttls
username: "[email protected]"
password: "password"
recipient:
- "[email protected]"
sender_name: "Home Assistant"