From c803b91fea1239e705b6204f6163d71e24ac4d71 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Tue, 9 Aug 2022 15:12:46 +0200 Subject: [PATCH] device tracker network --- packages/light/light_notifications.yaml | 34 ++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/packages/light/light_notifications.yaml b/packages/light/light_notifications.yaml index 448f75f..1ecff3b 100644 --- a/packages/light/light_notifications.yaml +++ b/packages/light/light_notifications.yaml @@ -1,11 +1,10 @@ automation: - - alias: light_still_on_notification + - alias: light_still_on_still_needed_notify mode: single trigger: - platform: state entity_id: - light.all_lights - from: "off" to: "on" for: hours: 0 @@ -25,15 +24,42 @@ automation: message: "Lights are still on." data: actions: - - action: "LIGHT_TURN_OFF" + - action: "LIGHTTURNOFF" title: Turn them off icon: "sfsymbols:lightbulb" + + - alias: light_still_on_iphone_offline_notify + mode: single + trigger: + - platform: state + entity_id: + - device_tracker.pfsense_kais_iphone_wnsrt_de + to: not_home + for: + hours: 0 + minutes: 2 + seconds: 0 + condition: + - condition: state + entity_id: light.all_lights + state: "on" + action: + - service: notify.mobile_app_iphone + data: + message: "Lights are still on." + data: + actions: + - action: "LIGHTTURNOFF" + title: Turn them off + icon: "sfsymbols:lightbulb" + + - alias: light_still_on_notification_event trigger: - platform: event event_type: mobile_app_notification_action event_data: - action: "LIGHT_TURN_OFF" + action: "LIGHTTURNOFF" action: - service: light.turn_off target: