Some of those data types are things that a person might want to beemind, but they’re not necessarily in a format that the Beeminder Add Datapoint Action recognizes, so rather than try to be overly clever and make guesses about what you meant and if you meant it, we’ve added in some macros for the Value field.

Trigger Ingredients

First lemme provide a little illustration of what I’m talking about with Trigger Ingredients, and how to find them. Setting up an IFTTT recipe from scratch, when you get to the THAT, you’ll find Trigger Ingredients by clicking on the blue erlenmeyer flask that shows up when you click on a text field.

When you pick an Ingredient it then gets subbed into the field like this:

Now if you were to send this time ingredient to Beeminder as the value for your datapoint, it would generate an error. This is where our macros come in. So far we’ve noticed two types of Trigger data that people commonly want to send to Beeminder, and made macros.

TOD[]

Say you want to use the time-of-day part of a full DateTime string, e.g., the IssueClosedAt Ingredient I used in the Github example above. Or more likely useful, the AwokeAt Ingredient from Fitbit’s “New Sleep Logged” Trigger. We’ve seen people using the time from this ingredient for “Do Less oversleeping” goals, for example.

Use:

In the Add Datapoint Action’s “Value” field, wrap the Trigger Ingredient with TOD[], so e.g., TOD[{{AwokeAt}}]. (Originally we called this “pumpkin” so that’s what the image shows and both now work.)

Then when we get a string TOD[May 12, 2015 at 06:30AM], we will throw away the rest of the date portion and use only the time, 6:30, and submit that to Beeminder just as when you submit 6:30 through the web interface (Beeminder interprets it as 6.5).

HMS[]

IFTTT Triggers also sometimes provide a duration value, e.g., in the case of Fitbit Sleep again, we have TimeAwake, which is the duration of the time Fitbit figures you were actually awake, despite being in sleep mode. This is typically a string that looks like “30m”, or “6h 23m”.

Use:

Then when we see HMS[] submitted for a Beeminder value from IFTTT, we get rid of the d,h,m,or s part and turn it into a value that Beeminder recognizes, e.g. 6h 23m => 6:23 => 6 + 23/60.

NUM[]

Say you have GoodReads autotweeting your page number and you want to send that to Beeminder. But the tweet is something like “Bethany is on page 54 of 512 of…”. You want to grab just that first “54”.

Use:

In the Add Datapoint Action’s “Value” field, wrap the Trigger Ingredient for the tweet text in NUM[] like NUM[{{Text}}].

SUM[]

We don’t know if you’d ever need this but it sounds theoretically useful! If you wrap a Trigger Ingredient in SUM[] then we’ll parse out all the numbers and sum them up and send that along to Beeminder!

PROD[]

And the same for multiplying, because @peppertoni has a great use case for this with assigning points per minute of different activities.

Hmm. Looking at this and I think we could do a macro that just looked for the first number in a block of text and used that… (A good example of the sort of thing that could fail in a super confusing way if we just assumed, but works nicely with a macro). It looks like the IFTTT RSS trigger can match on a simple word or phrase, so here’s an item from my GoodReads RSS:

We just updated the wiki at the top of this post with new macros! Quick summary:

TOD to extract time of day from a timestamp

HMS to turn things like “6h30m” to 6.5

NUM to extract the first number from arbitrary text like a tweet or RSS entry

SUM to extract all the numbers from arbitrary text and sum them

Let us know what else you might need. We could get arbitrarily fancy and let you specify regexes but @bee suggests that at that point maybe you just want to write your own code and use our API. (But if you’d use more fanciness if we made it available, let us know! This stuff is easy to add.)

Looks like the ingredient you’re using, the entry content, has a link in it which contains the number 22341276 before the other numbers. Inspecting the RSS feed, it looks like you should try the EntryTitle.

Can you do Math with these macros? Say I want to mind the time I leave for work in the morning, but my SmartThings presense doesn’t time out (by design) for 15 minutes after I have left. Can I somehow input TOD[time presense left]-15min to compensate for that? (I know I could just change the goal to mind a different amount, I’m just curious if I can correct the input.)

The above is a real use case that I would love to use. I have been trying to figure out how to mind leaving for work for a while. The addition of macros enables it (!), and now I’m just thinking about how to operationalize it.

[There are a couple of other things I have to consider, like how to treat Saturdays and Sundays, when my leave time is more erratic, how to deal with false alarms, etc.]

Thanks a lot for implementing the macros! I already imagine how their introduction will make the recipes I already have even more automated (=> less time consuming).
As for the maths-related macros, here is another real-world example in which it will be highly appreciated:
I have a goal for the number of steps I make a day. I also have a more general physical-activity goal, and I have decided that the number of steps exceeding my daily average accounts towards that goal, each step over the average being 1/1000 of the unit in the physical-activity goal. So I would very much appreciate the possibility to create a recipe using the point entered to steps goals as a trigger component, feeding the result of (X-6000)/1000 into the physical activity goal.
However, even the introduced num macros will help me with this somewhat. I can definitely do the math myself and enter the result into the comment and make the recipe feed on it…

Brilliant! The need for the second “started reading” recipe (using the odometer reset feature) is going to be super confusing to newbees. And it means this only works for beeminding reading when you read books strictly sequentially. It might be time for a proper Goodreads integration!

There’s no way to get the deltas (actual number of pages read) as RSS entries or tweets or anything, is there?

@scarabaea : Also remember that you can chain these together, so if you need multiple calculation steps you can create intermediate (and lenient!) Beeminder goals that calculate one element, then use the IFTTT datapoint-added trigger to feed that to another Beeminder goal…

True! Ideally the intermediate variable will have value in its own right.

e.g. my RunKeeper goal tracks my total mileage (in km, of course), but my ‘exercise’ goal only gets updated if each session exceeds a threshold. That sounds similar to the OP’s desire to only count steps in excess of a threshold as exercise. Both the step-counting and the mileage have some QS value independent of the real-world goal.

Definitely this would be a better method, since I’ve just found another drawback of my recipes. I read 91 pages and finished my book, but the RSS feed update for completing a book is not the same as the one for progress in a book. It has no mention of page numbers, so there is nothing for an IFTTT recipe to grab.

Therefore, I will still need to manually input the book’s total pagecount when I finish a book. I am glad I noticed this before I started another book and the recipe automatically zero’d the odometer!

Ok, the IFTTT macros are now nestable. So you can do SUM[NUM[{{Ingredient}} TOD[{{OtherIngredient}}]] etc. I’m still holding out on implementing a complete calculator and doing a MATH macro. It seems like overkill to me.

Warning: at this point things are very forgiving/lazy in terms of error checking, so if you have several nested macros, you will only see an error if the final result is not numeric. For example, if you TOD[something that isn’t a time of day], you’ll just get the empty string. Submitting a nothing for a datapoint value will produce an error, but if that TOD[] is nested down inside another macro that does have a numeric result, you won’t hear of the empty TOD.

This is maybe a feature, or maybe a bug, depending on how you look at it

I would like some math. I have a homebrewed rewards system where I get points for doing positive things. I would like to able to multiply the number of minutes logged to time based goals by their points value. So, I could be given half a point per minute of yoga and three points per minute of running. Then ifttt can send the points straight to my system and I can get more rewards

I could also see it being useful for those with bucket goals fed by subgoals who want to get twice as much credit for harder tasks or activities.

I don’t need a whole calculator yet but an ability to multiply would be great and I’d use it heaps!