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

Tasker file changed event does not fire after a certain time

I experimented with a file changed trigger event (which is base functionality in Tasker).
The file path is specified relatively to the internal storage, e.g. /Tasker/task.txt.
It does work, but after an hour, or when I turn the screen off and later on again, it does not trigger anymore. So to be sure I checked 'keep device awake' in the 'Properties',but that does not work. Other tasks and events in Tasker (e.g. turning off wifi when the screen sleeps for at least an hour, do work flawlessly, because I have allowed Tasker to run in the background.

When I enable logging, I cannot see any logging as well. And the log file Tasker/log/tasker.txt (which logs all events in Tasker, regardless when logging is on or off) does not contain any related log records as well.

When I deactivate and reactivate the file change trigger again it works for the next 10-30 minutes and then it does not work anymore.

When can here be the problem ?
 
Your problem description is rather imprecise. I ASSUME you are referring to the File Modified action in Tasker.

To test it I created the following profile triggered from the change and a task that makes the change.

Profile: Pro3
Event: File Modified [ File:sorted.txt ]
Enter: Pro3Enter
A1: Flash [ Text:– Pro3Enter – Long:On ]

Dev6
A1: Read File [ File:sorted.txt To Var:%xxxxxx ]
A2: Write File [ File:sorted.txt Text:More Data Append:On Add Newline:On ]

The sorted.txt is in the Internal Memory folder.

I could not get it to not trigger on a file modification.

… Thom
 
Your problem description is rather imprecise. I ASSUME you are referring to the File Modified action in Tasker.

To test it I created the following profile triggered from the change and a task that makes the change.

Profile: Pro3
Event: File Modified [ File:sorted.txt ]
Enter: Pro3Enter
A1: Flash [ Text:– Pro3Enter – Long:On ]

Dev6
A1: Read File [ File:sorted.txt To Var:%xxxxxx ]
A2: Write File [ File:sorted.txt Text:More Data Append:On Add Newline:On ]

The sorted.txt is in the Internal Memory folder.

I could not get it to not trigger on a file modification.

… Thom
You are right, and it works for a limited time, i.e. after an hour when I change the file again, the event is not triggered anymore, unless I disable and enable the trigger again.
 
About / Credits
About
Version: 5.6

For Android: 5.0+

Copyright © 2009-2010 by Lee Wilmot
Copyright © 2011-2018 by Crafty Apps Ltd
Copyright © 2018+ by Kitxoo, Unipessoal Lda
All Rights Reserved.

Website,Forum:
 
I suggest you report the problem to the Tasker author.

Perhaps you have another profile that is introducing the problem.
If this version still has the Run in Foreground option … do you have it selected?

While trying to reproduce your problem (I could not) I encountered the following and reported it …

android 8.0.0 / Tasker 5.6.5b strange behavior …

Two profiles with File Modified action defining the same file …
  • If Pro3 and Pro4 profiles are enabled only Pro3 is triggered.
  • If Pro3 is disabled and Pro4 is enabled … nothin is triggered.
  • If the file in Pro3 is a different file name and Pro3 and Pro4 are enabled … Pro4 is triggered.
Dev6 is used to introduce the change into sorted.txt

Profile: Pro3
Event: File Modified [ File:sorted.txt ]
Enter: Pro3Enter
A1: Flash [ Text:– Pro3Enter – Long:On ]

Profile: Pro4
Event: File Modified [ File:sorted.txt ]
Enter: Pro4Enter
A1: Flash [ Text:– Pro4Enter – Long:On ]

Dev6
A1: Read File [ File:sorted.txt To Var:%xxxxxx ]
A2: Write File [ File:sorted.txt Text:xxxxxxxx More Data xxxxxxxx Append:On Add Newline:On ]

… Thom
 
Thanks for the tip, but AFAIK, there is no other task at the same time involving the same time, and if it is (one which writes the clipboard contents at the same file as a trigger op 'copy clipboard'), I have built in a semaphore.
Screenshot_20181230-130905.jpg
The event triggered at 'copy to clipboard', writing its contents to a file. It sets a timer 3 seconds after 'now' preventing the 'file changed' trigger performing the task. It runs in the background as well.


Screenshot_20181230-130844.jpg
The properties popup, depicting it runs in the background (keep awake).

Screenshot_20181230-130829.jpg
Event triggered when the file is written which copies its contents to the clipboard. This works only for half an hour after enabled manually in Tasker, despite being set as a background task (see next screenshot).
 
There are a number of conditions in the tasks you posted that might stop it and give the appearance that it is not being triggered.

The profiles that you think are not being triggered are not shown in what you provided.

You can select a profile
three dots
Export
Description to Clipboard
and then paste it into a message.

The way to solve your problem is to start out simple with something that clearly works and gradually change it until it fails. In the example I posted the triggered tasks are simply flash statements.

… Thom
 
Thanks for the tip, I exported all the events and tasks as a description.

I made a simple Flash task in response to the event:

Code:
    Profile: Anon (94)
        Priority: 14
        Event: File Modified [ File:htdocs/clip.txt ]
    Enter: Read file Test (99)
And the Read file Test task:
Code:
Task:     Read file Test (99)
        Stay Awake
        A1: Flash [ Text:%Cliplasttime Long:Off ]

This also works, but only for the first half to one hour.
 
Do you have screen timeout set to 30 min?

Did you try it without the Stay Awake? Did it make a difference?

… Thom
No the screen timeout is only 30 seconds, but after some time between 30 to 60 minutes, the task does not run anymore, hence I set it with Stay Awake on, but that does not help. It appears to be a bug in Tasker.
 
Back
Top Bottom