Time-tracking within a task-hierarchy

Same here. Have you come up with some solution in obsidian?

1 Like

I suppose it’s nearing time for me to make a plugin. I’ve had a couple people ask. At the moment, I’m using Templater’s JavaScript feature with Moment.js to keep track of time. I wear a stop watch to track the duration and Javascript can make some assumptions using it.

P.S.
I keep my time tracking in my daily notes, but would you have it any other way?

1 Like

How do you do that?

I found the super simple time tracker plugin also uses moment.js. To me, this seems lika a good approach, but for me, the plugin is too simple. For example, I would like to be able to edit start and end time of each session, but more importantly, I’d want to be able to calculate the total time spent on one timer but also across timers.

Basically, my idea would be that each note can have one ore more timers attached to it and then I’d be able to query a set of notes in dataview and have the tracked time of all of these notes added up.

My spontaneous idea would be to extend the super simple time tracker plugin into a simple time tracker plugin by modifying it so that total time for each tracker is written into the note’s metadata as totaltime:: or something, so that it becomes queryable.

Another important feature for me would be that the time spent on subtasks (=a note) is automatically added to the task (=another note). For that, notes would have to be put in a hierarchical relation to each other. This can be done using the Excalibrain plugin.

A slightly different approach to task hierarchies without Excalibrain would be to use the hierarchy of headings to represent the task hierarchy, i.e. timers in lower level headings get added to the timers of higher level tasks. The advantage would be to not be dependent on another plugin but the downside is that the time tracking plugin would have to do all the summing within the note because (I believe) the dataview plugin cannot do that. Another downside would be that it becomes somewhat more difficult to move subtasks from one task to another because one has to move part of the actual content of the note to a different note. (To me, this is not trivial, because I want to be able to quickly start a new note/task and track time against it without having to thing about which parent task/project it belongs to. That would be determined later.)

Unfortunately, I am not able to write such a plugin.

2 Likes

It’s probably very similar to how that plugin creates its timestamps. It’s really just JavaScript and a grade-school level of math. Quite boring really

Sure, I see no reason you couldn’t get most of that to work with the right tools.

I suppose in the coming week I’ll release a plugin that lets you track time in your format of choice. It’s not everything, but it’s a start. I’ll keep you posted.

2 Likes

That’s cool. I’m very curious to see what you come up with.

