homeassistant-ntfy.sh icon indicating copy to clipboard operation
homeassistant-ntfy.sh copied to clipboard

Not receiving message with data properties

Open BenDavidson90 opened this issue 9 months ago • 3 comments

Hi,

I succeed to configure the plugin and send message to my Ntfy via Home Assistant, so thank you for that ! But there is a problem, when I put data properties like "priority" or "click", I don't receive any message. Here are Home Assistant logs output:

Logger: custom_components.ntfy.notify Source: custom_components/ntfy/notify.py:89 Integration: ntfy (documentation, issues) First occurred: 10:29:29 (9 occurrences) Last logged: 11:47:53

Error while sending ntfy.sh message: 400 Client Error: Bad Request for url: https://###/

To test, I used your codes snippets (by replacing service by my ntfy service) like this one:

action:
  - service: notify.my_ntfy
    data:
      message: "This is a test message."
      title: "ntfy Test"
      data:
        priority: 10

BenDavidson90 avatar Oct 05 '23 09:10 BenDavidson90

How did you rename the service to your own and got it working? It's not working on my end.

M1K3-NL avatar Oct 06 '23 15:10 M1K3-NL

How did you rename the service to your own and got it working? It's not working on my end.

In the configuration.yaml:

notify:
  - name: "Ntfy Test"
    platform: ntfy
    ...
  - name: "Ntfy 3D Print"
    platform: ntfy
    ...

You have to restart completly home assistant, after that you can use them directly. In my case:

  • notify.ntfy_test
  • notify.ntfy_3d_print

Here the action in one of my automation for example:

action:
  - service: notify.ntfy_3d_print

BenDavidson90 avatar Oct 06 '23 21:10 BenDavidson90

Since the issue is still open... the test snippets in the repository are wrong. the priorities range had a max of 5 so a priority of 10 will result in a 400 Bad Request

ninharp avatar Dec 29 '23 14:12 ninharp