Markus99
(Mark)
August 19, 2020, 9:08pm
1
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.
aidbish
(Adrian)
August 20, 2020, 2:39am
2
maybe make a bigger impact if you voted for your own suggestion??
Markus99
(Mark)
August 20, 2020, 4:19am
3
Done. Who knew. Thx for the help dog in tuxedo guy!
frenck
(Franck Nijhof)
August 20, 2020, 4:56am
4
Support for icons has been added 6 days ago…
home-assistant:dev
← arychj:slack-add-url-icon-support
opened 10:00PM - 12 Aug 20 UTC
1 Like
Markus99
(Mark)
August 20, 2020, 12:38pm
5
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
bachya
(Aaron Bach)
August 20, 2020, 6:59pm
6
2 Likes
frenck
(Franck Nijhof)
August 21, 2020, 2:43pm
8
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
2 Likes
Markus99
(Mark)
September 26, 2020, 3:49pm
9
Just upgraded to .115.3 and attempting this in Developer Tools -> Services:
Resulting in this error:
Platform is setup as such:
bachya
(Aaron Bach)
September 26, 2020, 3:52pm
10
Your service data structure is incorrect: username
and icon
need to be underneath a data
key (docs ).
Markus99
(Mark)
September 26, 2020, 3:59pm
11
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!
1 Like