# Lights-out time button

**URL:** <https://forum.beeminder.com/t/lights-out-time-button/5631>\
**Category:** Tech\
**Created:** [August 8, 2019, 9:13am UTC](https://forum.beeminder.com/t/lights-out-time-button/5631 "2019-08-08T09:13:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tsaftaridis](https://avatars.discourse-cdn.com/v4/letter/t/ebca7d/32.png) [@tsaftaridis](https://forum.beeminder.com/u/tsaftaridis)\
**Post date:** [August 8, 2019, 9:13am UTC](https://forum.beeminder.com/t/lights-out-time-button/5631/1 "2019-08-08T09:13:37Z")

</div>

Hey guys,  
I’ve been using beeminder to track minutes in bed before 00:00. Up to this point I have been entering the data manually. What I tried to do is this: IFTTT do\_button press on iOS → data point with minutes until midnight in beeminder.

I have made an applet in IFTTT to do that. It sends the time (in minutes) until 00:00 to a beeminder goal, so you can track how early you go to sleep (e.g. I have set the goal to 30 minutes per day, so I have to sleep before 11:30).

If you want to use this applet, create a new one and:

1. Set the ‘if’ to “do button”
2. Set the ‘then’ to “add beeminder datapoint”
3. Complete the fields that show up:  
Select the beeminder goal you want the applet to send data to (I used a “do more” goal).  
Here is the IFTTT+Beeminder macro, which you can use in the “Datapoint Value”.

`PROD[60, SUM[24, -TOD[{{OccurredAt}}]]]`

1. Save and test (you can use the IFTTT widget in ios - this is a widget do button after all)

(this was actually a post asking for support, but I tinkered with the macros and it worked finally, just before I posted 😄 )

I hope someone finds this useful. 😉

---

<div class="post-metadata">

**Author:** ![zedmango](https://avatars.discourse-cdn.com/v4/letter/z/c67d28/32.png) [@zedmango](https://forum.beeminder.com/u/zedmango)\
**Post date:** [August 8, 2019, 5:52pm UTC](https://forum.beeminder.com/t/lights-out-time-button/5631/2 "2019-08-08T17:52:38Z")

</div>

Also see:

> [@How do I get time of day from IFTTT for location?](https://forum.beeminder.com/t/how-do-i-get-time-of-day-from-ifttt-for-location/4120/2):
>
> Figured it out! OccurredAt does have the time in it and PROD[60, SUM[TOD[{{OccurredAt}}], -9]] works perfectly. I may need to change it to PROD[-60, SUM[TOD[{{OccurredAt}}], -9]] for minutes before 10 so that I can use the slope functionality.

> [@Beeminding getting to coffee shop by certain time each day](https://forum.beeminder.com/t/beeminding-getting-to-coffee-shop-by-certain-time-each-day/1043):
>
> This was a question from a user that I think some of you all will have better answers to. How can one beemind getting to a coffee shop (or wherever you do your work) on time every day? Here are some possible answers I’ve thought of so far: Just beemind total time spent and let the start time take care of itself. Like if you have 8 hours of work you have to get done and you want to be home by dinner at 5pm then you have to start before 9am. So, problem solved. Forget Beeminder. The [BetterMe](http://www.bettermeapp.co/) ap…
