Friday, May 1, 2026

Notifications with NTFY

For an index to all my stories click this text.

When working with IOT projects several things can happen. A certain temperature is reached, movement is detected, a light is set on in a room, someone is at the door etc. etc.etc. When something like this happens you will want to get a notification. You can, of course, build a website on which values are shown. But that implies that you need to go to that website to look at the values.

It is more efficient when you get a notification (an alarm) on your smart phone.



A notification like this is put on the startscreen of your phone so it will always draw your attention.

There is a free service that you can use to get these notifications it is called NTFY
You can find the website here: https://ntfy.sh/

NTFY

NTFY is of course short for NoTiFY. It is a free service that you can use. 

There is a limit of 250 notifications per day for a free or anonymous account. That is 10 messages per hour !!!

If you need more than 250 messages per day then you need to get a paid subscription.

To use NTFY you need to download a (free) app on your phone or tablet. But there is also a desktop (PC) version that can receive messages but can also send messages.

To send notification messages to your phone, tablet or PC there is a simple to use API that can be used with Arduino (C++) and MicroPython.

For using the free version you do not have to log-in or make an account. You can just use it. That is a bit like dweet.

Another similarity to Dweet is that a message/notification consists of two parts: a topic and the message itself. To get the notifications on your Phone or PC you need to "subscribe" to that topic.
A topic might be for example "Alarm" and the message can be "The garage door is open". Another topic might be "Myhome" and a message could be "The temperature = 22 degrees"

You may create as many topics as you like as long as you do not exceed the limit of 250 messages. A topic is created automatic when you send a message with your microcontroller that includes a non existant topic.

And yet another similarity to Dweet is that (unless you have a paid account) the topics are public. This means that anybody can get your messages and notifications as long as they know the topic you are using.
So use a cryptic topicname like LV23kit where LV are my initials, 23 is the year (2023) and kit means that the messages concern my kitchen. Just be creative.

If you need private topics you will need to get a paid plan.

The big difference with Dweet is that NTFY can send notifications to your phone/tablet/pc. Dweet can not send them, you need to collect them yourself. So for sending alarms NTFY is the best option.

There is one extra option that might prove usefull. NTFY can also send emails. So you can get your messages in your mailbox. For alarms that is not really an option as you want an instant notification if something is wrong. However it might be usefull for some of you so I will show how to use this option. With the free version you can send 5 emails per day.

One more thing though. The messages/notifications are stored for 12 hours. After 12 hours the messages disappear.

NTFY on the PC

First thing we are going to do is to get NTFY on your PC. Well that is easy. Just point your browser to https://ntfy.sh/app and you're done.



This is how the webpage looks..



Click on + Subscribe to topic and a window opens that allows you to enter the name of a topic.
Like stated before, for an anonymous (and free account), topics are public so choose a topic name that others can not guess easily.



You can also click on GENERATE NAME and NTFY will generate a topic for you that closely resembles a password.
This will give you some better privacy and secrecy but is more difficult to use on multiple devices at the same time. If, for example, you are using NTFY at the same time on your PC and on your smart phone you will need to find a way to send this cryptic topic name to your phone.

I choose a topic name myself: lucstechblog

Then click SUBSCRIBE.



This is how your screen will look now. On the left there is a list of subscribed topics. At this moment there is just one: lucstechblog. In the center there is a message that no notifications have been send or received with this topic.

NTFY on the Android Phone

To get notifications we need to install the NFTY app from the playstore. You can find it here:
https://play.google.com/store/apps/details?id=io.heckel.ntfy
Or just search for NTFY in the app store.



Install the app and open it.





It looks almost the same as the PC version. 





Press the + at the bottom of the screen for subscribing to a topic. We will use the same topic: lucstechblog
A big difference from the PC version is that there is no option to have NTFY generate a topic for you. This is because the phone version is only used for receiving notifications.

We now have 1 subscription to a topic.

Sending a message from the PC

Click with your mouse on the subscribed topic (lucstechblog)



And at the bottom type a test message like I did. Then click on the small arrow next to the message.



The PC screen will inform you that the message is send.



And you will almost immediately get a notification on your phone.
This is the important part. This shows that we can get alarm messages and other important messages as a notification on our phone.



And the NFTY app will inform you that a notification has been received.
And shows message also in the app.

First steps done.

The first setup is done.

Make yourself comfortable with the concept and create some topics for yourself and play around a bit.

Next time we are going to send notifications from the ESP32 using Arduino language (C++) and from the Raspberry Pi Pico with MicroPython.

A few small tips

You can use the browser version next to the app on your Phone. Just point your browser to: https://ntfy.sh/app That way you can also send messages from the phone that will be received by the PC. You will not get notification alarms through the browser but you will still get them through the app.

You can use NTFY on multiple phones and tablets. As long as they all subscribe to the same topics, they will all get the same notifications/messages.

And please remember that you can make as many topics as you like but there is a limit of 250 messages per day for the free account. The messages are stored on the server for 12 hours after which they vanish.

Although you can create loads of topics it is better and easier to maintain if you just use a few topics and make the messages in the topics more verbal.

Next story covers how to send notifications from your ESP32 with Arduino language (C++) or Raspberry Pi Pico W with MicroPython


So Till next time
have fun


Luc Volders