From c4cc9a333d73a47e211339b05f08c5c50842c602 Mon Sep 17 00:00:00 2001 From: Giorgio Ravera Date: Mon, 16 Dec 2019 08:52:50 +0100 Subject: [PATCH] Added away_mode actions --- automation/away_mode.yaml | 58 ++++++++++++++++++++++++++++++++++ automation/home_assistant.yaml | 25 --------------- 2 files changed, 58 insertions(+), 25 deletions(-) create mode 100644 automation/away_mode.yaml diff --git a/automation/away_mode.yaml b/automation/away_mode.yaml new file mode 100644 index 00000000..07e8cc5f --- /dev/null +++ b/automation/away_mode.yaml @@ -0,0 +1,58 @@ +###################################################################### +# Away Mode: Enable Action +###################################################################### + +- alias: "Modalità Vacanza: Azione on" + initial_state: 'on' + + trigger: + platform: state + entity_id: input_boolean.home_mode_away + to: 'on' + + action: + - service: script.notify_voice + data_template: + message: "Modalità vacanza abilitata" + +###################################################################### +# Away Mode: Disable Action +###################################################################### + +- alias: "Modalità Vacanza: Azione off" + initial_state: 'on' + + trigger: + platform: state + entity_id: input_boolean.home_mode_away + to: 'off' + + action: + - service: script.notify_voice + data_template: + message: "Modalità vacanza disabilitata" + +###################################################################### +# Away Mode: Disable +###################################################################### + +- alias: "Modalità Vacanza: Disattivazione" + initial_state: 'on' + + trigger: + - platform: zone + entity_id: + - device_tracker.google_maps_115265981849847357125 + - device_tracker.google_maps_103158638433668748797 + # - device_tracker.google_maps_113099283296073047871 + zone: zone.casa + event: enter + - platform: template + value_template: "{{ states('sensor.time_date') == (state_attr('input_datetime.away_mode_end', 'timestamp') | int | timestamp_custom('%H:%M, %Y-%m-%d', true)) }}" + + condition: [] + + action: + - service: input_boolean.turn_off + data: + entity_id: input_boolean.home_mode_away diff --git a/automation/home_assistant.yaml b/automation/home_assistant.yaml index 4002000d..d103521d 100644 --- a/automation/home_assistant.yaml +++ b/automation/home_assistant.yaml @@ -84,31 +84,6 @@ - service: script.volume_manager -###################################################################### -# Home Assistant: Management Away Mode -###################################################################### - -- alias: "Home Assistant: Modalità Vacanza" - initial_state: 'on' - - trigger: - - platform: zone - entity_id: - - device_tracker.google_maps_115265981849847357125 - - device_tracker.google_maps_103158638433668748797 - # - device_tracker.google_maps_113099283296073047871 - zone: zone.casa - event: enter - - platform: template - value_template: "{{ states('sensor.time_date') == (state_attr('input_datetime.away_mode_end', 'timestamp') | int | timestamp_custom('%H:%M, %Y-%m-%d', true)) }}" - - condition: [] - - action: - - service: input_boolean.turn_off - data: - entity_id: input_boolean.home_mode_away - ###################################################################### # Home Assistant: Management of Speech Notifications ###################################################################### -- 2.47.3