Show counter for notifications in UCCW with Tasker variablesShow counter for notifications in UCCW with Tasker variables

Situation

UCCW is just able to shows missed calls, missed Gmail and missed texts. If you want to display a count for other notifications you will have to use Tasker:

“Tasker is an application for Android which performs Tasks (sets of Actions) based on Contexts (application, time, date, location, event, gesture) in user-defined Profiles, or in clickable or timer home screen widgets.” (http://tasker.dinglisch.net/)

This is my first Tasker tutorial (originally posted in the “UCCW 2.0 skins and themes” thread at xda) and I guess that many people there will just use Tasker for these counters. Therefore this tutorial is with a lot of pictures and all the basic information.

If are more interested in Tasker, maybe some guides are a good start:
1. Tasker Tour
2. Beginner Guide by Pocketables.com

I will use Whatsapp notifications as an example here.

Tasker Setup

Note: Usually its easier to start with profiles and then add the tasks, but here it will be the other way round.

Create a Task that tells Tasker what to do when Whatsapp receives a new message and press the check mark. To do that, go to TASKS and press "+". I called it "newWapp".

Now in the Task Edit screen, Press "+" at the bottom and choose "Variables".

Press "Variable Add" and name your variable. This variable will later be transferred to UCCW. Use capital letters because it is a global variable. Value is "+1" because every time a new notification is received the value +1. Confirm with the back button.

You are back to the Task edit screen, press "+" at the bottom and choose "Plugin".

Choose "UCCW" and then "Edit".

"Variable Name" names your variable in UCCW, "Variable value" is your Tasker variable (actually its value) and "Replace Tasker variables" must be checked. Press "Save" and confirm with the back button..

Now you need to create a Task that tells Tasker to reset the variable to 0 when Whatsapp is opened. Otherwise the variable/count would always increase. I named it "emptyWapp".

Now in the Task Edit screen, Press "+" at the bottom and choose "Variables".

Press "Variable Set" and name your variable as before. Value is "0". Confirm with the back button.

You are back to the Task edit screen, press "+" at the bottom and choose "Plugin".

Choose "UCCW" and then "Edit".

"Variable Name" names your variable in UCCW, "Variable value" is your Tasker variable (actually its value) and "Replace Tasker variables" must be checked. Press "Save" and confirm with the back button..

Now Tasker knows what to do, but not when. You need to create 2 profiles! "newWapp" should be triggered when a Whatsapp message is received and "emtpyWapp" when Whatsapp is opened. Go to PROFILES and press "+". Choose "Event" in the menu.

Choose "UI" and "Notification".

Press the Owner Application button and choose Whatsapp.

Confirm with the back button and assign "newWapp" as the task.

Now the second profile. I called it "Empty Wapp". Choose "Application".

Select Whatsapp, confirm with the back button and assign "emptyWapp" as the task.

Your profiles should look like this and you are done with the Tasker setup.

UCCW Setup

Add Tasker Variable to the items (I use 3 because of 3 counters). Choose the variable, go to Controls #4 and press "Variable".

Now insert your UCCW variable name.

Note: I had the problem that UCCW didn't show a number at the beginning! The reason is that %WACOUNT is not set at the beginning! Just go to Tasker Variables and assign manually “0”. Then UCCW should be showing 0!

Now you can play with UCCW and put this variable next to icons etc.

Limitation: With this setup Tasker only knows that a notification is displayed, but not the content of it! For example, if 2 emails arrive at the same moment, just “1“ is added to the count!

Possibilities: I have Tasker for a few months now and I’m still a newbie. Basically you can display any notification and Tasker can understand the text of any notification. So you can make counters for specific Whatsapp users and so on. I do not use other email programs than Gmail so I can’t tell you how it acts with them.

For UCCW skins to use with your new counters go to [UCCW][THEME][WIDGET] UCCW 2.0 skins and themes at xda-developers.

For more interesting Tasker stuff check Content portal for Pocketables Tasker articles over at Pocketables.

14 Comments

  1. hey hi,

    http://www.jagwar.de/show-counter-for-notifications-in-uccw-with-tasker-variables/

    I tried working as per the above link, and tried to get it work through UCCW but i see only the variable name, i dont see the value.

    “Note: I had the problem that UCCW didn’t show a number at the beginning! The reason is that %WACOUNT is not set at the beginning! Just go to Tasker Variables and assign manually “0”. Then UCCW should be showing 0!”

    Also i tried to understand this line of your, but where do i manaully assign “0” to Tasker Variable.
    Appreciate your work.

    Thanks in Advance,
    Janak Mer

    • Hey Janak,

      thanks for your comment.

      The problem right now is that the new UCCW Update 2.8.8 doesn’t work right as you can see in the comments on PlayStore. One of the bugs is that Tasker cannot update variables in UCCW.

      You can go back to UCCW 2.8.7 or wait for a new update!

      To the manually assignment question:

      Open Tasker. At the top you have “Profiles”, “Tasks”, “Scenes” and “Vars.” Go to Vars and you should see %WACOUNT. Click on it and put in a number!

      Thanks

  2. Hi there,

    first: congrats to this nice tutorial, helped me a lot to understand what tasker can do.
    second: In the newest Tasker there is no Tab vor Variables anymore… instead you can simply click on the settings button (bottom left of android buttons), chose ‘more’ and then ‘execute task’ to set a variable manually.

    third: i set this up as showed by you, and the tasks work when manually invoked. But when i receive whatsapp messages, it does not count up. so what exactly does trigger the ui notification ? isn’t there a better way to check for unread messages?

    Cheers Manuel

  3. well… as we are all developers you may know this sentence: “know it works – but i haven’t done anything to change it” 😛 thanks again !

  4. Did the UCCW interface change a bit? In 2.9.9.7, there’s no longer a “Variable” setting, only a “Text” setting?

    • I’m having the same problem. Using 2.9.9.7 and when adding a “Tasker Variable” it behaves just as a “Static Text”. It has the same options, same fields. Because of that, Tasker Variables on 2.9.9.7 are simply broken. I was considering getting an older version, but I was afraid I’d screw up the widgets I’ve already made by doing so.

  5. Hi, I just wondering will this work with twitter, facebook and other social network stuff? cuz I manage to get everything work with the whatsapp but when I tried with twitter (using different name to label the variables), somehow it the variable count didnt set to ‘0’. Does it require special variable names for each app?

    Thank you.

  6. I was working through this example with the latest version of Tasker (downloaded again today (6/11/2015). When I get to the part of adding the profile, my system never asks or gives me the chance to enter a profile name. Any idea what steps might be different from this example and the newer versions of Tasker ?

    Regards,
    Bob.

Leave a Reply

Your email address will not be published. Required fields are marked *