Let Google Home Read your unread (Whatsapp-)Messages 2018-02-04

When you ask your Google Home if you have any unread messages it will fetch them and read them to yo

  1. capstan
    What will you need for this tutorial?
    - Tasker
    - AutoNotification
    - AutoVoice
    - AutoCast

    Here's a video of the result. It's in German so don't expect to understand anything, but you get the idea and know how long it takes to respond with the message. (Gonna change it to english if someone provides me a vid)



    STEP 1 - ADD A NEW TASK AND LET IT GET YOUR WHATSAPP-MESSAGES


    • go to Tasks -> hit the + and name your task (Read Whatsapp)
    • Add Action Query (under Plugins-> AutoNotification)
    • Hit the pencil to configure the Action
    • Hit "Apps" and check Whatsapp
    • back out by hitting the check-button
    (i) Now Tasker looks for new Whatsapp-Notifications and gathers the information. Sadly the message content is stored in different variables, depending if you received one message or various. (Because of Android's notification grouping). So we'll need to add different AutoCast Actions, so it reads the right content.


    STEP 2 - ADD AN AUTOCAST ACTION FOR ONE RECEIVED MESSAGE


    • Add A New AutoCast-Action Speak (under Plugins -> AutoCast -> Speak)
    • hit the pencil for configuration
    • choose the device you want the message to be read
    • in the textfield write %anticker . . . %antext
    • Add an "If" (scoll down and hit +)
    • on the left type %antext
    • Hit the ~ and choose Set in the dropdown menu
    • Back out and a new Action will be added
    (i) This will look if the variable for one message is set and if yes, speak the Title "1 message from x" followed by the message's content.


    STEP 3 - ADD AN AUTOCAST ACTION FOR VARIOUS RECEIVED MESSAGES


    • Add an "If" (+ -> Task -> If)
    • under condition type %antextlines
    • Hit the ~ and choose Set in the dropdown menu
    • back out with the arrow
    • Add an action Variable Search Replace (Variables -> Variable Search Replace)
    • Under Variable write %antextlines
    • under search put =:=
    • check Replace Matches
    • under replace With write . . .
    • back out with the arrow
    • Add A New AutoCast-Action Speak (under Plugins -> AutoCast -> Speak)
    • hit the pencil for configuration
    • choose the device you want the message to be read
    • in the textfield write %ansummarytext . . . %antextlines
    • Back out and a new Action will be added
    • add an EndIf Action
    (i) This will look if the variable for various messages is set. If yes it will replace =.= (Which is placed between the individual messages) with . . . to make a pause when reading. Then it will read the title "X messages from X Chats" and the content)


    STEP 4 - ADD AN AUTOCAST ACTION FOR NO RECEIVED MESSAGE


    • Add A New AutoCast-Action Speak (under Plugins -> AutoCast -> Speak)
    • hit the pencil for configuration
    • choose the device you want the message to be read
    • in the textfield write No new messages received
    • Back out and a new Action will be added
    (i) This will say, that there are no new messages are available if both variables are empty.

    (i) If you currently have any unread messages (the notification must be showing!) then you can try if the casting works by hitting the play button in the bottom bar. In any case you can hit the arrow to go to the Tasker main screen.


    STEP 5 - ADD A AUTOVOICE PROFILE THAT WILL TRIGGER YOUR NEW TASK


    • Go to Profiles and add a New one with the +
    • Add a Trigger called Recognized (Event -> Plugin -> AutoVoice )
    • hit the pencil for configuration
    • Under commands write Do I have any new messages? Or/and Do I have new Whatsapp messages? Did anyone text me? Or Whatever you want to say to the google home
    • under responses write <speak>One moment please <Break time="200ms)/>, Messages are retreived</speak>
    • Hit the Check and back out
    • Choose your finished Task "Read Whatsapp"
    (i) This profile will run the Task we did before whenever you ask Google Home "tell AutoVoice do I have any new messages?"

    Obviously you can set a shortcut to this, so you won't need "Tell Autovoice"



    You can adjust this to your prefered messaging app, you just need to choose another App in the first step. You might also need to adjust the variables that are spoken.

    PS: For any english speaker: could you make a short recording of how it will work at the end? (There is no way of changing the notification title "1 new message" to english without changing the whole system language and it doesn't make sense to demo my GH speaking gibberish.
    majormaks1204 likes this.