• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Auto Reply announcing the incorrect date

Vernon27

Member
Hello Group,

Can someone possibly shed some light on the problem with the following Profile:

Device: Samsung Galaxy Note 3 (SM-N900V) running Lollipop (5.0); phone is not rooted
Tasker Version: 4.8m

The following Profile will announce any incoming text messages then send and announce the outgoing auto reply. Theproblem with the Profile is that it is not announcing the correct date when the auto reply is sent. For example, if "Michael" sends me a text message at 3:30 PM on Friday, December 18, 2015 the Profile will read out the context of the text message the current time and date and who sent the message. The auto reply will announce that it send aauto reply to "Michael" on June 12, 2015 at 3:30 PM. In other works it announces the incorrect date. This same Profile worked perfectly fine on Kit Kat.

Profile: Driving Home Auto SMS Response (14)
Event: Received Text [ Type:Any Sender:* Content:* ]
Time: From 6:15PM Till 6:30PM
Day: Mon, Tue, Wed, Thu or Fri
Enter: Drive Auto SMS Response (12)
A1: If [ %LASTSMS !~ %SMSRF ]
A2: Send SMS [ Number:%SMSRF Message:Auto-Response: Hello %SMSRN, I'm currently driving. I'll reply when I can. Store In Messaging App:On ]
A3: Variable Set [ Name:%LASTSMS To:%SMSRF Do Maths:Off Append:Off ]
A4: End If
A5: If [ %SILENTMODE = 1 ]
A6: Ringer Volume [ Level:8 Display:Off Sound:Off ]
A7: Notification Volume [ Level:11 Display:Off Sound:Off ]
A8: Media Volume [ Level:9 Display:Off Sound:Off ]
A9: End If
A10: Wait [ MS:0 Seconds:55 Minutes:0 Hours:0 Days:0 ]
A11: Variable Randomize [ Name:%textannounce Min:1 Max:3 ]
A12: Say [ Text:You received a text from %SMSRN that says %SMSRB Engine:Voice:com.google.android.tts:eng-gbr Stream:5 Pitch:5 Speed:5 Respect Audio Focus:On Network:Off Continue Task Immediately:Off ] If [ %textannounce ~ 1 ]
A13: Say [ Text:Vernon, %SMSRN has sent you a text and it says %SMSRB Engine:Voice:com.google.android.tts:eng-gbr Stream:5 Pitch:5 Speed:5 Respect Audio Focus:On Network:Off Continue Task Immediately:Off ] If [ %textannounce ~ 3 ]
A14: Say [ Text:%SMSRN is texting you and it says %SMSRB Engine:Voice:com.google.android.tts:eng-gbr Stream:5 Pitch:5 Speed:5 Respect Audio Focus:On Network:Off Continue Task Immediately:Off ] If [ %textannounce ~ 2 ]
A15: Say [ Text:Automatic driving reply has been sent to %SMSRN on %DATE at %TIME Engine:Voice:com.google.android.tts:eng-gbr Stream:5 Pitch:5 Speed:5 Respect Audio Focus:On Network:Off Continue Task Immediately:Off ]
A16: Wait [ MS:0 Seconds:0 Minutes:1 Hours:0 Days:0 ]
A17: Silent Mode [ Mode:Vibrate ]

Thank You,

Vernon
 
What do you get with a simple ...
Flash %DATE

Maybe the timezone set ib your device is incorrect?

... Thom

Hello Thom, the time zone on my phone is correct; inbound and outbound text messages have the correct date and time. Th Flash %Date flashes the correct date .
 
How about ...

You have another profile enabled on sending an SMS message that makes an announcement but with a date that first subtracts six months from the months portion of the date? Since it is audio output you only hear one.

Try disabling that action in this profile and run a test.

... Thom
 
Hello Thom,

I have no such profile that subtracts 6 months from the date. Its odd that this same profile works find on Kit Kat. Very odd.
 
Not applicable. I was confusing your issue with another one. Sorry.

For yours ... I'm at a loss but it still keeps nagging away at me.

... Thom
 
That's ok. I cannot seem to figure out why the auto announce is announcing the incorrect date. At this point I am not going to worry about it. Maybe its a cliche somewhere. As long as the message is sent and the correct date and time is timestamp and date stamp in my SMS app then I am not going to worry about it.

Thanks for you help. I really appreciate the effort. If u find something let me know.
 
That's odd behavior all right.
On the surface it sounds like a problem in Tasker's built-in variable %DATE.

But if it's not that, then I'd agree with Thom that the only part of your code that could play any role whatsoever is that action 15
A15: Say [ Text:Automatic driving reply has been sent to %SMSRN on %DATE at %TIME

The "types" of variables in tasker seem handled rather loosely. We don't declare a variable as an integer or a string etc, Tasker simply guesses from the context. The date is internally stored as a number I believe. When you plunk down %DATE next to some strings we ASSUME that it will convert the number %DATE to a string and then concatenate it with the other strings (and indeed that's what it does for me when I execute this same action). I can only guess perhaps in your case it is for some reason first converting an adjacent string (maybe even a space) to a number, then combining that number with the %DATE variable somehow, and then treating the resulting number as a date and converting it back to a string which ultimately gets concatenated to the other strings.

Can we do anything to be more precise in telling Tasker how to interpret this mixture of string and numeric values? There are no explicit string functions and conversions in Tasker that I know of. But there is the "append" option on the variable set command.

So maybe try replacing
A15: Say [ Text:Automatic driving reply has been sent to %SMSRN on %DATE at %TIME

with the following actions:
VARIABLE SET %mytext TO Automatic driving reply has been sent to
VARIABLE SET %mytext TO %SMSRN [APPEND = ON]
VARIABLE SET %mytext TO on [APPEND = ON]
VARIABLE SET %mytext TO %DATE [APPEND = ON]
VARIABLE SET %mytext TO at [APPEND = ON]
VARIABLE SET %mytext TO %TIME [APPEND = ON]

(If may also be necessary to do some more work to get a space between those pieces. There may be easier ways to force during concatenatoon...I'm not sure. )

It shouldn't be necessary to do all that, but if it fixes the problem it gives a hint that the problem lies in Tasker's parsing of mixed string / date / time argument to the say command. If it doesn't fix the problem, it'd be more mysterious… we'd have to figure out why Tasker's %DATE variable returns an incorrect value sometimes but not always.

Another thing to try is just to delete or disable the action and build it again from scratch (maybe there was a stray invisible character in there somehow...I've seen that happen giving weird results on pc before, although never in Android)
 
Last edited:
I think you may have touched on it. Contamination. I have had unexplained Tasker results in the past and if it was rebuilt from scratch they magically disappeared. It is so obscure that you tend to not think about it as a possible cause and solution.

You could try ...
Export XML to SD
Delete original
Reload Tasker
Import SML from SD


... Thom
 
Last edited:
Hello All,

For some strange reason the Profile now works. I did not make any changes or modifications. So no idea why it works now. Been working for two days now.

Thanks for all you help and suggestions.

Vernon
 
Location - Location - Location.

My guess is that there was a problem with Tasker storage. You made some other change and storage was adjusted removing the conflict.

After making a change ... do you ALWAYS chose Exit and then chose Save First?

... Thom
 
The same thing happened to me, it's in the date format. Your Tasker %DATE outputs "mm/dd/yyyy" but you are using a speech engine that reads it in GBR format of "dd/mm/yyyy" you may be able to set it in the tts options, I never looked, but for me I just set all my tasks that use date to a USA format.

EDIT: I changed the date format for in the phones settings for "Date & Time" and now it's fine!
 
Last edited:
Back
Top Bottom