# \[APP\]\[Pro\] Better Logic Library - For Users

**URL:** <https://community.homey.app/t/app-pro-better-logic-library-for-users/71876>\
**Category:** Apps\
**Tags:** app, tools, homey-pro, logic, bll\
**Created:** [November 7, 2022, 10:13pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876 "2022-11-07T22:13:40Z")\
**Posts on this page:** 20\
**Page:** 4

<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:** [June 28, 2023, 12:28pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/62 "2023-06-28T12:28:27Z")

</div>

> [@Pat\_M](#):
>
> Is there any way to retrieve the Last set" value for a variable in Better Logic?

Yes, there is a new flowcard to retrieve properties for Variables, currently only yhe last-set property.

---

<div class="post-metadata">

**Author:** ![Pat\_M](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pat_m/32/56295_2.png) [@Pat\_M](https://community.homey.app/u/Pat_M)\
**Post date:** [June 30, 2023, 6:11pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/63 "2023-06-30T18:11:34Z")

</div>

This is **SO** useful, thank you!!!  
Can you please point me in the right direction, I’m trying to calculate the diff (in minutes) for some BL variables that I have. Like temperatures etc. This is why I really wanted the Last Set value.  
I’m struggling to calculate (in a easy way) this diff like `Set Minutes ($timenow$-Temp_Garage)` where garage is `Get properties of Temp_Garage`-\>Last changed (datetime).

Can you please help me? 🙂

Many thanks!

---

<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:** [June 30, 2023, 6:51pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/64 "2023-06-30T18:51:00Z")

</div>

> [@Pat\_M](#):
>
> I’m struggling to calculate (in a easy way) this diff like `Set Minutes ($timenow$-Temp_Garage)` where garage is `Get properties of Temp_Garage`-\>Last changed (datetime).

Yes:  
First off, install the latest version of BLL, because the card you need had a bug in it:

> **[Better Logic Library](https://homey.app/en-us/app/net.i-dev.betterlogic/Better-Logic-Library/)**
>
> Just some better logic, variable and library management

Then you need this:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/3/03136baf19b9279a50880536c0abbf81e9871d58.png)

- Left you retrieve the properties of a variable, in this case the variable is called asd
- In the middle card, you calculate the time difference between `now` and the `last changed`. This will result in the time difference in milliseconds.
- The last card (which had a bug in it) you can use to convert that millisecond result into a format you want, minutes in this case, so just write a `M` and select that one from the dropdown list.

\_

- Ofc, if you need the minutes as a real number, not as a text, you could do it like this:  
`Math.round((now - [last-changed-tag] ) / 1000 / 60)`

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/d/4d9a7a48834aaa2b0ce0aed49ca257784bfcd0a4.png)

---

<div class="post-metadata">

**Author:** ![Pat\_M](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pat_m/32/56295_2.png) [@Pat\_M](https://community.homey.app/u/Pat_M)\
**Post date:** [July 1, 2023, 9:54am UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/65 "2023-07-01T09:54:50Z")

</div>

@Arie_J_Godschalk With your help it works now. Finally I can check if values are stale or not and decide if they are allowed for calculations like averages etc. I’m **so** thankful for all your help, you should get a monthly salary from Athom for your fantastic contributions, both in apps and knowledge transfer.

**Hartelijk dank and have a fantastic summer!** 🤩 👏 🏆

---

<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:** [July 1, 2023, 10:11am UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/66 "2023-07-01T10:11:03Z")

</div>

@Pat_M  
Well, feel free to become a Patreon 😉

> **[QlusterIT | maken Homey Apps | Patreon](https://www.patreon.com/QlusterIT/membership)**

---

<div class="post-metadata">

**Author:** ![Pat\_M](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pat_m/32/56295_2.png) [@Pat\_M](https://community.homey.app/u/Pat_M)\
**Post date:** [July 1, 2023, 12:37pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/67 "2023-07-01T12:37:08Z")

</div>

PayPal’ed! 🙂 🍺

---

<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:** [July 1, 2023, 1:11pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/68 "2023-07-01T13:11:19Z")

</div>

@Pat_M

Thank you very much m8!

---

<div class="post-metadata">

**Author:** ![Shiki](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@Shiki](https://community.homey.app/u/Shiki)\
**Post date:** [July 3, 2023, 12:42pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/69 "2023-07-03T12:42:35Z")

</div>

@Arie_J_Godschalk using your app Better logic Library, is it possible to:

1/ to extract time from text json output “2023-07-03T16:15:12+01:00”, example I need the only HH:mm ?

2/ time difference in minutes such as FutureDateTime(YYYY-mm-ddTHH:mm:ss(timezone) minus CurrentDateTime(YYYY-mm-ddTHH:mm:ss(timezone) ?

Please advise how ? 🤔

---

<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:** [July 3, 2023, 1:09pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/70 "2023-07-03T13:09:53Z")

</div>

> [@Shiki](#):
>
> 1/ to extract time from text json output “2023-07-03T16:15:12+01:00”, example I need the only HH:mm ?

Yes, i’ll use the flowcard Format dat for it, but it can be used in any BLL expression or coding through the `date()` method:  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/d/3df87f0d81917a04e3feec3a1a7fab14a07fce43.png)

> [@Shiki](#):
>
> 2/ time difference in minutes such as FutureDateTime(YYYY-mm-ddTHH:mm:ss(timezone) minus CurrentDateTime(YYYY-mm-ddTHH:mm:ss(timezone) ?

Yes:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/1/d1513c47b3b774ca9e8548093daafbb5c0d5e53a.png)

If you need it as a number, just wrap parseInt around it:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/1/2105380e4dd6609e6a907ada2ae1145b9d29e094.png)

`parseInt(time('M', new Date('2023-07-03T16:15:12+01:00') - now))`

The `now` can be replace with for instance `new Date('2023-07-03T15:15:12+00:00')`

---

<div class="post-metadata">

**Author:** ![Shiki](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@Shiki](https://community.homey.app/u/Shiki)\
**Post date:** [July 3, 2023, 2:26pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/71 "2023-07-03T14:26:26Z")

</div>

> [@Arie\_J\_Godschalk](#):
>
> parseInt(time(‘M’, new Date(‘2023-07-03T16:15:12+01:00’) - now))

Wow!👍 Excellent guide! all the scenario works great! especially ‘Execute time’ and ‘Execute parseInt’ demonstrated the return of text and integer.

---

<div class="post-metadata">

**Author:** ![damo78](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/damo78/32/4574_2.png) [@damo78](https://community.homey.app/u/damo78)\
**Post date:** [August 14, 2023, 9:54pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/72 "2023-08-14T21:54:35Z")

</div>

I’ve tried importing an array of JSON objects for my variables, which a few days ago was working okay and they would save. I’ve tried today to import a new set with an additional few and they do not save. There is no dedicated save all button; however, if I click each imported variable and select edit then save, then they do save.

Diagnostic key: 6e442055-3184-4134-810b-5c1f7ba72bf2

Not sure where to go next with this. I may try uninstalling and starting again. Currently on v3.4.5

Edit: I’ve found a way to trick it to work. Once I import all the variables, I then add an additional dummy variable and it saves all of the others. This is not ideal, but in the absence of a fix, this will work for now.

Edit2: Scrap that. The work around no longer works. This is so random. Looks like I’ll need to go back to the basic Logic variables until this is sorted out.

---

<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:** [August 15, 2023, 4:15pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/73 "2023-08-15T16:15:35Z")

</div>

Please create a support ticket and add the json file so i can test and fix it?

---

<div class="post-metadata">

**Author:** ![damo78](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/damo78/32/4574_2.png) [@damo78](https://community.homey.app/u/damo78)\
**Post date:** [August 15, 2023, 8:37pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/74 "2023-08-15T20:37:10Z")

</div>

> [@damo78](#):
>
> Diagnostic key: 6e442055-3184-4134-810b-5c1f7ba72bf2

Done, thank you!

---

<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:** [August 16, 2023, 5:40am UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/75 "2023-08-16T05:40:25Z")

</div>

Fyi: this is my last week holidays, i’ll run support next week.

---

<div class="post-metadata">

**Author:** ![SM24](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sm24/32/78863_2.png) [@SM24](https://community.homey.app/u/SM24)\
**Post date:** [August 21, 2023, 11:47am UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/76 "2023-08-21T11:47:06Z")

</div>

thank you for all the information here. maybe you can help me too?

I have installed the “Better Logic Library” app and would like to output the current time (timeshort) in a push notification plus, for example, 90 minutes. see my post about it here:

[Calculate time variable (Homey Community)](https://community.homey.app/t/calculate-time-variable/87604/2)

what code could you use to do that? how should the variables be set?

thank you very much for the information about it

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [August 21, 2023, 12:21pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/77 "2023-08-21T12:21:13Z")

</div>

Hi Sebastian,

I don’t get this follow up question (in this thread), while I showed a ready-to-go, importable flow solution.  
I’m curious, did you even care to follow the link?

 ![Screenshot_20230821-141827_Chrome](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/2/62c4b6c1e9baa286436d081bd4f0496da82c6df1.jpeg)

[https://community.homey.app/t/calculate-time-variable/87604/2](https://community.homey.app/t/calculate-time-variable/87604/2)

> [@\[APP\]\[Pro\] Better Logic Library - For Users](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/23):
>
> I’m trying to figure out if I can use BLL in advanced flows to calculate what time I should start a task, where I know how many minutes it takes to complete the task and when it should be ready. Say I want a to start a task $tasktime minutes before 18:00. Somehow can’t get my head over how to do this. The result should be something I can use to compare to for a trigger. For example every five minutes I can run a logic test see if it is now within $tasktime minutes before 18:00 and start the t…

---

<div class="post-metadata">

**Author:** ![SM24](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sm24/32/78863_2.png) [@SM24](https://community.homey.app/u/SM24)\
**Post date:** [August 21, 2023, 12:57pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/78 "2023-08-21T12:57:35Z")

</div>

thank you for the info  
Of course I looked at the link but I don’t really get along with it. there are many functions in it that i don’t need at all. is it possible to shorten this significantly? attach my question simply to add minutes to the current time stamp and output that in a notification? thank you very much

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [August 21, 2023, 1:16pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/79 "2023-08-21T13:16:20Z")

</div>

> [@SM24](#):
>
> Of course I looked at the link but I don’t really get along with it.

I cannot know that 😊  
Okay, here’s a flow which can calculate with times, maybe this gets you going

> [@The Flow Exchange(r) - Exchange Your Flows with Others!](https://community.homey.app/t/the-flow-exchange-r-exchange-your-flows-with-others/68981/72):
>
> Time Calculator With the re-invented Better Logic Library app, we can calculate with time a bit easier without Homeyscript. Apps used: [Better Logic Library](https://homey.app/a/net.i-dev.betterlogic)Other things people need to do to get it working correct? Any questions can be asked in this topic: [https://community.homey.app/t/app-pro-better-logic-library-for-users/71876](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876) TEF: [tef:FLOWS:"H4sIAAAAAAACA7VayXIbyRH9FUbHHGYiVHLtC472ZQ7jk3wjGYxasiiEsd…

---

<div class="post-metadata">

**Author:** ![SM24](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sm24/32/78863_2.png) [@SM24](https://community.homey.app/u/SM24)\
**Post date:** [August 21, 2023, 3:35pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/80 "2023-08-21T15:35:51Z")

</div>

Thank you for your support, but unfortunately that doesn’t really help me. how can I easily add 90 minutes to the current timestamp of better logic “timeshort”? what variables do I need for this etc.? in your example only the values are set but not added. can you make me a very short advanced flow? do you have experience there?

@DirkG - Or maybe you know your way around here and could help us here? are you using the app yourself? thank you very much

---

<div class="post-metadata">

**Author:** ![JonE](https://avatars.discourse-cdn.com/v4/letter/j/f9ae1b/32.png) [@JonE](https://community.homey.app/u/JonE)\
**Post date:** [August 21, 2023, 6:39pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/81 "2023-08-21T18:39:51Z")

</div>

Hi everyone and @Arie_J_Godschalk  
Please help!  
Was really happy over the last few years with Better logic. Since recently (?) it must have changed into Better Logic Library and the interface has also changed?  
Alle of a sudden all my variables etc are gone when I go to more, settings, better logic library. So a lot of flows depending on these aren’t working now anymore…  
Did I miss something? And more importantly, can I get my variables etc back, perhaps only for a brief time so I can migrate appropriately?

[Previous page](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876.md?page=3)

[Next page](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876.md?page=5)
