# Help calculating end time based on minutes left

**URL:** https://community.homey.app/t/help-calculating-end-time-based-on-minutes-left/132944
**Category:** Questions & Help
**Created:** [March 17, 2025, 8:38pm UTC](https://community.homey.app/t/help-calculating-end-time-based-on-minutes-left/132944 "2025-03-17T20:38:09Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Skorpion](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/skorpion/32/275_2.png) [@Skorpion](https://community.homey.app/u/Skorpion)
#### Post date: [March 17, 2025, 8:38pm UTC](https://community.homey.app/t/help-calculating-end-time-based-on-minutes-left/132944/1 "2025-03-17T20:38:09Z")

</div>

Hi,

I’ve been breaking my head over this a couple of nights now, but I don’t know how to get this done so I hope someone can help me out.

Goal:  
My dryer and washing machine (using the Bosch Home Connect app) have a tag available with “minutes left” (string, format mm:ss) that indicates when the current program is finished. My goal is to calculate the end time of the program using the remaining time from the current time.

For example: The current time is 15:00, remaining time is 30:00. I want to calculate the end time, in this case 15:30.

I’ve been trying with Homeyscript, but if I’m correct, I can’t read tag/variable values in the script.

My guess is I need to use BLL for this, but I don’t know what to do.

Hoping someone can help me in the right direction!

---

<div class="post-metadata">

### Author: ![Marius\_Stensrod](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marius_stensrod/32/56540_2.png) [@Marius\_Stensrod](https://community.homey.app/u/Marius_Stensrod)
#### Post date: [March 18, 2025, 5:38pm UTC](https://community.homey.app/t/help-calculating-end-time-based-on-minutes-left/132944/3 "2025-03-18T17:38:31Z")

</div>

I would suggest to ignore the seconds part from your dryer/washer. Make a flow, that extract the first part of the variable like this:  
 ![bilde](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/0/f0f2e56b25dd9100753cb9785db72beb3bdd6a63.png)  
(You can use the standard logical card, just get the format right)  
Divide the result by 60.  
Extract time from now-time variabel, use the whole number value from your previous calculation, add that to the hour time you just extracted.  
from your calculation, you got a value after the desimal point, that is the minute part. 60\*result gives you minutes. Add that to now-time variabel. After calculation, run it in to a “all” block, then set the time hours and minutes.

You have to make “failsafe” function so you do not exceeed 24 hours and exceed 60 minutes.

---

<div class="post-metadata">

### Author: ![Rmb](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rmb/32/79135_2.png) [@Rmb](https://community.homey.app/u/Rmb)
#### Post date: [March 18, 2025, 7:22pm UTC](https://community.homey.app/t/help-calculating-end-time-based-on-minutes-left/132944/4 "2025-03-18T19:22:18Z")

</div>

> [@Marius\_Stensrod](#):
>
> You have to make “failsafe” function so you do not exceeed 24 hours and exceed 60 minutes

If you do your calculations in epoche date and time, that is not a problem. It is supported by BLL.

---

<div class="post-metadata">

### Author: ![Skorpion](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/skorpion/32/275_2.png) [@Skorpion](https://community.homey.app/u/Skorpion)
#### Post date: [March 18, 2025, 9:42pm UTC](https://community.homey.app/t/help-calculating-end-time-based-on-minutes-left/132944/5 "2025-03-18T21:42:31Z")

</div>

Thanks a lot! This works. 😃 I don’t have the failsafe yet though.

@Rmb, I’ll have to look into this. Does this mean that the hours and minutes I extracted in the example of @Marius_Stensrod I all have to convert to milliseconds to use the BLL flow card for epoch?

---

<div class="post-metadata">

### Author: ![Rmb](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rmb/32/79135_2.png) [@Rmb](https://community.homey.app/u/Rmb)
#### Post date: [March 18, 2025, 11:26pm UTC](https://community.homey.app/t/help-calculating-end-time-based-on-minutes-left/132944/6 "2025-03-18T23:26:27Z")

</div>

Yes, to set the endtime 1 hour and 30 minutes later after the current time, use BLL card “set variable to BLL expression “, using the expression  
`date('shorttime', Date.now() + (90*60000) )`  
Or  
`date('hh:mm', Date.now() + (90*60000) )`  
Which does the same format.

---

<div class="post-metadata">

### Author: ![Skorpion](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/skorpion/32/275_2.png) [@Skorpion](https://community.homey.app/u/Skorpion)
#### Post date: [March 19, 2025, 7:35pm UTC](https://community.homey.app/t/help-calculating-end-time-based-on-minutes-left/132944/7 "2025-03-19T19:35:51Z")

</div>

@Marius_Stensrod @Rmb Thanks to you both! This did the trick:

 ![Scherm­afbeelding 2025-03-19 om 20.34.29](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/e/7e01ab5a8fee9397ff5d17db6a20f8a62da00dfc.png)

---

<div class="post-metadata">

### Author: ![Marius\_Stensrod](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marius_stensrod/32/56540_2.png) [@Marius\_Stensrod](https://community.homey.app/u/Marius_Stensrod)
#### Post date: [March 19, 2025, 9:12pm UTC](https://community.homey.app/t/help-calculating-end-time-based-on-minutes-left/132944/9 "2025-03-19T21:12:17Z")

</div>

Am I missing something? I do not see that this is Epoch(Unix) time.  
And you can remove the number 24 after HH, it should be HH:mm to get the time now with 24hour timestamp.

For Unix time, you can just write “now” in the BLL card, without the quotes. If I understand correctly when it is talking about Epoch time.

---

<div class="post-metadata">

### Author: ![Rmb](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rmb/32/79135_2.png) [@Rmb](https://community.homey.app/u/Rmb)
#### Post date: [March 19, 2025, 10:57pm UTC](https://community.homey.app/t/help-calculating-end-time-based-on-minutes-left/132944/10 "2025-03-19T22:57:34Z")

</div>

See [[APP][Pro] Better Logic Library - For Users - #185 by Arie\_J\_Godschalk](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/185)

---

<div class="post-metadata">

### Author: ![Skorpion](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/skorpion/32/275_2.png) [@Skorpion](https://community.homey.app/u/Skorpion)
#### Post date: [March 20, 2025, 6:42am UTC](https://community.homey.app/t/help-calculating-end-time-based-on-minutes-left/132944/11 "2025-03-20T06:42:54Z")

</div>

The usage of hh returned a 12h time for me, hence the usage of HH24. Could be that HH returns the same result as HH24. Will check tonight.

---

<div class="post-metadata">

### Author: ![Rmb](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rmb/32/79135_2.png) [@Rmb](https://community.homey.app/u/Rmb)
#### Post date: [March 20, 2025, 8:19am UTC](https://community.homey.app/t/help-calculating-end-time-based-on-minutes-left/132944/12 "2025-03-20T08:19:42Z")

</div>

When you open de BLL app settings you get all the available formats.

---

<div class="post-metadata">

### Author: ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)
#### Post date: [May 1, 2025, 8:17am UTC](https://community.homey.app/t/help-calculating-end-time-based-on-minutes-left/132944/13 "2025-05-01T08:17:12Z")

</div>

Actually, HH and HH24 are not the same.

30 minutes past midnight with HH will show 00:30, while with HH24 will show 24u30 (some countries write time like that).
