From bd861410728d1e90e9c7cdfc608e2da924e4a526 Mon Sep 17 00:00:00 2001 From: Jon Griffith <32052562+arretx@users.noreply.github.com> Date: Wed, 19 Sep 2018 23:17:05 -0700 Subject: [PATCH] Clarification of Slack integration setup (#6318) * Clarification of Slack integration setup Had a bit of trouble following along, but I finally got it and offer these updates to help anyone else. * Minor changes --- source/_components/notify.slack.markdown | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/source/_components/notify.slack.markdown b/source/_components/notify.slack.markdown index 3e384990109..699a57ec236 100644 --- a/source/_components/notify.slack.markdown +++ b/source/_components/notify.slack.markdown @@ -15,12 +15,22 @@ ha_release: pre 0.7 The `slack` platform allows you to deliver notifications from Home Assistant to [Slack](https://slack.com/). -If you are planning to use Slack as yourself then you need to obtain a [Slack API token](https://api.slack.com/web?sudo=1) to be able to send notifications. +## {% linkable_title Setup %} + +If you are planning to use Slack as yourself then you'll need to create a [new app](https://api.slack.com/apps) under your Slack.com account. After creating the app, access the OAuth & Permissions link under the Features heading in the sidebar. Your OAuth Access Token should be located there. This is the key that you'll use in your `configuration.yaml` file. + +
+There is an app credential Verification Token on the Basic Settings of your app. This is **not** the API key you want. +
+ +You will also need to ensure that you have added the appropriate scope when configuring your app. In this case, in the Scopes section, add the `Send messages as user` scope, e.g., (chat:write:user). It is also possible to use Slack bots as users. Just create a new bot at https://[YOUR_TEAM].slack.com/apps/build/custom-integration and use the provided token for that. You can add an icon from the frontend for Home Assistant and give the bot a meaningful name. Don't forget to invite the bot to the room where you want to get the notifications. +## {% linkable_title Configuration %} + To enable the Slack notification in your installation, add the following to your `configuration.yaml` file: ```yaml @@ -85,6 +95,7 @@ Example for posting file from local path: } } ``` + Please note that `path` is validated against the `whitelist_external_dirs` in the `configuration.yaml`. Example for posting formatted attachment: @@ -106,4 +117,3 @@ Example for posting formatted attachment: Please note that both `message` is a required key, but is always shown, so use an empty (`""`) string for `message` if you don't want the extra text. To use notifications, please see the [getting started with automation page](/getting-started/automation/). -