From 2a8c96e33644b4e83f037a46a96031e903aef554 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Tue, 9 Aug 2022 12:49:58 +0200 Subject: [PATCH] Actionable Notification --- packages/light/light_notifications.yaml | 39 +++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 packages/light/light_notifications.yaml diff --git a/packages/light/light_notifications.yaml b/packages/light/light_notifications.yaml new file mode 100644 index 0000000..7af664c --- /dev/null +++ b/packages/light/light_notifications.yaml @@ -0,0 +1,39 @@ +automation: + - alias: light_still_on_notification + mode: single + trigger: + - platform: state + entity_id: + - light.all_lights + from: "off" + to: "on" + for: + hours: 0 + minutes: 15 + seconds: 0 + condition: + - condition: state + entity_id: input_boolean.lights_needed + state: "off" + for: + hours: 0 + minutes: 15 + seconds: 0 + action: + - service: notify.mobile_app_iphone + data: + message: "Lights are still on." + data: + actions: + - action: "LIGHT_TURN_OFF" + title: Turn them off + - alias: light_still_on_notification_event + trigger: + - platform: event + event_type: mobile_app_notification_action + event_data: + action: "LIGHT_TURN_OFF" + action: + - service: light.turn_off + target: + entity_id: light.all_lights \ No newline at end of file