Tasker event for goal completion
I've been trying to set up Tasker automation for goal completion.
As an example: I open up my reader app and, thanks to #11, Tasker starts a reading timer automatically and mutes the phone, and then once my reading goal for the day is done, switches the sound profile back. The first part works great! However, I can't get intercepting the goal completed event to work. I experimented a bit with pulling the data from the notification, which failed because I couldn't identify the particular activity - I just have the app name and that some daily goal was finished, via goal_time_tagday.
But perhaps a much simpler approach would be to add another Tasker event to automated tracking: if "Send events" is enabled in options, when any goal gets finished, send a com.razeeman.util.simpletimetracker.EVENT_COMPLETED_GOAL with all the Extras of existing sent events (at least, at a glance all of them seem applicable?) plus:
extra_goal_typefilled depending on thegoal_time_tagday(so,"session","day","week"...)- optionally:
extra_goal_unit: 1 or "s" depending on whether it's a count or duration goal - optionally:
extra_goal_value: whatever the value that triggered the goal completion, either number of tracked entries or duration in seconds as per above.
Would this be a welcome addition? :)
Hello! Thank you for the feedback. This could be done. Can you explain a bit more your usecase, why can't EVENT_STOPPED_ACTIVITY be used for this? To switch sound profile back not on goal reached but on activity stopped. I understand that this is a bit different.
@Razeeman I am using events to control the time tracker from an iOS device via shortcuts.(Sending json sms messages that are read by MacroDroid that then fires events to the app).
I have a goal for an 8 hour workday. It would be nice to have an event fire back to play a sound in iOS to let me know I completed the goal. My workday can be non contiguous. So to do this I would need to be logging the minutes in iOS also to figure out if I hit 8 hours.
Plug for an iOS version with Shortcuts support. This app may be the singular reason I maintain an Android device. Thank you very much for your work on this.
I see, thank you for the explanation, will look into it again.
Have added new event for goal completion, will be in the next release.