Add the ability to pass data to a notify service based on rest platform

Hi guys

I’m using the notify service based on the rest platform to invoke notifications on another instance of home assistant by calling the webhook url of the automation which works fine however I am unable to pass custom data to the service call as it simply doesn’t reach the destination. The only data I am able to pass is whatever I set up in the component definition in the config file. Even templating the value wasn’t possible.

Example:

Service Definition

  - name: test
    platform: rest
    resource: url
    method: POST_JSON
    title_param_name: title
    data:
      target: passes fine
      url: so does this

Service Call:

service: notify.test
data:
  title: test
  message: test
  data:
    image: test but this won't pass through

Is there a chance to get the support for data implemented?

Thank you

You didn’t define data/image in your notification service. The only things you can pass with your current definition is data/url and data/target.

I actually figured it out:
I did the following:

  - name: test
    platform: rest
    resource: url
    method: POST_JSON
    title_param_name: title
    data_template:
      image: '{{ data.image }}'

I didn’t realize I had to use data.image and I was using image instead. I’ve been able to pass the data variable through the service call and I could see it in the rest call.
I guess we can close this :slight_smile:

This should be data:

data_template: has been depreciated.

Alright

I’ll go ahead and start changing it over.

I upgraded from 0.96 to the latest release so I’m stuck with a backlog of fixing things that don’t work :grinning:

:astonished:

Yeah I just had such a complicated setup I left it cause it worked until I upgraded some other services and HASS broke. There was lot of breaking changes and I definitely procrastinate too much.
I’m currently fighting with an issue I described in another feature request which is kind of annoying.