mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-19 15:26:59 +00:00
Update alert.markdown (#7410)
`{% raw %}`-tags were missing, changed boolean to lowercase, improved examples.
This commit is contained in:
parent
d14db798db
commit
7f1251fc98
@ -42,8 +42,8 @@ alert:
|
|||||||
entity_id: input_boolean.garage_door
|
entity_id: input_boolean.garage_door
|
||||||
state: 'on'
|
state: 'on'
|
||||||
repeat: 30
|
repeat: 30
|
||||||
can_acknowledge: True
|
can_acknowledge: true
|
||||||
skip_first: True
|
skip_first: true
|
||||||
notifiers:
|
notifiers:
|
||||||
- ryans_phone
|
- ryans_phone
|
||||||
- kristens_phone
|
- kristens_phone
|
||||||
@ -103,7 +103,7 @@ notifiers:
|
|||||||
In this example, the garage door status (`input_boolean.garage_door`) is watched
|
In this example, the garage door status (`input_boolean.garage_door`) is watched
|
||||||
and this alert will be triggered when its status is equal to `on`.
|
and this alert will be triggered when its status is equal to `on`.
|
||||||
This indicates that the door has been opened. Because the `skip_first` option
|
This indicates that the door has been opened. Because the `skip_first` option
|
||||||
was set to `True`, the first notification will not be delivered immediately.
|
was set to `true`, the first notification will not be delivered immediately.
|
||||||
However, every 30 minutes, a notification will be delivered until either
|
However, every 30 minutes, a notification will be delivered until either
|
||||||
`input_boolean.garage_door` no longer has a state of `on` or until the alert is
|
`input_boolean.garage_door` no longer has a state of `on` or until the alert is
|
||||||
acknowledged using the Home Assistant frontend.
|
acknowledged using the Home Assistant frontend.
|
||||||
@ -125,15 +125,16 @@ provided by the `alert` component:
|
|||||||
```
|
```
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
freshwater_temp_alert:
|
alert:
|
||||||
name: "Warning: I have detected a problem with the freshwater tank temperature"
|
freshwater_temp_alert:
|
||||||
entity_id: binary_sensor.freshwater_temperature_status
|
name: "Warning: I have detected a problem with the freshwater tank temperature"
|
||||||
state: 'on'
|
entity_id: binary_sensor.freshwater_temperature_status
|
||||||
repeat: 5
|
state: 'on'
|
||||||
can_acknowledge: true
|
repeat: 5
|
||||||
skip_first: false
|
can_acknowledge: true
|
||||||
notifiers:
|
skip_first: false
|
||||||
- john_phone_sms
|
notifiers:
|
||||||
|
- john_phone_sms
|
||||||
```
|
```
|
||||||
|
|
||||||
### {% linkable_title Complex Alert Criteria %}
|
### {% linkable_title Complex Alert Criteria %}
|
||||||
@ -146,12 +147,13 @@ disable the alert on certain days. Maybe the alert firing should depend on more
|
|||||||
than one input. For all of these situations, it is best to use the alert in
|
than one input. For all of these situations, it is best to use the alert in
|
||||||
conjunction with a `Template Binary Sensor`. The following example does that.
|
conjunction with a `Template Binary Sensor`. The following example does that.
|
||||||
|
|
||||||
|
{% raw %}
|
||||||
```yaml
|
```yaml
|
||||||
binary_sensor:
|
binary_sensor:
|
||||||
- platform: template
|
- platform: template
|
||||||
sensors:
|
sensors:
|
||||||
motion_battery_low:
|
motion_battery_low:
|
||||||
value_template: {% raw %}'{{ states.sensor.motion.attributes.battery < 15 }}'{% endraw %}
|
value_template: '{{ states.sensor.motion.attributes.battery < 15 }}'
|
||||||
friendly_name: 'Motion battery is low'
|
friendly_name: 'Motion battery is low'
|
||||||
|
|
||||||
alert:
|
alert:
|
||||||
@ -163,6 +165,7 @@ alert:
|
|||||||
- ryans_phone
|
- ryans_phone
|
||||||
- kristens_phone
|
- kristens_phone
|
||||||
```
|
```
|
||||||
|
{% endraw %}
|
||||||
|
|
||||||
This example will begin firing as soon as the entity `sensor.motion`'s `battery`
|
This example will begin firing as soon as the entity `sensor.motion`'s `battery`
|
||||||
attribute falls below 15. It will continue to fire until the battery attribute
|
attribute falls below 15. It will continue to fire until the battery attribute
|
||||||
@ -186,8 +189,8 @@ alert:
|
|||||||
- 15
|
- 15
|
||||||
- 30
|
- 30
|
||||||
- 60
|
- 60
|
||||||
can_acknowledge: True # Optional, default is True
|
can_acknowledge: true # Optional, default is true
|
||||||
skip_first: True # Optional, false is the default
|
skip_first: true # Optional, false is the default
|
||||||
notifiers:
|
notifiers:
|
||||||
- ryans_phone
|
- ryans_phone
|
||||||
- kristens_phone
|
- kristens_phone
|
||||||
@ -206,21 +209,24 @@ about the state of the entity.
|
|||||||
The following will show for a plant how to include the problem `attribute`
|
The following will show for a plant how to include the problem `attribute`
|
||||||
of the entity.
|
of the entity.
|
||||||
|
|
||||||
|
{% raw %}
|
||||||
```yaml
|
```yaml
|
||||||
# Example configuration.yaml entry
|
# Example configuration.yaml entry
|
||||||
|
alert:
|
||||||
office_plant:
|
office_plant:
|
||||||
name: Plant in office needs help
|
name: Plant in office needs help
|
||||||
entity_id: plant.plant_office
|
entity_id: plant.plant_office
|
||||||
state: 'problem'
|
state: 'problem'
|
||||||
repeat: 30
|
repeat: 30
|
||||||
can_acknowledge: True
|
can_acknowledge: true
|
||||||
skip_first: True
|
skip_first: true
|
||||||
message: "Plant {{ states.plant.plant_office }} needs help ({{ state_attr('plant.plant_office', 'problem') }})"
|
message: "Plant {{ states.plant.plant_office }} needs help ({{ state_attr('plant.plant_office', 'problem') }})"
|
||||||
done_message: Plant in office is fine
|
done_message: Plant in office is fine
|
||||||
notifiers:
|
notifiers:
|
||||||
- ryans_phone
|
- ryans_phone
|
||||||
- kristens_phone
|
- kristens_phone
|
||||||
```
|
```
|
||||||
|
{% endraw %}
|
||||||
|
|
||||||
The resulting message could be `Plant Officeplant needs help (moisture low)`.
|
The resulting message could be `Plant Officeplant needs help (moisture low)`.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user