Hey all,
I set up the following “Vacation Mode” automation. It works to send me an email:
# Vacation Mode
# Send an alert (currently email) on the state change of any of the following:
# Garage door, front door, front deadbolt.
- id: 'vacation_mode'
alias: Notifications for door activity
trigger:
- platform: state
entity_id: lock.schlage_be469_touchscreen_deadbolt_locked
- platform: state
entity_id: binary_sensor.neo_coolcam_doorwindow_detector_sensor
- platform: state
entity_id: sensor.garage_door_status
condition:
- condition: state
entity_id: input_boolean.vacation_mode
state: 'on'
action:
- alias: 'Send an email'
service: notify.gmail
data:
title: '[Home Assistant] Vacation Mode Alert!'
message: 'One of the following changed state: garage door, front door lock, front door.'
I would like to dynamically change the title and message attributes of the data sent to notify.gmail service based on the trigger. So for example, if sensor.garage_door_status changed from Open to Closed, I would like the title to read “[Home Assistant] Vacation Mode Alert: Garage Door” and the message to read “Garage door changed state from Closed to Open”
Is that possible?
How?
Thanks in advance!