Tasker: Perfect AutoNotifications
Are you still creating notifications on your Android device like it’s 1969? Instead of creating AutoNotifications for each event, do it the smart way! Use Tasker: Perfect AutoNotifications instead. You will save time and make your notifications better! Perfect Notifications can be used with NodeRED, EventGhost and other Android devices.
From Near Perfect AutoNotifications to Tasker: Perfect AutoNotifications
If you are a fan of automation, you probably stopped creating AutoNotifications manually a long time ago using Near Perfect AutoNotifications. As the name suggests, this was an inferior, sting based method. While this is still a perfectly viable way of creating AutoNotifications, it comes with limitations.
To create a Near Perfect AutoNotification entire string had to be created, even if you had no intentions of using all the custom fields. The AutoRemote string would look like this:
NOTIFICATION silent=:=This is the title=:=This is the text of the message that will have over 37 characters to illustrate the point=:=messageID=:=#5481D4FA=:=2=:=notification=:=notificationbig=:=button1=:=button1action=:=button2=:=button2action
Thanks to JSON, I could finally make my system ideal with Tasker: Perfect AutoNotifications.
Tasker: Perfect AutoNotifications
I mentioned JSON a moment ago. Please don’t panic. First of all, read the 5 min guide to JSON. This will make things super simple to understand. Secondly, you can just modify the existing template. This way, you can create your own notifications.
To make the system work, I need three Joao’s plugins. First is fairly obvious: the AutoNotification, other ones are AutoRemote to send the notifications from one device to another and AutoTools to read JSON format and assign the variables.
Tasker: Perfect AutoNotifications are available without root, and compatible with NodeRED, EventGhost and other Android devices. Thanks to JSON I no longer have to define all values used in the AutoNotification and I can send as little info as I need without breaking the system.
I mentioned that you can use several systems to send an information to your Android device. Tasker: Perfect AutoNotifications works well with NodeRED, EventGhost or other Android devices.
Tasker: Perfect AutoNotifications for NodeRED
I’m a big NodeRED fan, you probably know this. It should come as no surprise that I tried to send the notification from the NodeRED server first. It took me some time to actually find a correct way of passing this information to my Android device. The flow is very simple.
Everything happens inside a single Function node. There are several fields that have to be configured to compose the final message and send it as an HTTP POST request.
I mentioned, that you don’t have to configure every field. Just the ones that you want to display in the Perfect AutoNotification. Once msg.object is formatted, it is sent to HTTP POST node that handles the rest.
Tasker: Perfect AutoNotifications for EventGhost
EventGhost has the ability to send the POST requests using Python. The process is very similar to the one described above. To issue the request we have to use Python Script – action. The action should be configured in the following way:
This action will issue the notification for you. Note, that using EventGhost variables, you can set JSON fields dynamically, it will make the action more complex, but you won’t be forced to create a Python action every single time you want to create a new notification.
Tasker: Perfect AutoNotifications Tasker Profile
Now, that we know how to send the JSON message to our Android device, we have to create a Tasker profile to handle this. Before you do this, you can decide what kind of notification you can create. AutoNotification allows you to create several types of Android notifications. All of them can be controlled in the same way, however, you will need one Tasker: Perfect AutoNotification profile per each notification type.
I’m only going to focus on the most popular type. You will see that translating this to other types is simple.
Create the AutoRemote Event trigger that will respond to a command. In my example I have NOT20 – it’s unique enough and It’s unlikely that I will pass this value accidentally in the JSON file.
The JSON message will be stored in %arcomm and processed by AutoTools JSON Read action. I have transferred the data from local %arcomm to %Test so you could see it first. Make sure that AutoTools JSON Read action doesn’t use “simple” option, as we have to use verbatim data structures. Fields to get are:
You can add more or limit the fields that you want to obtain. It’s up to you.
Next is the AutoNotification action. As you can see in the description, I only assigned a couple of most used values. Feel free to populate the AutoNotification fields to your liking. Each JSON field will be translated by AutoTools JSON Read:
text.text = %text_text
Populate the AutoNotification action to your liking and you are done!
Tasker: Perfect AutoNotifications for other devices
If you have the need to send the message from one device to another or create the notification locally, Tasker: Perfect AutoNotifications can be also modified to support it.
Sending AR to another device
Create an AutoRemote Message action in Tasker then type in the command followed by the JSON message.
The AutoRemote profile above will take care of the message once sent to another Android phone.
Sending AR to create AutoNotification locally
In a similar fashion, the JSON object can be used to create a new notification on your phone. This means that next time instead of creating the entire AutoNotification, all you need to do is send the JSON message as the AutoApps command.
You will need a separate profile that will respond to the AutoApps command instead, but the process of creating AutoNotifications is exactly the same. You can even link it to the same task.
Finally, the AutoNotifications are perfect. I no longer have to configure each notification on the phone. Typing it all out as a JSON file in a notepad or web-based JSON editor, then pasting the string to a script or action is so much easier. Hope you will start using this method as well.
You can download ready-made files from this link, buy me a coffee from this link, or support me via Patreon to get an early access here.