core icon indicating copy to clipboard operation
core copied to clipboard

New notification service for ntfy.sh

Open nwithan8 opened this issue 3 years ago • 9 comments

Proposed change

Currently, the ntfy.sh pub-sub project uses the REST notification service in Home Assistant. Unfortunately, due to how the REST notification service is configured, end-users cannot easily set custom payload data for the notification.

This PR introduces a dedicated ntfy notification service that allows users to define custom payload data via the data field of a notification.

Type of change

  • [ ] Dependency upgrade
  • [ ] Bugfix (non-breaking change which fixes an issue)
  • [x] New integration (thank you!)
  • [ ] New feature (which adds functionality to an existing integration)
  • [ ] Deprecation (breaking change to happen in the future)
  • [ ] Breaking change (fix/feature causing existing functionality to break)
  • [ ] Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request: https://github.com/home-assistant/home-assistant.io/pull/24741

Checklist

  • [x] The code change is tested and works locally.
  • [x] Local tests pass. Your PR cannot be merged unless tests pass
  • [x] There is no commented out code in this PR.
  • [x] I have followed the development checklist
  • [x] The code has been formatted using Black (black --fast homeassistant tests)
  • [ ] Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • [x] The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • [x] New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • [ ] For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • [x] Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

nwithan8 avatar Oct 29 '22 10:10 nwithan8

@frenck Care to leave any feedback?

nwithan8 avatar Nov 15 '22 19:11 nwithan8

@nwithan8 Please don't ping for reviews. It can come across as demanding, while you probably didn't mean it. Yet, we don't want this sort of demanding behavior in our community. So, please, don't randomly pull people into conversations to get attention like that. I will withhold from reviewing this PR for now, for that specific reason.

../Frenck

frenck avatar Nov 15 '22 19:11 frenck

@nwithan8 Please don't ping for reviews. It can come across as demanding, while you probably didn't mean it. Yet, we don't want this sort of demanding behavior in our community. So, please, don't randomly pull people into conversations to get attention like that. I will withhold from reviewing this PR for now, for that specific reason.

../Frenck

Yep, I was afraid of that. My apologies.

nwithan8 avatar Nov 15 '22 19:11 nwithan8

Is 2 months enough probation on this PR?

nwithan8 avatar Jan 26 '23 17:01 nwithan8

@nwithan8 after failing to configure ntfy as a restful service (especially the notification actions), I found this PR. Would you be willing and able to provide this as a custom component?

laundmo avatar Feb 02 '23 14:02 laundmo

@nwithan8 after failing to configure ntfy as a restful service (especially the notification actions), I found this PR. Would you be willing and able to provide this as a custom component?

Hey, I did separate this into a standalone integration for HACS (https://github.com/nwithan8/ntfy-ha-integration), but I wasn't able to get it to load properly once imported. I couldn't find any other notification service HACS integrations, so I wonder if notification services like this can't be imported via HACS. If you know differently, please let me know.

nwithan8 avatar Feb 02 '23 18:02 nwithan8

oh i was just hoping to manually drop it into my custom_components folder

laundmo avatar Feb 02 '23 22:02 laundmo

Will this allow for defining actions? ntfy only accepts them as json in the body or as a header. home assistant doesn't allow changing the header when calling the service (as far as I can tell) and it mutilates the json in the body so it's not accepted by ntfy.

tensor5g avatar Feb 25 '23 16:02 tensor5g

Hey all! I'd love to see this feature into home-assistant core :+1:

makefu avatar May 01 '23 21:05 makefu

@nwithan8, @makefu, @laundmo:

FYI: https://github.com/ivanmihov/homeassistant-ntfy.sh

dimatx avatar Jul 11 '23 01:07 dimatx

@nwithan8, @makefu, @laundmo:

FYI: https://github.com/ivanmihov/homeassistant-ntfy.sh

This works well, I yield to this.

@ivanmihov, can you make a PR to merge in ntfy support officially?

nwithan8 avatar Jul 11 '23 07:07 nwithan8