How to use Slack to send notificaiton

Hello!

I am having some issues using the Slack integration to send a message as a result of an automation.

Here’s how I have slack set up:
on api.slack.com, in my app, under Features → OAuth & permissions, I have the following set:
Bot Token Scope: chat:write, dnd:read

When installing the Slack integration to HA,
I use the ‘Bot User OAuth Token’ (xoxb-xxxxxxx) for ‘API key’
Default channel: # security (no space)

Then, in HA Settings → Automation and Scenes I have a ‘Door’ automation set up
and have the Action set to call a service:
(note ‘breyen’ is the name of the slack server)

Am I just totally missing something? I have read over the HA integration page (Slack - Home Assistant) probably six times :stuck_out_tongue:

Thanks for the help!

I ended up figuring this out!

I ended up making a script to call the slack notify service.

alias: "Notify: Slack Notification Template"
sequence:
  - service: notify.YOUR_SLACK_TEAM
    data:
      message: Fallback Text
      target: "#test-channel"
      title: Reminder
      data:
        blocks:
          - type: section
            text:
              type: mrkdwn
              text: >-
                This is a mrkdwn section block *this is bold*, and ~this is
                crossed out~, and <https://google.com|this is a link>
mode: single

I also made a PR to make it clearer in the docs. That PR is here: Slack Integration docs update by AndrewBreyen · Pull Request #26466 · home-assistant/home-assistant.io · GitHub

1 Like