Hi,
I’m trying to send a message from HA to Mattermost. I have a shell script, a perl script and a curl command that can do this from the command line.
The perl script or the shell script would be the preferred method. However, I don’t see how to parameterize the message text. For example I would like to execute this command:
./notify.pl “This is a message” “@user”
But all I can ever get to work is:
./notify.pl
The alternative is to use a REST notifier. I’ve tried various variations of this theme:
notify:
- platform: rest
name: NotifyMe
method: POST
headers:
Content-Type: application/json
resource: https://mm.example.com/hooks/nceur8
data:{text: “This is a test”, message: “this is a message” }
message_param_name: text
But when I run this notifier, the Mattermost logs indicate that the message body is null.
The curl command that works from the command line looks like this:
curl -i -X POST -H ‘Content-Type: application/json’ -d ‘{“text”: “Hello, this is some text\nThis is more text” }’ https://mm.example.com/hooks/nceur8
So, I hope you can see what I’m trying to do.
What am I missing?
Mike.