inbox zero integration with pop3 / imap

I would like to stay on top of email, and I use a email provider other than Google for privacy reasons. Is there any data integration?

Existing solutions:

  • official inbox zero plugin - but only Google
  • JMAP skript - but only Fastmail
  • Chatgpt can of course make something that queries IMAP / POP3, but it cannot reliably post to Beeminder because the API docs don’t even document the returned JSON. Let alone the intricacies around posting several data points the same day. So it blows up my time budget.

Does anybody else have a solution? Or even parts of a solution - e.g. something that can post back to Beeminder and is easy to re-use?

1 Like

The intricacies around posting several datapoints the same day aren’t so much technical as they are "intention"al, i.e. what do you want to happen?

  1. deciding what you want to count

Do you want the last datapoint to count? do you want the first datapoint to count? the average? the largest?

  1. deciding whether you want to be fancy with multiple datapoints or not

If you’re not fancy, you just post a datapoint every four hours or whatever. Let Beeminder aggregate it (see #1).

If you want to be fancy, you check to see if there are datapoints for today, recalculate* what datapoint Beeminder is effectively using for the day so far, and deciding what to do. If it’s still accurate, maybe just change the comment. If it’s not accurate, you could replace it, or add a new one.

It’s kinda nice to have it not add a datapoint if the value hasn’t changed.

  1. responding to webhooks

If you make your integration respond to webhooks, and set that up in the API, Beeminder will ask for data from your integration when it needs it, when you hit the refresh button on the goal, etc. I don’t think a lot of people do this, but I’ve put it on my homegrown integrations and I’ve grown to think of it as personally essential.

  • I’ve written before about how it’d be nice to get the aggregated datapoint directly from Beeminder.
2 Likes

Maybe I’m just not smart enough to find the documentation* - but I never could figure out what the standard goal types do when you post several data points in a single day, nor how to change that to the total or the latest.

* except for the custom goal types, which are largely irrelevant. (As an aside, I always assumed you created that goal type for some special case in autodata integrations, and then published it to make the other plans look inexpensive in comparison. They would be great for situations where utility is not linear with effort, e.g. injury risk when working out, deviation from Merten share when investing, hysteresis in sleep hygiene, expected waiting time (in the sense of queueing theory) of your todo list, etc)

Hmm, interesting, I guess we kind of assume it’s obvious or something? (To be clear, it’s very useful to know that it is not and that this is flawed reasoning, and that it’d be good for us to make it more obvious or add it.) Or that you’ll just pick the same goal type as we suggest for a similar goal… I’ll think whether/where we should work it into the documentation, but for now I can answer the basic question!

All of the goal types use the exact same moving parts as custom goals, and can be converted into custom goals if you have Bee Plus/Beemium and you want to change that.

  • Do More: they use aggday “sum” and have the cumulative option set. If you add multiple datapoints a day, it’s additive – essentially a datapoint of 3 is saying +3, a datapoint of 10 is saying +10, and with both of them added it’s +13 for the day.
  • Do Less: they use aggday “sum” and have the cumulative option set too, it’s just that more is bad in this case.
  • Odometer: they use aggday “last” and do not have the cumulative option set. If you add 3 and then 10, you’ve entered 10 for the day (and indeed for the whole goal). The next day if you’d done 7, you’d need to enter 17 for your +7 to be counted.
  • Weight: they use aggday “min” or “max” depending on whether it’s a weight gain or loss goal and are non-cumulative. You’d enter your data (whether weight or something else simply using the same logic) as whatever ‘weight’ you were that day.
  • Whittle Down: they use aggday “min”, and are non-cumulative. You add your current datapoint, e.g. I have 1250 items in my Readwise inbox at the moment, so my datapoint is 1250. If I archive 10 of them, then my datapoint is 1240.

For an inbox goal, you’d probably want a Whittle Down goal; that’s the use-case Whittle Down goals are pretty much designed for.

To change it, you would convert the goal to a custom goal, and then make any changes you want there:

To change whether the days get added to each other, you’d uncheck “cumulative”. To change how datapoints behave within the day, you’d change the “aggregation” dropdown; in my example it’s already been changed to “cap1”, for instance.

As for why custom goals are expensive, it’s because they get complicated, both for users to understand, and for us to fix if they go wrong. They’re expensive to support, so they’re expensive to create (though if you have a custom goal set up, it keeps working that way even if you then go down to infinibee or no subscription). The official goal types are all tried and tested combinations of settings, which the support team can handle at a glance.

We don’t do any psychological pricing tricks like “price something high to make something else look more reasonable”. Things are priced so that they pay for themselves, as best as possible. Custom goals exist so folks can do cool stuff that Beeminder itself won’t do, like have a non-cumulative goal with a flat line. A lot of the aggdays are unique to custom goals, rather than being built for an integration. The integrations almost all use the major goal types, e.g. Gmail Zero uses Whittle Down, Withings uses Weight, Rescuetime can use Do More or Do Less, etc, etc. The exception is Curlex, which comes as a custom goal by default, for anyone.

1 Like

Keeping an inbox at zero is probably best served with a do-more goal, so it’s sum.

That raises the questions:

  • How do I upsert a data point?
  • What can the returned json contain, i.e. what kind of errors can happen?
  • Where can I find a (Python) Beeminder library to base my code on?

I can’t answer the technical level questions, but you need to think about what your datapoint represents. If it’s a Do More goal, it needs to be a positive number (or numbers) representing the amount you did today, and it needs to be entered before the deadline. So you’ll need to think about where you’re going to get that number from, or how you’re going to transform the number you actually get into the number the graph needs, and how to ensure that you only get credit for the amount you’ve done.

For example, if you have things set up so your automation sends a +1 when you zero your inbox, and then you get a +1 by 1pm, you don’t want your automation to keep adding +1s all day while your inbox remains at zero, for instance. You could handle it by making the goal custom and giving it a “cap1” aggday (meaning only 1 per day would ever count), as one example.

Beeminder doesn’t handle transforming a datapoint of X into a datapoint of Y, so you’d have to write something to do that yourself.

The usual choice for an inbox zero goal would be a Whittle Down goal (also sometimes referred to as a “Keep Under” goal) with a zero rate, flattened at a given total (e.g. 0) and an aggday of min. Then you’d just want to send the current number of emails in your inbox, and no transformation of that number is needed. This would tend to be simpler.

I want the integration to be useful to everybody, and stay a useful reflection of the amount of effort invested in keeping the inbox empty - so it will have to use a do-more goal. (The whittle-down goal doesn’t have good pessimistic presumtions once we are in the stay-at-zero stage.)

The integration will check every few minutes if the daily email wrangling has been done, and then post a +1. Of course, next time it checks, it can happen that no new mail has arrived, so it will try to post another +1. That’s where the upsert comes in.