diff --git a/config/packages/garadget.yaml b/config/packages/garadget.yaml index f8ab6042..25f38287 100755 --- a/config/packages/garadget.yaml +++ b/config/packages/garadget.yaml @@ -22,7 +22,6 @@ # payload_close: "close" # payload_stop: "stop" - mqtt: cover: - name: "Large Garage Door" @@ -69,10 +68,66 @@ group: # - cover.small_garage_door ###################################################################### -## Garage Status Announcements - Only during normal hours. +## Send a notification to anyone coming home asking if they want to open the garage door. ###################################################################### automation: + - alias: 'Garage Helper' + id: 365adc21-5e96-4e78-9e94-089901a29430 + mode: parallel + trigger: + - platform: state + entity_id: + - person.carlo + - person.stacey + from: 'not_home' + to: 'home' + condition: + - condition: state + entity_id: cover.large_garage_door + state: 'closed' + action: + - variables: + person_triggered: "{{ trigger.to_state.entity_id.split('.')[1] }}" + - service: script.notify_engine_two_button + data: + title: 'Welcome Home!' + value1: 'Open Garage Door?' + title1: 'Yes' + action1: 'OPEN_LARGE_GARAGE' + icon1: 'sfsymbols:arrow.up.circle' + destructive1: 'false' + title2: 'No' + action2: 'NO_OPEN_LARGE_GARAGE' + icon2: 'sfsymbols:house.circle' + destructive2: 'true' + who: "{{ person_triggered }}" + apns_id: 'Welcome_Home' + + - alias: 'Open Large Garage Door Action' + id: 85e02a74-2ecc-4815-95a6-db864a6dffd7 + trigger: + platform: event + event_type: mobile_app_notification_action + event_data: + action: OPEN_LARGE_GARAGE + condition: + - condition: state + entity_id: cover.large_garage_door + state: 'closed' + - condition: state + entity_id: group.family + state: 'home' + action: + - service: cover.open_cover + entity_id: cover.large_garage_door + + + +###################################################################### +## Garage Status Announcements - Only during normal hours. +###################################################################### + - alias: 'Update Garage Get-Status' id: 2b9e8359-c189-4399-b415-50107513fe90 trigger: @@ -242,3 +297,4 @@ automation: - service: script.speech_engine data: value1: "Please check the garage doors. The Small garage is {{ states('cover.small_garage_door')}} and the large garage is {{ states('cover.large_garage_door')}}" + diff --git a/config/script/notify_engine.yaml b/config/script/notify_engine.yaml index 8ff77835..6343278a 100755 --- a/config/script/notify_engine.yaml +++ b/config/script/notify_engine.yaml @@ -1,5 +1,5 @@ ###################################################################################################### -###Script to send notifications to IFTTT to notify me on the mobile Phone! Call like this: +###Script to send notifications to the mobile Phone! Call like this: # action: # service: script.notify_engine # data: @@ -12,8 +12,6 @@ # content-type: "jpeg" # apns_id: "Something_Unique" if important or information - # IFTTT Maker channel should look like this: https://files.gitter.im/home-assistant/home-assistant/phkx/blob - # @CCOSTAN # Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig @@ -27,8 +25,6 @@ notify_engine: - condition: state entity_id: input_boolean.text_notifications state: 'on' - # - service: ifttt.trigger - # data: {"event":"notify_engine", "value1":"{{ value1 }}", "value2":"{{ value2 }}", "value3":"{{ value3 }}"} - service: > {% if who == 'stacey' %} @@ -49,13 +45,40 @@ notify_engine: apns_headers: 'apns-collapse-id': "{{ apns_id }}" push: -# sound: "{{ ios_sound }}" -# badge: "{{ ios_badge }}" -# interruption-level: time-sensitive -# interruption-level: critical category: "{{ ios_category }}" entity_id: "{{ camera_entity }}" - # attachment: - # url: "{{ url }}" - # content-type: "{{ content_type }}" - # hide-thumbnail: false + +notify_engine_two_button: + sequence: + - condition: or + conditions: + - condition: state + entity_id: input_boolean.text_notifications + state: 'on' + + - service: > + {% if who == 'stacey' %} + notify.mobile_app_stacey_iphone11 + {% elif who == 'carlo' %} + notify.mobile_app_carlo_xsmax + {% elif who == 'parents' %} + notify.ios_parents + {% elif who == 'family' %} + notify.ios_family + {% else %} + notify.ios_family + {% endif %} + data: + message: "{{ value1 }} {{ value2 }} {{ value3 }}" + title: "{{ title|default('', true) }}" + data: + actions: + - title: "{{ title1|default('', true) }}" + action: "{{ action1 }}" + icon: "{{ icon1|default ('sfsymbols:house.circle', true) }}" + destructive: "{{ destructive1|default('false', true) }}" + - title: "{{ title2|default('', true) }}" + action: "{{ action2 }}" + icon: "{{ icon2|default ('sfsymbols:house.circle', true) }}" + destructive: "{{ destructive2|default('false', true) }}" + apns_id: "{{ apns_id }}"