AutoNotification help needed for Simple whatsapp read aloud with AutoNotification

Discussion in 'AutoApps' started by mkkyah, Sep 2, 2015.

  1. mkkyah

    mkkyah Member

    Joined:
    Aug 29, 2015
    Messages:
    31
    Likes Received:
    1
    Hi,
    I'm trying to create a simple whatsapp readaloud project to use when riding my motorcycle.
    I didn't wanted to use sql or similar things, wanted to write title and text to txt files during ride and clean them at the end. There are 2 txt files: whatsapplast.txt (only last message), whatsappall.text (all messages during ride). I will use them with Autovoice to "repeat last message", "repeat all messages".
    Normally Tasker will write received message to corresponding txt files, read received last message automaticaly.
    There are 2 problems:
    --Message gets repeated when whatsapp app is launched. I can't find what is triggering this unwanted behavior. This is also causing a duplicated entry to whatsappall.txt file.
    --I don't want to miss some messages when notification area gets cluttered with upcoming messages. Launching whatsapp and killing for a workaround to clear notifications didn't work well and reliable. How can I do that?
     

    Attached Files:

    Gustavo Coelho likes this.
  2. mkkyah

    mkkyah Member

    Joined:
    Aug 29, 2015
    Messages:
    31
    Likes Received:
    1
    I have managed some improvement, but still need help.
    --I have implemented AN Cancel and it cleans the Whatsapp notifications most of the time, sometimes it fails. But the real problem is not solved, cleaning notifications does not clean unread messages from Whatsapp chat, so I get "4 new messages" instead of message text after a while. Is there a way to mark the message as read after readaloud? or mark all unread messages as read?
    -- Received messages are read 2 times, I can't find why.
     

    Attached Files:

  3. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
  4. mkkyah

    mkkyah Member

    Joined:
    Aug 29, 2015
    Messages:
    31
    Likes Received:
    1
    -- For the double messages: I have unthicked "event behaivour" in AutoNotification part of the profile, it seems ok.
    -- "Autonotification cancel" /"cancel all" works kind of, misses some messages but works most of the time. I couldn't cancel only whatsapp notifications with "AutoNotification Cancel";I have tried to input %anid, %anpackage, %antag to options, but could not make it work.
    --I didn't understand : "AutoNotification Actions" click the notification
     
  5. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    About point 2, can you try the AutoNotification beta? It lets you cancel by app which will make it easier :)
    About point 3, use the "AutoNotifcation Actions" action inside Tasker.
     
  6. mkkyah

    mkkyah Member

    Joined:
    Aug 29, 2015
    Messages:
    31
    Likes Received:
    1
    Thanks Autonotification Beta worked well with cancelling only whatsapp notifications. This method actually works almost good enough; the only problem occurs if multiple messages received before the task ends. Tasker only reads the first then misses others. Afterwards it reads upcoming messages normally and clears whatsapp notifications if they are received with enough delay. Do you have any suggestions?
    But I need more detailed explanation about point 3. Will that solve the problem I have with Autonotification Cancel.
     
    Last edited: Sep 7, 2015
  7. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    When you intercept a notification you get the %antouchaction variable.
    If you use that variable in the "AutoNotifcation Actions" action in Tasker, AutoNotification will simulate a click on the notification :) Hope this helps
     
  8. mkkyah

    mkkyah Member

    Joined:
    Aug 29, 2015
    Messages:
    31
    Likes Received:
    1
    Thanks I will try that, did you see my edited message #6 about Notification Cancel?
     
  9. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Can you please export your profile's description (not xml) so I can take a look? Thanks
     
  10. mkkyah

    mkkyah Member

    Joined:
    Aug 29, 2015
    Messages:
    31
    Likes Received:
    1
    Sure, also one thing I noticed; the tone when "A7:Autovoice Recognized" starts to listen is not played on BT headset, but on phone:

    Profile: WhatsappMsgRecvd (43)
    State: AutoNotification Intercept [ Configuration:Event Behaviour: true
    Notification Type: Only Created Notifications
    Persistency Type: Non-Persistent Only
    Notification Apps: WhatsApp
    Get All Fields : true ]
    Enter: Whatsapp Recvd (40)
    Run Both Together
    A1: AutoNotification Query [ Configuration:persistency Type: Non-Perstistent Only
    App Name: Whatsapp Package:com.joaomgcd.autonotification Name:AutoNotification Query Timeout (Seconds):0 ]
    A2: Variable Set [ Name:%WAtitle To:%antitle Do Maths:Off Append:Off ]
    A3: Variable Set [ Name:%WAtext To:%antext Do Maths:Off Append:Off ]
    A4: Variable Set [ Name:%WAid To:%anid Do Maths:Off Append:Off ]
    A5: Say [ Text:%WAtitle,%WAtext Engine:Voice:com.svox.classic:tur-TUR-Cem Stream:5 Pitch:5 Speed:5 Respect Audio Focus:Off Network:Off Continue Task Immediately:Off ]
    A6: Say [ Text:Repeat message? Engine:Voice:com.svox.classic:eng-GBR-Oliver Stream:5 Pitch:5 Speed:5 Respect Audio Focus:Off Network:Off Continue Task Immediately:Off ]
    A7: AutoVoice Recognize [ Configuration:Hide Dialog: true

    Voice command with headset
    Timeout: 5
    Command: "all" Package:com.joaomgcd.autovoice Name:AutoVoice Recognize Timeout (Seconds):120 Continue Task After Error:On ]
    A8: If [ %avcomm ~ no ]
    A9: Say [ Text:Ok Engine:Voice:com.svox.classic:eng-GBR-Oliver Stream:5 Pitch:5 Speed:5 Respect Audio Focus:Off Network:Off Continue Task Immediately:Off ]
    A10: Else If [ %avcomm ~ yes ]
    A11: Wait [ MS:0 Seconds:1 Minutes:0 Hours:0 Days:0 ]
    A12: Say [ Text:%WAtitle,, %WAtext Engine:Voice:com.svox.classic:tur-TUR-Cem Stream:5 Pitch:5 Speed:5 Respect Audio Focus:Off Network:Off Continue Task Immediately:Off ]
    A13: End If
    A14: AutoNotification Cancel [ Configuration:Id: %WAid Package:com.joaomgcd.autonotification Name:AutoNotification Cancel Timeout (Seconds):3 ]
     
  11. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Just to be sure, the problem there is that not all whatsapp notifications are cleared, correct?
     
  12. mkkyah

    mkkyah Member

    Joined:
    Aug 29, 2015
    Messages:
    31
    Likes Received:
    1
    No, AN Clear is working well after beta update. But remaining problem is, that with this method if multiple messages are received almost same time, some are missed to read. If the messages are received with enough time in between, it's working almost great. This is mostly happening when receiving group messages or when messages coming from 2 contacts.
     
  13. Acacio

    Acacio New Member

    Joined:
    Apr 26, 2016
    Messages:
    1
    Likes Received:
    0
    Mkkyah, I´m after exactly the solution you were looking for. Did you get it worked? My knowlegde in Autonotification and Tasker is limited. I did the part where it is read out loud and then the notification is clicked (%antouchaction). However, if I got 2 messages in a row (same contact for instance), when it starts to read the first one, it stops abruptly to read it out loud. DO you think you can help?
     

Share This Page