From 9510cca4b538231e503a7aff3593a1e54bc739e1 Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Thu, 7 Jul 2022 18:33:05 -0400 Subject: [PATCH] Optionally shut down my computer when I head to bed --- packages/alexa.yaml | 28 ++++++++++++++++++++++++++++ scripts.yaml | 5 +++++ 2 files changed, 33 insertions(+) diff --git a/packages/alexa.yaml b/packages/alexa.yaml index 1c6611a..920fef9 100644 --- a/packages/alexa.yaml +++ b/packages/alexa.yaml @@ -43,6 +43,34 @@ automation: - service: light.turn_off entity_id: light.furnace_room_overhead + - id: 922740c8-0c23-4e71-81a8-f88de8b2a8ae + alias: Shut down computer at end of night + trigger: + - platform: event + event_type: alexa_actionable_notification + event_data: + event_id: actionable_notification_shutdown_computer + event_response_type: ResponseYes + id: shutdown_yes + - platform: event + event_type: alexa_actionable_notification + event_data: + event_id: actionable_notification_shutdown_computer + event_response_type: ResponseNo + id: shutdown_no + action: + - if: + - condition: trigger + id: shutdown-yes + then: + - service: script.tony_desktop_shutdown + - if: + - condition: trigger + id: shutdown-no + then: + - service: script.tony_desktop_lock + + script: activate_alexa_actionable_notification: description: 'Activates an actionable notification on a specific echo device' diff --git a/scripts.yaml b/scripts.yaml index 26fa2dc..2f397fc 100644 --- a/scripts.yaml +++ b/scripts.yaml @@ -229,6 +229,11 @@ going_upstairs: option: Side Nightlight target: entity_id: input_select.master_bedroom_scenes + - service: script.activate_alexa_actionable_notification + data_template: + text: 'Would you like me to shut down your computer?' + event_id: 'actionable_notification_shutdown_computer' + alexa_device: 'media_player.basement_echo_dot' mode: single icon: hue:room-stairs basement_on: