mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-09 10:26:52 +00:00
* Added support for upload of remote or local files to slack, PR #8278 in home-assistant * Update notify.slack.markdown
This commit is contained in:
parent
995ccf66fc
commit
8d25d7ec2b
@ -40,5 +40,47 @@ Configuration variables:
|
||||
- **username** (*Optional*): Setting username will allow Home Assistant to post to Slack using the username specified. By default not setting this will post to Slack using the user account or botname that you generated the api_key as.
|
||||
- **icon** (*Optional*): Use one of the Slack emoji's as an Icon for the supplied username. Slack uses the standard emoji sets used [here](http://www.webpagefx.com/tools/emoji-cheat-sheet/).
|
||||
|
||||
### {% linkable_title Slack service data %}
|
||||
|
||||
The following attributes can be placed `data` for extended functionality.
|
||||
|
||||
| Service data attribute | Optional | Description |
|
||||
| ---------------------- | -------- | ----------- |
|
||||
| `file` | yes | Groups the attributes for file upload. If present, either `url` or `path` have to be provided.
|
||||
| `path ` | yes | Local path of file, photo etc to post to slack. Is placed inside `file`.
|
||||
| `url` | yes | URL of file, photo etc to post to slack. Is placed inside `file`.
|
||||
| `username` | yes | Username if the url requires authentication. Is placed inside `file`.
|
||||
| `password` | yes | Password if the url requires authentication. Is placed inside `file`.
|
||||
| `auth` | yes | If set to `digest` HTTP-Digest-Authentication is used. If missing HTTP-BASIC-Authentication is used. Is placed inside `file`.
|
||||
|
||||
Example for posting file from URL
|
||||
```json
|
||||
{
|
||||
"message":"Message that will be added as a comment to the file.",
|
||||
"title":"Title of the file.",
|
||||
"data":{
|
||||
"file":{
|
||||
"url":"http://[url to file, photo, security camera etc]",
|
||||
"username":"optional user, if necessary",
|
||||
"password":"optional password, if necessary",
|
||||
"auth":"digest"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
Example for posting file from local path
|
||||
```json
|
||||
{
|
||||
"message":"Message that will be added as a comment to the file.",
|
||||
"title":"Title of the file.",
|
||||
"data":{
|
||||
"file":{
|
||||
"path":"/path/to/file.ext"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
Please note that `path` is validated against the `whitelist_external_dirs` in the `configuration.yaml`.
|
||||
|
||||
To use notifications, please see the [getting started with automation page](/getting-started/automation/).
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user