Skip to content

Slack

Slack access uses Socket Mode so users can mention the app, DM it, or continue in a thread, with replies sent back to the original channel or thread; direct local Slack connection is enabled unless SLACK_CHANNEL_DIRECT_ENABLED=false.

Usage Modes

ModeTriggerNotes
Channel mentionMention the app in a channel and enter a questionGood for team status checks, alert handling, and control commands.
App DMSend a direct message to the appGood for personal remote status queries and control.
Thread replyContinue in the thread where the app repliedKeeps one device investigation or operation in a single Slack thread.

Prepare the Slack App

  1. Create an app in Slack API Apps.
  2. In OAuth & Permissions → Bot Token Scopes, add:
    • chat:write
    • app_mentions:read
    • im:history
  3. In Event Subscriptions, subscribe to Bot Events:
    • app_mention
    • message.im
  4. Enable Socket Mode.
  5. In Basic Information → App-Level Tokens, create a token with connections:write and copy the xapp-... token.
  6. In OAuth & Permissions, install the app to the workspace and copy the Bot User OAuth Token, usually xoxb-....
  7. Copy Signing Secret from Basic Information.

Configure Device Agent

Open Settings → Channels → Slack and fill in:

Field.envDescription
EnabledSLACK_ENABLEDStarts the Slack channel
Bot TokenSLACK_BOT_TOKENxoxb-...
App TokenSLACK_APP_TOKENxapp-... with connections:write
Signing SecretSLACK_SIGNING_SECRETOptional Slack app Signing Secret
Allow listSLACK_ALLOW_FROMOptional Slack user ID allow list

You can also configure it in .env:

bash
SLACK_ENABLED=true
SLACK_BOT_TOKEN=xoxb-your-slack-bot-token
SLACK_APP_TOKEN=xapp-your-slack-app-token
SLACK_SIGNING_SECRET=your-signing-secret
SLACK_ALLOW_FROM=U01234567,U89ABCDEF
SLACK_CHANNEL_DIRECT_ENABLED=true

Restart the service after saving.

Verify Access

  1. Confirm the service has restarted.
  2. Check logs for Slack: enabled and Channel started (Socket Mode).
  3. Mention the app in a channel, or send a DM to the app.
  4. If the allow list is enabled, make sure the sender Slack user ID is included.

Channel replies are sent to the original thread. DMs reply directly in the DM conversation.

Checks

  • No DM response: subscribe to message.im and reinstall the app to the workspace.
  • No channel response: mention the app and confirm it has joined the channel.
  • Socket Mode does not start: make sure SLACK_APP_TOKEN starts with xapp-... and has connections:write.
  • Direct channel does not start: confirm SLACK_CHANNEL_DIRECT_ENABLED=false is not set.