WhatsApp Voice Notifications

This task and profile set enables voice notifications for Whatsapp messages.
The voice notification will not fire if the phone is facing upwards1 or if the screen is turned on2.
The voice notifier will replace unknown numbers3 with the word "unknown" to skip reading out the full number.
Note: If your phone is on silent, the voice notification respects that!

You need to create 2 profiles (one is reusable for all IM) and 1 task.

Just a tiny bit of coding


New state profile named GetPosition
based on State > Sensor > Orientation > Face Up > Inverted
Attach anonymous task:

  1. Variable Set Name %isUp To False

New task named WhatsappNotifier

  1. If %SCREEN ~ off
  2. Variable Set Name %isUp To True
  3. Profile Status Name GetPosition Set On
  4. Wait MS 512 Seconds 0 Minutes 0 Hours 04
  5. Profile Status Name GetPosition Set Off
  6. If %isUp ~ False
  7. Variable Split Name %NTITLE Splitter :
  8. If %NTITLE1 ~R \+(?!\w)5
  9. Variable Search Variable %NTITLE1 Search ^([\w\-]+) Replace Matches on
  10. Variable Search Variable %NTITLE1 Search ^([\w\-]+) Replace Matches on6
  11. Say Text Whatsapp from %NTITLE1
  12. ELSE
  13. Say Text Whatsapp from unknown

New event profile named Whatsapp
based on Event > UI > Notification
Set Owner Application to WhatsApp
And attach WhatsappNotifier task


Exit and Enjoy. OR take it one further!

The same set can be applied for other IM, just take care with the step where you extract the sender's name, as Whatsapp notifications uses the structure:

Message from sender:

where others like Telegram only use:

sender:

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License