Some tweaks to the lightning alerts
This commit is contained in:
@ -1503,7 +1503,9 @@ automation:
|
|||||||
- service: script.text_notify_all
|
- service: script.text_notify_all
|
||||||
data:
|
data:
|
||||||
title: "Lightning Detected!"
|
title: "Lightning Detected!"
|
||||||
message: "Lightning has been detected within 20 miles of the house. Nearest storm is {{ states('sensor.blitzortung_lightning_distance') }} miles away."
|
message: >-
|
||||||
|
{% set ltgdist = (states('sensor.blitzortung_lightning_distance') | int) / 1.609 | round %}
|
||||||
|
"Lightning has been detected within 20 miles of the house. Nearest storm is {{ ltgdist }} miles away."
|
||||||
- service: input_boolean.turn_on
|
- service: input_boolean.turn_on
|
||||||
entity_id: input_boolean.lightning_warning
|
entity_id: input_boolean.lightning_warning
|
||||||
- service: script.lightning_warning_audible
|
- service: script.lightning_warning_audible
|
||||||
@ -1519,6 +1521,10 @@ automation:
|
|||||||
entity_id: input_boolean.lightning_warning
|
entity_id: input_boolean.lightning_warning
|
||||||
state: 'on'
|
state: 'on'
|
||||||
action:
|
action:
|
||||||
|
- service: script.text_notify_all
|
||||||
|
data:
|
||||||
|
title: "Lightning Clear"
|
||||||
|
message: "The lightning threat has passed. It is safe to resume normal activities."
|
||||||
- service: input_boolean.turn_off
|
- service: input_boolean.turn_off
|
||||||
entity_id: input_boolean.lightning_warning
|
entity_id: input_boolean.lightning_warning
|
||||||
- service: script.lightning_clear_audible
|
- service: script.lightning_clear_audible
|
||||||
@ -1543,7 +1549,7 @@ script:
|
|||||||
lightning_warning_audible:
|
lightning_warning_audible:
|
||||||
sequence:
|
sequence:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: binary_sensor.day
|
entity_id: input_boolean.audible_notifications
|
||||||
state: 'on'
|
state: 'on'
|
||||||
- service: script.status_annc
|
- service: script.status_annc
|
||||||
data_template:
|
data_template:
|
||||||
@ -1562,7 +1568,7 @@ script:
|
|||||||
lightning_clear_audible:
|
lightning_clear_audible:
|
||||||
sequence:
|
sequence:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: binary_sensor.day
|
entity_id: input_boolean.audible_notifications
|
||||||
state: 'on'
|
state: 'on'
|
||||||
- service: script.status_annc
|
- service: script.status_annc
|
||||||
data_template:
|
data_template:
|
||||||
@ -1572,7 +1578,7 @@ script:
|
|||||||
<p>
|
<p>
|
||||||
{{ [
|
{{ [
|
||||||
'Lightning threat appears to be over.',
|
'Lightning threat appears to be over.',
|
||||||
'No more lightning appears to be occuring.',
|
'No more lightning appears to be occurring.',
|
||||||
'Lightning is gone.'
|
'Lightning is gone.'
|
||||||
]|random }}
|
]|random }}
|
||||||
It is safe to resume normal activities.
|
It is safe to resume normal activities.
|
||||||
|
Reference in New Issue
Block a user