From 22c19375ac5dcb49e0648aa16c431537407aa5e4 Mon Sep 17 00:00:00 2001 From: CCOSTAN Date: Fri, 24 Nov 2023 20:47:51 +0000 Subject: [PATCH] Change the Lightning package --- config/.HA_VERSION | 2 +- config/packages/lightning.yaml | 28 +++++++--------------- config/script/notify_engine.yaml | 41 ++++++++++++++++++++------------ 3 files changed, 35 insertions(+), 36 deletions(-) diff --git a/config/.HA_VERSION b/config/.HA_VERSION index 1698e92f..110ab1ad 100755 --- a/config/.HA_VERSION +++ b/config/.HA_VERSION @@ -1 +1 @@ -2023.11.2 \ No newline at end of file +2023.11.3 \ No newline at end of file diff --git a/config/packages/lightning.yaml b/config/packages/lightning.yaml index f3a6890a..85d4ed38 100755 --- a/config/packages/lightning.yaml +++ b/config/packages/lightning.yaml @@ -11,33 +11,19 @@ input_boolean: initial: off icon: mdi:weather-lightning -ios: - push: - categories: - - name: Lightning - identifier: 'LIGHTNING' - actions: - - identifier: 'SNOOZE_LIGHTNING' - title: 'Snooze Alerts until tomorrow' - activationMode: 'background' - authenticationRequired: no - destructive: no - automation: - alias: Snooze Lightning id: 1f295bb8-8925-4b22-8f75-9l1ghtn1nga8 trigger: platform: event - event_type: ios.notification_action_fired + event_type: mobile_app_notification_action event_data: - actionName: SNOOZE_LIGHTNING + action: SNOOZE_LIGHTNING action: - service: input_boolean.turn_on entity_id: input_boolean.snooze_lightning - - - alias: 'Lightning Notification' id: 6e054688-5e75-48bd-9411-52a3e26264d1 mode: single @@ -57,13 +43,15 @@ automation: state: 'off' action: - - service: script.notify_engine + - service: script.notify_engine_two_button data: title: 'Lightning Warning!' value1: "Lightning has been detected within {{(states('sensor.blitzortung_lightning_distance') | int / 1.69) | round (1, 'floor')}} Miles of our home. Be careful if outdoors." - ios_category: "LIGHTNING" - who: 'family' - group: 'Alert' + title1: 'Snooze Alerts until tomorrow' + action1: 'SNOOZE_LIGHTNING' + icon1: 'sfsymbols:arrow.up.circle' + who: "Family" + group: 'Information' - service: script.speech_engine data: diff --git a/config/script/notify_engine.yaml b/config/script/notify_engine.yaml index 8672af1b..eb188c1c 100755 --- a/config/script/notify_engine.yaml +++ b/config/script/notify_engine.yaml @@ -1,23 +1,34 @@ ###################################################################################################### -###Script to send notifications to the mobile Phone! Call like this: - # action: - # service: script.notify_engine - # data: - # title: 'Ios Title' - # value1: 'Startup: Home Assistant is Up and Running!' - # value2: "{{ trigger.to_state.state }}" - # value3: - # who: "stacey | carlo | paige | family | parents" - # camera_entity: 'Camera.Camera' - # content-type: "jpeg" - # group: "Something_Unique" if important or information +### Script for Sending Notifications to Mobile Phones +# This script (`notify_engine`) and its variant (`notify_engine_two_button`) are designed to send +# customized notifications to specified recipients in Home Assistant. +# - The script dynamically chooses the notification service based on the 'who' parameter, +# allowing targeting individuals like Stacey, Carlo, or groups like family or parents. +# - Notifications include a title and a composite message from 'value1', 'value2', and 'value3'. +# - The script can optionally attach camera snapshots, specify notification groups, and set interruption levels. - # @CCOSTAN - # Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig +# Usage: +# To call this script, specify the action as `script.notify_engine` or `script.notify_engine_two_button` +# and provide the necessary data parameters: +# - 'title': The notification title. +# - 'value1', 'value2', 'value3': Components of the message. +# - 'who': Recipient identifier (e.g., 'stacey', 'carlo', 'paige', 'family', 'parents'). +# - 'camera_entity': Camera entity ID for snapshots (optional). +# - 'group': Notification group (optional, defaults to 'information'). +# - 'level': Interruption level for the notification (optional, defaults to 'active'). - # Need this script to work with Android? Check out this Video. https://youtu.be/mK1wdpxhLbM +# The 'notify_engine_two_button' variant includes additional parameters for two interactive buttons: +# - 'title1', 'title2': Titles for the action buttons. +# - 'action1', 'action2': Actions to be performed when buttons are pressed. +# - 'icon1', 'icon2': Icons for the buttons (optional). +# - 'destructive1', 'destructive2': Boolean flags to mark buttons as destructive (optional). + +# Author: @CCOSTAN +# Original Repository: https://github.com/CCOSTAN/Home-AssistantConfig +# Video Tutorial for Android Compatibility: https://youtu.be/mK1wdpxhLbM ###################################################################################################### + notify_engine: sequence: - condition: or