ivanmihov / homeassistant-ntfy.sh

Home Assistant integration for ntfy.sh
GNU General Public License v3.0
54 stars 11 forks source link

Not receiving message with data properties #7

Open BenDavidson90 opened 11 months ago

BenDavidson90 commented 11 months ago

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
M1K3-NL commented 11 months ago

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

BenDavidson90 commented 11 months ago

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:

Here the action in one of my automation for example:

action:
  - service: notify.ntfy_3d_print
ninharp commented 8 months ago

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