WTH Slack no username/icon customization

Slack integration allows you to change the channel a message is posted in using ‘target:’ when called, but not the username / icon that’s being used.

What the heck?

Seems it would be easy to code ‘username:’ and ‘icon:’ to allow these to be quickly / easily customized.

maybe make a bigger impact if you voted for your own suggestion??

Done. Who knew. Thx for the help dog in tuxedo guy!

Support for icons has been added 6 days ago…

1 Like

From what I can see, that’s adding URL support for icon value in configuration.yaml. My WTH request relates to customizing in the slack service call, ie:

configuration.yaml:

notify:
  - name: slack_notify
    platform: slack
    api_key: !secret slack_api_key
    default_channel: '#general'
    username: "Smiley Face Guy"
    icon: ":smile:"

This works great and uses the username, icon and default channel as it should.

I also found that target: can be used in the service call in order to send the message to the non-default channel.

This request would add icon: and username: support to use non-default icons and usernames (similar to how target: works now) - ie:

- service: notify.slack_notify
  data:
    message: "I hate Mondays"
    icon: ":cry:"
    username: "Sad Face Guy"
    target: "#non_default_channel"

Currently sending username: or icon: results in ‘extra keys not allowed’ error messages. Hope this helps clarify :slight_smile:

Easily done: https://github.com/home-assistant/core/pull/39091

2 Likes

Brilliant!

The above PR by @bachya has been merged, so as of 0.115 this will be possible.

Thanks @Markus99 for this “What the heck?!” and @bachya for hacking that heck :slight_smile:

2 Likes

Just upgraded to .115.3 and attempting this in Developer Tools -> Services:

image

Resulting in this error:
image

Platform is setup as such:
image

Your service data structure is incorrect: username and icon need to be underneath a data key (docs).

Great, didn’t realize it needed to be under that data key. This is working now, thx for the improvement and further for the help today!

image

1 Like