Telegram notification not working. required key not provided @ data['message']

Hello all.
New with HA I am facing a problem. I have checked similar problems with no sucess.
I have modified the configuration.yaml following the help.

telegram_bot:
  - platform: polling
    api_key: 1232342342334234234234234
    allowed_chat_ids:
      - 123456789 # example: 123456789 for the chat_id of a user

# Example configuration.yaml entry for the notifier
notify:
  - platform: telegram
    name: telegram
    chat_id: 123456789 

I tested from the development tools - service

{
message: test
}

And i receive the message in my phone

I created a button on the lovelace dash panel with this code to test it and No matter how I format it It doesnā€™t work.

type: button
tap_action:
  action: call-service
  service: notify.telegram
  data:
    message: test
name: Telegram
show_icon: false
show_name: true

The message I receive when i click on the button is:

ā€œFailed to call the serviceā€ notify / notifier name "required key not provided @data [ā€˜messageā€™] "

Any help will be welcomed.

Change data to service_data

1 Like

Thank you very much for your help!
Now It works!.
I am going now to check more related posts to learn myself what was the problem.
Best regards

The problem is that in a service call in an automation/script you use data:, however in a lovelace card you use service_data:. Itā€™s unfortunately not consistent.

Once again, I appreciate the feedback.
Cheers