mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-17 14:26:51 +00:00
Add docs for data parameter in alert component (#6968)
* Add docs for data parameter in alert component * Fix docs based on feedback * Alter docs * Re-add suggestion * Update docs with proper data parameter * Add mention of templateable title
This commit is contained in:
parent
21c19956a0
commit
edfc745055
@ -58,6 +58,12 @@ entity_id:
|
|||||||
description: The ID of the entity to watch.
|
description: The ID of the entity to watch.
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
title:
|
||||||
|
description: >
|
||||||
|
A title to be used for the notification if the notifier supports it
|
||||||
|
with [template][template] support.
|
||||||
|
required: false
|
||||||
|
type: template
|
||||||
state:
|
state:
|
||||||
description: The problem condition for the entity.
|
description: The problem condition for the entity.
|
||||||
required: false
|
required: false
|
||||||
@ -98,6 +104,10 @@ notifiers:
|
|||||||
description: "List of `notification` components to use for alerts."
|
description: "List of `notification` components to use for alerts."
|
||||||
required: true
|
required: true
|
||||||
type: list
|
type: list
|
||||||
|
data:
|
||||||
|
description: "Dictionary of extra parameters to send to the notifier."
|
||||||
|
required: false
|
||||||
|
type: list
|
||||||
{% endconfiguration %}
|
{% endconfiguration %}
|
||||||
|
|
||||||
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
|
||||||
@ -254,4 +264,31 @@ alert:
|
|||||||
|
|
||||||
The resulting title of the alert could be `Garage has been open for 30 min`.
|
The resulting title of the alert could be `Garage has been open for 30 min`.
|
||||||
|
|
||||||
|
### {% linkable_title Additional parameters for notifiers %}
|
||||||
|
|
||||||
|
Some notifiers support more parameters (e.g., to set text color or action
|
||||||
|
buttons). These can be supplied via the `data` parameter:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# Example configuration.yaml entry
|
||||||
|
alert:
|
||||||
|
garage_door:
|
||||||
|
name: Garage is open
|
||||||
|
entity_id: input_boolean.garage_door
|
||||||
|
state: 'on' # Optional, 'on' is the default value
|
||||||
|
repeat:
|
||||||
|
- 15
|
||||||
|
- 30
|
||||||
|
- 60
|
||||||
|
can_acknowledge: True # Optional, default is True
|
||||||
|
skip_first: True # Optional, false is the default
|
||||||
|
data:
|
||||||
|
inline_keyboard:
|
||||||
|
- 'Close garage:/close_garage, Acknowledge:/garage_acknowledge'
|
||||||
|
notifiers:
|
||||||
|
- frank_telegram
|
||||||
|
```
|
||||||
|
This particular example relies on the `inline_keyboard` functionality of
|
||||||
|
Telegram, where the user is presented with buttons to execute certain actions.
|
||||||
|
|
||||||
[template]: /docs/configuration/templating/
|
[template]: /docs/configuration/templating/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user