[GH-ISSUE #411] Add support for "mqtt" actions #318

Open
opened 2026-05-07 00:23:01 +02:00 by BreizhHardware · 5 comments

Originally created by @sumnerboy12 on GitHub (Sep 22, 2022).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/411

Similar to "http", allow a notification action to send an MQTT message.

MQTT is a very common protocol for home automation. Having the ability to send an MQTT message from a ntfy notification action would allow all sorts of integrations.

I will also be looking to add support for ntfy to mqttwarn. This would allow for users to send notifications to an MQTT topic and mqttwarn will automatically forward it to ntfy.

With MQTT actions and mqttwarn integration, we would have bi-directional support for MQTT based systems.

Originally created by @sumnerboy12 on GitHub (Sep 22, 2022). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/411 Similar to "http", allow a notification action to send an MQTT message. MQTT is a very common protocol for home automation. Having the ability to send an MQTT message from a `ntfy` notification action would allow all sorts of integrations. I will also be looking to add support for `ntfy` to [mqttwarn](https://github.com/jpmens/mqttwarn). This would allow for users to send notifications to an MQTT topic and `mqttwarn` will automatically forward it to `ntfy`. With MQTT actions and `mqttwarn` integration, we would have bi-directional support for MQTT based systems.
Author
Owner

@binwiederhier commented on GitHub (Sep 23, 2022):

Related: https://github.com/binwiederhier/ntfy/issues/8

<!-- gh-comment-id:1256132682 --> @binwiederhier commented on GitHub (Sep 23, 2022): Related: https://github.com/binwiederhier/ntfy/issues/8
Author
Owner

@jpmens commented on GitHub (Nov 2, 2022):

MQTT support in ntfy would be grand.

@sumnerboy12 I've added an enhancement issue to mqttwarn here, so if you've nothing better to do ... :-)

<!-- gh-comment-id:1300031776 --> @jpmens commented on GitHub (Nov 2, 2022): MQTT support in ntfy would be grand. @sumnerboy12 I've added an enhancement issue to [mqttwarn here](https://github.com/jpmens/mqttwarn/issues/607), so if you've nothing better to do ... :-)
Author
Owner

@zoic21 commented on GitHub (Feb 1, 2023):

Hello,
I think it's can be a awesome idea. MQTT is more and more used especially by iot, place where ntfy.sh is used a lot. With mqtt (api and action) we can used ntfy.sh to send message from ESP32 (it's possible in HTTP but the library is very heavy compared to MQTT, when there is only 4mb or even 1mb it is not negligible). And with the actions from the notification, you can imagine direct control scenarios without necessarily needing a home automation solution in the middle.

One can imagine when I open my garage door the module sends an MQTT frame to ask if I also need to open the gates. If I answer yes the portal module sees the request and executes

I don't see the work that it represents, especially in go, a language that I don't know, but on the other hand I can see the opening it gives in the home automation environment.

<!-- gh-comment-id:1412183479 --> @zoic21 commented on GitHub (Feb 1, 2023): Hello, I think it's can be a awesome idea. MQTT is more and more used especially by iot, place where ntfy.sh is used a lot. With mqtt (api and action) we can used ntfy.sh to send message from ESP32 (it's possible in HTTP but the library is very heavy compared to MQTT, when there is only 4mb or even 1mb it is not negligible). And with the actions from the notification, you can imagine direct control scenarios without necessarily needing a home automation solution in the middle. One can imagine when I open my garage door the module sends an MQTT frame to ask if I also need to open the gates. If I answer yes the portal module sees the request and executes I don't see the work that it represents, especially in go, a language that I don't know, but on the other hand I can see the opening it gives in the home automation environment.
Author
Owner

@osering commented on GitHub (Jan 26, 2024):

MQTT (opensource standard as well) bridge/integration would be invaluable. It'll let connect thousands of ESP8266 boards (including with TASMOTA/ESPurna/ESPeasy/ESPhome firmware and MQTT) with ntfy gateway! Most of Sonoff gear and many of the Tuya gear can be Tasmotized!
Probably united ntfy/mqtt server/broker could be crafted...
Some relevant links:
https://github.com/arendst/Tasmota
https://templates.blakadder.com/howto.html
https://www.emqx.io/
https://github.com/eclipse/mosquitto

<!-- gh-comment-id:1912718190 --> @osering commented on GitHub (Jan 26, 2024): MQTT (opensource standard as well) bridge/integration would be invaluable. It'll let connect thousands of ESP8266 boards (including with TASMOTA/ESPurna/ESPeasy/ESPhome firmware and MQTT) with ntfy gateway! Most of Sonoff gear and many of the Tuya gear can be Tasmotized! Probably united ntfy/mqtt server/broker could be crafted... Some relevant links: https://github.com/arendst/Tasmota https://templates.blakadder.com/howto.html https://www.emqx.io/ https://github.com/eclipse/mosquitto
Author
Owner

@xgpt commented on GitHub (Dec 28, 2024):

Would love to come to the party and add that I came to find this issue by searching google for "mqtt ntfy bridge" for a similar low-spec IOT board project I'm working on! Would be so sweet to just mqtt with a ntfy token based auth to send stuff to my existing pipelines.

Edit Just saw the https://github.com/binwiederhier/ntfy/issues/8 post and why you are choosing not to implement this. I agree with your decision, and was looking for another library to link in with a ntfy server anyway. I think having an mqtt listener that pings ntfy is something that would be easy enough to implement. Ntfy being accessed via MQTT does seem like a good fit though, and I would add that since it already has email support, MQTT support wouldn't be expanding the scope past just HTTP, as that has already been done with an SMTP option. I respect the decision either way but would love to see it included if someone were to submit a PR. I'm personally not going to do it right now because I'm not using this for anything more than fun, but I might link to a repo soon if my homebrew solution works well.

I was looking online for inspiration on how to go about structuring my code more than expecting ntfy to actually have support for it already.

<!-- gh-comment-id:2564116893 --> @xgpt commented on GitHub (Dec 28, 2024): Would love to come to the party and add that I came to find this issue by searching google for "mqtt ntfy bridge" for a similar low-spec IOT board project I'm working on! Would be so sweet to just mqtt with a ntfy token based auth to send stuff to my existing pipelines. **Edit** Just saw the https://github.com/binwiederhier/ntfy/issues/8 post and why you are choosing not to implement this. I agree with your decision, and was looking for another library to link in with a ntfy server anyway. I think having an mqtt listener that pings ntfy is something that would be easy enough to implement. Ntfy being accessed via MQTT does seem like a good fit though, and I would add that since it already has email support, MQTT support wouldn't be expanding the scope past just HTTP, as that has already been done with an SMTP option. I respect the decision either way but would love to see it included if someone were to submit a PR. I'm personally not going to do it right now because I'm not using this for anything more than fun, but I might link to a repo soon if my homebrew solution works well. I was looking online for inspiration on how to go about structuring my code more than expecting ntfy to actually have support for it already.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#318
No description provided.