I’m trying to get actionable notifications working for Slack as well, but I cannot get it sorted.
For me the RESTful command does not result in a message being posted in Slack.
The Slack notification service works for me, so I have the Slack app and API token set up correctly.
For getting the channel ID I went to the slack browser app and went to my message channel.
The URL has the following format: https://app.slack.com/client/T12345ABCDE/C12345ABCDE/C12345ABCDE
So I figured C12345ABCDE is the channel ID.
Calling the following service however result in no success:
service: rest_command.slack_api
data:
api: chat.postMessage
payload:
channel: C12345ABCDE
text: "My amazing test message"
All seems to be OK except that no message is posted.
Has anything changed recently causing this method to break?
Any other clues of what I could have done wrong?
Having an issue with the slack_webhook automation, I can see that when I press the button, the webhook has been received, but the condition and action are not triggering.
In the original, the action was - service_template: which has been deprecated, when googled, u can now run it under - service: instead, but I’m not sure if that’s whats causing the automation to not run.
service: script.notify_slack
data_template:
channel: "C041HSRR887"
message: "The Virtual switch is on."
attachments:
- title: Turn off the switch?
callback_id: webhook_id1
color: '#03a9f4'
attachment_type: default
actions:
- text: Close it
value: Close it
name: 'switch.virtual_switch_1'
type: button
- text: Leave it
value: Leave it
name: 'anything_just_not_blank'
type: button
Edit 2: So i have tried the og with cover entities instead and that seems to work, is there a way to make it work with different entity type like switch. instead of only cover.? (managed to find out, just had to change the last service part of the script.)