Slack notifications

Hi guys,

I am tryign to integrate some automation and send to slack.

However, I am seeing the following in the logs, and obviously the notification isn’t working:

2018-09-12 07:14:23 WARNING (MainThread) [homeassistant.core] Unable to find service notify/slack_notify

Here are my configurations:

configuration.yaml

notify:
  - name: slack_notify
    platform: slack
    api_key: !secret slack_key
    default_channel: '#hass'

automation.yaml

- alias: person left zone
trigger:
    platform: zone
    entity_id: device_tracker.person
    zone: zone.home
    event: leave
action:
- service: notify.slack_notify
    data:
        message: "person is leaving home"

I have also tried notify.slack but it gives me the same message Unable to find service notify/slack. Am I missing something really obvious here?

I have just enabled debugging, and it doesn’t seem to be authenticating to Slack correctly;

[homeassistant.components.notify.slack] Authentication failed

I have the correct API key. I have also tried with and without https://hooks.slack.com/services/

here’s my trace:

2018-09-12 08:35:58 ERROR (SyncWorker_1) [homeassistant.components.notify.slack] Authentication failed
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/notify/slack.py", line 57, in get_service
    channel, api_key, username, icon, hass.config.is_allowed_path)
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/notify/slack.py", line 82, in __init__
    self.slack.auth.test()
File "/srv/homeassistant/lib/python3.6/site-packages/slacker/__init__.py", line 137, in test
    return self.get('auth.test')
File "/srv/homeassistant/lib/python3.6/site-packages/slacker/__init__.py", line 117, in get
    api, **kwargs
File "/srv/homeassistant/lib/python3.6/site-packages/slacker/__init__.py", line 99, in _request
    raise Error(response.error)
slacker.Error: invalid_auth
2018-09-12 08:35:58 ERROR (MainThread) [homeassistant.components.notify] Failed to initialize notification service slack

Did you find a solution to this issue? I’m finding the same thing is happening in my setup.

Slack sometimes works, and I won’t see those errors in my log. Which is odd.

I get an ambiguous error in the log:

[System] Start Notification: Error executing script. Service not found for call_service at pos 1: Unable to find service notify.slack

I’ve added a more detailed logging to my config but I’m not seeing any helpful messages.

logger:
  logs:
    homeassistant.components.notify.slack: debug

hi @sentur can you check if you have the same issue as I described a few moments ago in this thread: Slack notification not working - issue with service renaming
You can find out in the developer tools > services > notify.[slackworkspacename] and check if it is still wokring

Hmmm, interesting.

I have the Slack notify setup as an integration in the UI as well. However, under developer tools > services > it’s still showing as notify.slack. Slack is currently showing up as working in my HA instance. When it next breaks / shows errors in the log I’ll check to see if the service has changed names.