Since I wrote my last post yesterday, I have started looking into tasks plugin and realized that it uses a different logic that what my spontaneous for time tracking implied. It that plugin, a task is not a note but a line/block (in fact, I couldn’t find a way of automatically linking a note to the task (except, of course, by manually adding a link to the task’s line). But this can probably be automated with quick add or so.

So, what I’m wondering is wether my idea to track time against a note (which, in my mind, would correspond to a task) actually is a good idea, given that a task in the core task plugin is at a different level. My hunch is that it is still a good way forward because if a task is big enough to create a separate timer for it, it seems okay to create a note for it (and link to it from the task block). In that note, there can then be more tasks which can either have their own note and timer, or they can be treated more like a check list that I work through, while the timer for the parent task is running.

I also noticed that the Project plugin also uses notes for tasks (i.e. anything below the project level), so that fits nicely. It allows you to specify a template for each task so you can just include the code block for the time in that template.

But I don’t think the time-tracking plugin would need to be tied to the Projects plugin, i.e. I don’t think it should use the project - task hierarchy when adding up the times from notes lower down on the hierarchy. I ementioned Excalibrain as a way of mapping hierarchical relationships but it just occurred to me that we don’t even need Excalibrain. We can just use nested tags. I think that would be the most robust implementation for the task-hierarchy.

So, basically, in any note with a timer, you’d specify which level of the task hierarchy that note belongs to and then it would be very easy (and flexible) to use dataview to create a report for whichever level you want. In other words: it would be completely irrelevant where in your vault the note is (or whether or not it is mapped onto a project in the project plugin. The only thing that determines how the time tracked in this note is treated are the tags, e.g. #project1/sub-projectX/task-A/sub-task9…

@ohm.one How are things going for you?

I had intended on getting back with you sooner, but I suppose the holiday season got the best of me.

I’m a little behind on my Obsidian tooling, so I’m just now getting my first plugin, Obsidian Plugin Manager, finished.

I should be able to publish a cleaned up variant of my time tracking script next week. We’ll see how I end up with the plugin.

I appreciate your time. Have a good day.

2 Likes

Arriving very late to the party but your project seems very interesting, quite similarly to tophee, I am also currently tracking basics data with tacker but didn’t find the way it manage time very usefull.
Will also love to hear more about your project if you find the time to invest in it the future!
And thanks for you website, very usefull information for beginner, like the backup advice and security advices.
Will check out your plugin manager as well.
Take care, thanks for sharing :slight_smile:

Hey @Emphazed,

I really appreciate the encouragement. I’ve been procrastinating on this kind of stuff for awhile.

I’ve been slowly creating more tools to deal with my thirst for time tracking, so I’m curious what you’d like to be able to do yet can’t.

1 Like

Hey ohm.one, this is all very interesting. I read the post on your site, and the various discussions on here, with growing excitement. But not meant to be nosy in any kind of way. Just very interested in your setup. Ta,

Hey @duifkruid, I appreciate the interest. It seems like I’ll have to make a post about the specifics (and updates) at some point. I built most of it in JavaScript and it has changed over time.

I know I’m gonna keep avoiding it, so would you consider being my accountability partner? All I need you to do is select a date sometime after this month and I’ll do my best to release it by then. Sure, the only consequence is disappointing my new internet friend, but I suspect that’s motivation enough.

P.S
As to not spam this post with irrelevant comments, It may be best for you to PM me the message; however, if you post here I may have more accountability friends, so I do as you like.

1 Like

Hey @ohm.one, I genuinely laughed out loud upon reading this. Not unfamiliar with the (neurodivergent, aren’t we all) trait of following the dopamine myself, and losing it just as easily. Indeed, an accountability buddy does help. I will publicly and gentily demand here an update of the timeline of your thought process by Sunday, Sept the 10th. I will PM you as well (bc I love an accountability partner for myself! :slight_smile: ), but a public message makes accountability friends, as you said.

PS You know this isn’t a hard deadline; nothing would go amiss if you missed it. We would just be disappointed if you didn’t meet it. :wink:

2 Likes

I appreaciate it @duifkruid. That’s exactly what I was hoping for, so I’ll be working on that.

Also, if anybody has any wonderings about any specific part of my workflow, please let me know. I’ll do my best to add it in to my work or just reply.

2 Likes

Unfortunately I’ve missed the deadline. My apologies @duifkruid. Technically I do have it written, but I suspect you’d prefer something better than something rushed. I’m pushing the date to the 17th. :sweat_smile:

1 Like

Thanks for the encouragement everyone! I did fail to post here yesterday, but I got my article released if you’re interested in checking it out. I’ll probably make a post on showcase next week once I release my full scripts.

I am sorry I failed you Ohm.one! I had a very sad occasion here, and was totally distracted. I will check out your article first! Cheerio on the progress :sunglasses:

Thank you @ohm.one - I need this in my life! I have been using the third-party time tracking service Toggl for years and I have recently migrated my GTD and journaling systems from Notion to Obsidian. I have become determined to recreate as many of the third-party second-brain systems which I rely on in my Obsidian vault instead.

As I encounter advanced setups like yours or the QuickAdd plugin creator’s Project and Goal workflow (found here), I have realized my need to brush up on my understanding of JavaScript, CSS and HTML. I have been going through a free YouTube course from SuperSimpleDev (found here) which has helped me do a decent amount of tweaking with .css snippets and some inline JS fields to other components of my system.

Before finding your work, I setup a QuickAdd that creates a timestamp and lets me put in some autocomplete tags for project / routine, client, context and location, but I like the idea of checking the status of the last entry before proceeding and allowing me to enter a stopwatch duration. I would love to have the details of these entries used in reports, charts and graphs like Toggl, but actually have them show up in queries on their associated project or routine pages.

Unfortunately, try as I might, I cannot seem to get your time tracking system working. I have read both of your articles as well as these forum posts and I am trying to follow along with your GitHub readme instructions, but I am doing something wrong somewhere.

I believe that I have accurately modified the “dailyNotePathSchema” in the template.md file with the path and format to match those in my daily notes, since it is writing new blocks to the bottom of today’s note when calling on template.md through the command palette using Templater - Open Insert Template Modal.

I believe that I have accurately listed my workflow directory in the YAML of the daily note template because when running template.md from Templater, it will prompt me to choose a file in the Workflows folder, which it does put into the new blocks in link brackets after the hourglass emoji.

I put an inline field below the YAML of the daily note template like this, since I couldn’t figure out how to get inline JS to work in the frontmatter:

“Created:: $= dv.current().file.ctime.toFormat("yyyy-MM-dd hh:ss X")

This gives me the date format with the Unix token like your example dailyNote contains but I am not sure if your system even uses this anywhere.

I created new fields in the daily note template for “time_start_placeholder_tag:” called “commence” and another for “time_stop_placeholder_tag:” called “terminate” but they don’t seem to get used or prompted for anywhere, from what I can tell anyway. My results also don’t change if I eliminate these two lines form the frontmatter, so I am not sure that I understand their purpose at all.

The new blocks look like this when I select the workflow file I have called “Driving” as an example:

  • #I ==00:00==-==00:00== (:hourglass_flowing_sand: [[Driving]]) ^id-1
    • :PROPERTIES:
      • :BEGAN: #BEG
      • :ENDED: #END
    • ==20:16== <%tp.file.cursor(0)%>

What am I supposed to do next? In your article you say step 3 is “add your notes and metadata” and step 4 is “Trigger the command and define the duration from your stopwatch”.

If I don’t edit anything and run the Templater command again, I get this error: “You must define group mapping for field id!”

If I change “#BEG” to a hh:mm time format and run the Templater - template.md again, I get a new series of blocks at the bottom of the daily note with a link to the new Workflow file it prompts me for.

The way you describe it, I would think that it would automatically generate a BEGIN time based on when I first used Templater to insert the template.md file, but instead it seems to generate that on the last line with the “<%tp.file.cursor(0)%>” text (“20:16” in my example above).

Where am I supposed to enter my notes and metadata? Where do all of these emojis for “linked content” and “how the activity went” that you mention in your more recent article come from? I can see them in you template.md code. but I am not sure how they are supposed to be chosen by the user. I could also get some array variables to show up if I create an “attributes” array in the “Driving” file’s frontmatter, but I don’t understand their purpose either!

Also, in step 4 it sounds like it should prompt me for a duration to enter form my stopwatch but instead it just goes right into prompting me for a new Workflow file to generate the next set of blocks.

Maybe you could provide an example of the template file that you use for the daily note which your readers could try to follow when recreating your workflow instead of just the dailyNote.md file, which is more like the end-result after using the Calendar plugin or another method to create the daily note?

I would love to hear from you, or anybody else who better understands your system, about what I am doing wrong. Thank you for your efforts and bravery for creating this and sharing it with the world!