I’m trying to create an actionable notification that allows me to do one of three things once two people leave my house. My goal is the following:
If emilie and ignacio are not home, then send an actionable notification with three options. The first option turn off the lights, the second turn off the lights and sets the ac to eco mode, the third does nothing. After selecting the option and performing the action I get another notification confirming that the action was taken.
I’m having troubles figuring out how to do the logic so different actions are trigerred depending on what I select. How can I do that?
This is what I have right now:
alias: Left home test
description: ''
trigger:
- platform: state
entity_id: person.ignacio
from: home
to: not_home
for:
hours: 0
minutes: 5
seconds: 0
- platform: state
entity_id: person.emilie
from: home
to: not_home
for:
hours: 0
minutes: 5
seconds: 0
condition:
- condition: state
entity_id: person.ignacio
state: not_home
- condition: state
entity_id: person.emilie
state: not_home
action:
- service: notify.mobile_app_ignacio_s_phone
data:
message: Ignacio and Emilie are not home
data:
actions:
- action: lights_off
title: Lights off
- action: eco_mode
title: AC and Lights Off
- action: do_nothing
title: Dismiss
- wait_for_trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: lights_off
timeout: '00:01:00'
- service: scene.turn_on
target:
entity_id: scene.dark
metadata: {}
- device_id: 7ef1f854d63ea618053bab3dc8592e04
domain: climate
entity_id: climate.first_floor_hallway
type: set_preset_mode
preset_mode: eco
- service: notify.mobile_app_ignacio_s_phone
data:
message: Lights are off and AC is set to eco mode.
mode: single
Could you point me in the right direction?