Simplify text notifications down to a single script
And it didn't even lose any functionality!
This commit is contained in:
@ -13,12 +13,13 @@
|
|||||||
action:
|
action:
|
||||||
- service: script.max_brightness
|
- service: script.max_brightness
|
||||||
data: {}
|
data: {}
|
||||||
- service: script.text_urgent_alert
|
- service: script.text_notify
|
||||||
data:
|
data:
|
||||||
who: all
|
type: Critical
|
||||||
title: Tornado Warning - TAKE COVER!
|
title: Tornado Warning - TAKE COVER!
|
||||||
message: The National Weather Service has issued a Tornado Warning for our area.
|
message: The National Weather Service has issued a Tornado Warning for our area.
|
||||||
Take Cover NOW!!!!
|
Take Cover NOW!!!!
|
||||||
|
who: all
|
||||||
alias: CRITICAL PHONE ALERT
|
alias: CRITICAL PHONE ALERT
|
||||||
- service: script.tv_notify
|
- service: script.tv_notify
|
||||||
data:
|
data:
|
||||||
@ -433,8 +434,9 @@
|
|||||||
- sensor.tony_s_iphone_battery_level
|
- sensor.tony_s_iphone_battery_level
|
||||||
- sensor.tony_s_ipad_battery_level
|
- sensor.tony_s_ipad_battery_level
|
||||||
actions:
|
actions:
|
||||||
- service: script.text_alert
|
- service: script.text_notify
|
||||||
data:
|
data:
|
||||||
|
type: normal
|
||||||
who: all
|
who: all
|
||||||
title: Low Batteries in House
|
title: Low Batteries in House
|
||||||
message: 'Low battery alert for: {{sensors}}'
|
message: 'Low battery alert for: {{sensors}}'
|
||||||
|
Submodule node-red/projects/NerdFlows updated: e0c8a7c451...61617a7aca
@ -182,8 +182,9 @@ automation:
|
|||||||
entity_id: sensor.garbage_collection_large_pickup
|
entity_id: sensor.garbage_collection_large_pickup
|
||||||
state: '1'
|
state: '1'
|
||||||
then:
|
then:
|
||||||
- service: script.text_alert
|
- service: script.text_notify
|
||||||
data:
|
data:
|
||||||
|
type: alert
|
||||||
who: "all"
|
who: "all"
|
||||||
title: "Garbage Collection - Unlimited"
|
title: "Garbage Collection - Unlimited"
|
||||||
message: "Tomorrow is large trash pickup day. Please take out all large items, and don't forget the trash can!"
|
message: "Tomorrow is large trash pickup day. Please take out all large items, and don't forget the trash can!"
|
||||||
@ -193,8 +194,9 @@ automation:
|
|||||||
entity_id: sensor.garbage_collection
|
entity_id: sensor.garbage_collection
|
||||||
state: '1'
|
state: '1'
|
||||||
then:
|
then:
|
||||||
- service: script.text_alert
|
- service: script.text_notify
|
||||||
data:
|
data:
|
||||||
|
type: alert
|
||||||
who: "all"
|
who: "all"
|
||||||
title: "Garbage Collection - Regular"
|
title: "Garbage Collection - Regular"
|
||||||
message: "Tomorrow is regular trash pickup day. Make sure the trash can is taken to the curb!"
|
message: "Tomorrow is regular trash pickup day. Make sure the trash can is taken to the curb!"
|
||||||
@ -214,8 +216,9 @@ automation:
|
|||||||
attribute: days
|
attribute: days
|
||||||
state: '7'
|
state: '7'
|
||||||
then:
|
then:
|
||||||
- service: script.text_alert
|
- service: script.text_notify
|
||||||
data:
|
data:
|
||||||
|
type: alert
|
||||||
who: "all"
|
who: "all"
|
||||||
title: "Retrieve Garbage Can"
|
title: "Retrieve Garbage Can"
|
||||||
message: "Garbage has been collected. Don't forget to move the trash can back to the house!"
|
message: "Garbage has been collected. Don't forget to move the trash can back to the house!"
|
||||||
|
@ -692,7 +692,77 @@ script:
|
|||||||
selector:
|
selector:
|
||||||
text:
|
text:
|
||||||
multiline: true
|
multiline: true
|
||||||
|
type:
|
||||||
|
name: 'Type'
|
||||||
|
description: 'The type of notification to send. Normal will respect whether a person/group is home. Alert will ignore home/away status. Critical will ignore home/away and send a persistant critical notification.'
|
||||||
|
example: 'normal, alert, critical'
|
||||||
|
required: false
|
||||||
|
selector:
|
||||||
|
select:
|
||||||
|
options:
|
||||||
|
- Normal
|
||||||
|
- Alert
|
||||||
|
- Critical
|
||||||
sequence:
|
sequence:
|
||||||
|
- choose:
|
||||||
|
- conditions:
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ type in ['critical','Critical'] }}"
|
||||||
|
sequence:
|
||||||
|
- service: >
|
||||||
|
{% if who == 'tony' %}
|
||||||
|
notify.ios_tony
|
||||||
|
{% elif who == 'tina' %}
|
||||||
|
notify.ios_tina
|
||||||
|
{% elif who == 'kallen' %}
|
||||||
|
notify.ios_kallen
|
||||||
|
{% elif who == 'parents' %}
|
||||||
|
notify.ios_parents
|
||||||
|
{% elif who == 'nerds' %}
|
||||||
|
notify.ios_nerds
|
||||||
|
{% elif who == 'all' %}
|
||||||
|
notify.all_ios
|
||||||
|
{% endif %}
|
||||||
|
data:
|
||||||
|
title: "{{ title }}"
|
||||||
|
message: "{{ message }}"
|
||||||
|
data:
|
||||||
|
push:
|
||||||
|
sound:
|
||||||
|
name: default
|
||||||
|
critical: 1
|
||||||
|
- conditions:
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ type in ['alert','Alert'] }}"
|
||||||
|
sequence:
|
||||||
|
- service: >
|
||||||
|
{% if who == 'tony' %}
|
||||||
|
notify.ios_tony
|
||||||
|
{% elif who == 'tina' %}
|
||||||
|
notify.ios_tina
|
||||||
|
{% elif who == 'kallen' %}
|
||||||
|
notify.ios_kallen
|
||||||
|
{% elif who == 'parents' %}
|
||||||
|
notify.ios_parents
|
||||||
|
{% elif who == 'nerds' %}
|
||||||
|
notify.ios_nerds
|
||||||
|
{% elif who == 'all' %}
|
||||||
|
notify.all_ios
|
||||||
|
{% endif %}
|
||||||
|
data:
|
||||||
|
title: '{{ title }}'
|
||||||
|
message: '{{ message }}'
|
||||||
|
# data:
|
||||||
|
# attachment:
|
||||||
|
# url: '{{ url }}'
|
||||||
|
# content-type: '{{ content_type }}'
|
||||||
|
# hide-thumbnail: false
|
||||||
|
# push:
|
||||||
|
# sound: '{{ ios_sound }}'
|
||||||
|
# badge: 0
|
||||||
|
# category: '{{ ios_category }}'
|
||||||
|
# entity_id: '{{ camera_entity }}'
|
||||||
|
default:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: input_boolean.text_notifications
|
entity_id: input_boolean.text_notifications
|
||||||
state: 'on'
|
state: 'on'
|
||||||
@ -867,70 +937,6 @@ script:
|
|||||||
message: '{{ message }}'
|
message: '{{ message }}'
|
||||||
data: '{{ data if data is defined else "{}" }}'
|
data: '{{ data if data is defined else "{}" }}'
|
||||||
|
|
||||||
text_alert:
|
|
||||||
alias: 'Text Alert'
|
|
||||||
description: 'Use this to send more important text alerts to phones, this will ignore presence'
|
|
||||||
mode: queued
|
|
||||||
max: 10
|
|
||||||
fields:
|
|
||||||
who:
|
|
||||||
name: 'Who'
|
|
||||||
description: 'Which phone, or group of phones, to send the alert to'
|
|
||||||
example: 'tony, tina, kallen, parents, nerds, all'
|
|
||||||
required: true
|
|
||||||
selector:
|
|
||||||
select:
|
|
||||||
options:
|
|
||||||
- tony
|
|
||||||
- tina
|
|
||||||
- kallen
|
|
||||||
- parents
|
|
||||||
- nerds
|
|
||||||
- all
|
|
||||||
title:
|
|
||||||
name: 'Title'
|
|
||||||
description: 'The title of the alert'
|
|
||||||
example: 'Important Alert'
|
|
||||||
required: true
|
|
||||||
selector:
|
|
||||||
text:
|
|
||||||
message:
|
|
||||||
name: 'Message'
|
|
||||||
description: 'The body of the alert'
|
|
||||||
example: 'I am alerting you to the possibility that this is an alert'
|
|
||||||
required: true
|
|
||||||
selector:
|
|
||||||
text:
|
|
||||||
multiline: true
|
|
||||||
sequence:
|
|
||||||
- service: >
|
|
||||||
{% if who == 'tony' %}
|
|
||||||
notify.ios_tony
|
|
||||||
{% elif who == 'tina' %}
|
|
||||||
notify.ios_tina
|
|
||||||
{% elif who == 'kallen' %}
|
|
||||||
notify.ios_kallen
|
|
||||||
{% elif who == 'parents' %}
|
|
||||||
notify.ios_parents
|
|
||||||
{% elif who == 'nerds' %}
|
|
||||||
notify.ios_nerds
|
|
||||||
{% elif who == 'all' %}
|
|
||||||
notify.all_ios
|
|
||||||
{% endif %}
|
|
||||||
data:
|
|
||||||
title: '{{ title }}'
|
|
||||||
message: '{{ message }}'
|
|
||||||
# data:
|
|
||||||
# attachment:
|
|
||||||
# url: '{{ url }}'
|
|
||||||
# content-type: '{{ content_type }}'
|
|
||||||
# hide-thumbnail: false
|
|
||||||
# push:
|
|
||||||
# sound: '{{ ios_sound }}'
|
|
||||||
# badge: 0
|
|
||||||
# category: '{{ ios_category }}'
|
|
||||||
# entity_id: '{{ camera_entity }}'
|
|
||||||
|
|
||||||
text_alert_image:
|
text_alert_image:
|
||||||
alias: 'Text Alert Image'
|
alias: 'Text Alert Image'
|
||||||
sequence:
|
sequence:
|
||||||
@ -962,85 +968,6 @@ script:
|
|||||||
# category: '{{ ios_category }}'
|
# category: '{{ ios_category }}'
|
||||||
# entity_id: '{{ camera_entity }}'
|
# entity_id: '{{ camera_entity }}'
|
||||||
|
|
||||||
text_urgent_alert:
|
|
||||||
alias: 'Text Urgent Alert'
|
|
||||||
description: 'Use this to send CRITICAL text alerts to phones. This will ignore presence, make a loud annoying sound, and create a persistent notification, DO NOT USE UNLESS NECESSARY'
|
|
||||||
mode: queued
|
|
||||||
max: 10
|
|
||||||
fields:
|
|
||||||
who:
|
|
||||||
name: 'Who'
|
|
||||||
description: 'Which phone, or group of phones, to send the alert to'
|
|
||||||
example: 'tony, tina, kallen, parents, nerds, all'
|
|
||||||
required: true
|
|
||||||
selector:
|
|
||||||
select:
|
|
||||||
options:
|
|
||||||
- tony
|
|
||||||
- tina
|
|
||||||
- kallen
|
|
||||||
- parents
|
|
||||||
- nerds
|
|
||||||
- all
|
|
||||||
title:
|
|
||||||
name: 'Title'
|
|
||||||
description: 'The title of the notification'
|
|
||||||
example: 'Critical Alert'
|
|
||||||
required: true
|
|
||||||
selector:
|
|
||||||
text:
|
|
||||||
message:
|
|
||||||
name: 'Message'
|
|
||||||
description: 'The body of the notification'
|
|
||||||
example: 'I am alerting you to a critical situation!'
|
|
||||||
required: true
|
|
||||||
selector:
|
|
||||||
text:
|
|
||||||
multiline: true
|
|
||||||
sequence:
|
|
||||||
- service: >
|
|
||||||
{% if who == 'tony' %}
|
|
||||||
notify.ios_tony
|
|
||||||
{% elif who == 'tina' %}
|
|
||||||
notify.ios_tina
|
|
||||||
{% elif who == 'kallen' %}
|
|
||||||
notify.ios_kallen
|
|
||||||
{% elif who == 'parents' %}
|
|
||||||
notify.ios_parents
|
|
||||||
{% elif who == 'nerds' %}
|
|
||||||
notify.ios_nerds
|
|
||||||
{% elif who == 'all' %}
|
|
||||||
notify.all_ios
|
|
||||||
{% endif %}
|
|
||||||
data:
|
|
||||||
title: "{{ title }}"
|
|
||||||
message: "{{ message }}"
|
|
||||||
data:
|
|
||||||
push:
|
|
||||||
sound:
|
|
||||||
name: default
|
|
||||||
critical: 1
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# Alert Notify
|
|
||||||
# Conditions:
|
|
||||||
# => Vacation mode should be off
|
|
||||||
# Services:
|
|
||||||
# => Audible
|
|
||||||
# => iOS
|
|
||||||
###############################################################################
|
|
||||||
alert_notify:
|
|
||||||
alias: 'Alert Notify'
|
|
||||||
sequence:
|
|
||||||
- condition: state
|
|
||||||
entity_id: input_boolean.vacation_mode
|
|
||||||
state: 'off'
|
|
||||||
- service: tts.google_say
|
|
||||||
data_template:
|
|
||||||
entity_id: media_player.living_room_tv
|
|
||||||
message: >
|
|
||||||
{{ message }}
|
|
||||||
|
|
||||||
jarvis_alert:
|
jarvis_alert:
|
||||||
alias: 'Jarvis Alert'
|
alias: 'Jarvis Alert'
|
||||||
sequence:
|
sequence:
|
||||||
|
@ -307,8 +307,9 @@ automation:
|
|||||||
entity_id: input_boolean.kallen_at_school
|
entity_id: input_boolean.kallen_at_school
|
||||||
- service: input_boolean.turn_on
|
- service: input_boolean.turn_on
|
||||||
entity_id: input_boolean.kallen_awake
|
entity_id: input_boolean.kallen_awake
|
||||||
- service: script.text_alert
|
- service: script.text_notify
|
||||||
data:
|
data:
|
||||||
|
type: alert
|
||||||
who: parents
|
who: parents
|
||||||
message: "Kallen has been dropped off at school."
|
message: "Kallen has been dropped off at school."
|
||||||
- service: light.turn_off
|
- service: light.turn_off
|
||||||
@ -345,8 +346,9 @@ automation:
|
|||||||
action:
|
action:
|
||||||
- service: input_boolean.turn_off
|
- service: input_boolean.turn_off
|
||||||
entity_id: input_boolean.kallen_at_school
|
entity_id: input_boolean.kallen_at_school
|
||||||
- service: script.text_alert
|
- service: script.text_notify
|
||||||
data:
|
data:
|
||||||
|
type: alert
|
||||||
who: parents
|
who: parents
|
||||||
message: "Kallen has been picked up from school."
|
message: "Kallen has been picked up from school."
|
||||||
initial_state: true
|
initial_state: true
|
||||||
|
@ -261,8 +261,9 @@ automation:
|
|||||||
|
|
||||||
Doors:{% if is_state('binary_sensor.exterior_doors','on') %} {{ extdoors }} {% else %} None {% endif %}
|
Doors:{% if is_state('binary_sensor.exterior_doors','on') %} {{ extdoors }} {% else %} None {% endif %}
|
||||||
Windows:{% if is_state('binary_sensor.windows','on') %} {{ windows }} {% else %} None {% endif %}
|
Windows:{% if is_state('binary_sensor.windows','on') %} {{ windows }} {% else %} None {% endif %}
|
||||||
- service: script.text_urgent_alert
|
- service: script.text_notify
|
||||||
data:
|
data:
|
||||||
|
type: critical
|
||||||
who: 'parents'
|
who: 'parents'
|
||||||
title: 'Security Not Armed!'
|
title: 'Security Not Armed!'
|
||||||
message: >-
|
message: >-
|
||||||
|
@ -1541,8 +1541,9 @@ automation:
|
|||||||
entity_id: binary_sensor.windows
|
entity_id: binary_sensor.windows
|
||||||
state: 'on'
|
state: 'on'
|
||||||
action:
|
action:
|
||||||
- service: script.text_alert
|
- service: script.text_notify
|
||||||
data:
|
data:
|
||||||
|
type: alert
|
||||||
who: 'all'
|
who: 'all'
|
||||||
title: "WINDOWS ARE OPEN!"
|
title: "WINDOWS ARE OPEN!"
|
||||||
message: "It is raining and there are windows open in the house. Please close them!"
|
message: "It is raining and there are windows open in the house. Please close them!"
|
||||||
@ -1598,8 +1599,9 @@ script:
|
|||||||
who: 'common'
|
who: 'common'
|
||||||
call_interuption: 1
|
call_interuption: 1
|
||||||
call_lightning_alert: 1
|
call_lightning_alert: 1
|
||||||
- service: script.text_alert
|
- service: script.text_notify
|
||||||
data:
|
data:
|
||||||
|
type: alert
|
||||||
who: 'all'
|
who: 'all'
|
||||||
title: "Lightning Detected!"
|
title: "Lightning Detected!"
|
||||||
message: >-
|
message: >-
|
||||||
@ -1622,8 +1624,9 @@ script:
|
|||||||
who: 'common'
|
who: 'common'
|
||||||
call_interuption: 1
|
call_interuption: 1
|
||||||
call_lightning_clear: 1
|
call_lightning_clear: 1
|
||||||
- service: script.text_alert
|
- service: script.text_notify
|
||||||
data:
|
data:
|
||||||
|
type: alert
|
||||||
who: 'all'
|
who: 'all'
|
||||||
title: "Lightning Clear"
|
title: "Lightning Clear"
|
||||||
message: "The lightning threat has passed. It is safe to resume normal activities."
|
message: "The lightning threat has passed. It is safe to resume normal activities."
|
||||||
|
Reference in New Issue
Block a user