# \[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:** 5

<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 21, 2023, 7:54pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/82 "2023-08-21T19:54:18Z")

</div>

Restary the app? All variables schould still exist.  
Nothing in the datamodel has changed.

Are the variables gone in the app settings or are you only missing the tokens in flows?

---

<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, 8:00pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/83 "2023-08-21T20:00:05Z")

</div>

Yes that brought them back! Thx!!  
Let’s see if the flows will be working again as well now.

---

<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 22, 2023, 7:32am UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/84 "2023-08-22T07:32:50Z")

</div>

> [@SM24](#):
>
> 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?

Use the BLL Expression card and it will give a token:  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/4/f4590696b71d894647a48b3d638d791c34435b32.png)

```auto
date('shorttime', now+(90*60000) )

```

If you need it in a variable, use the Set Variable to BLL Expression flowcard.

---

<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 22, 2023, 11:05am UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/85 "2023-08-22T11:05:52Z")

</div>

> [@Arie\_J\_Godschalk](#):
>
> `date('shorttime', now+(90*60000) )`

perfect - that’s exactly what I was looking for. short the “command” for the calculation. a very big thank you 🙂

---

<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 24, 2023, 12:31pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/86 "2023-08-24T12:31:52Z")

</div>

hi @Arie_J_Godschalk another question. Recently when testing / running flows that do something with BLL, it always return this message “Flow Card not registered (type: action, id: increment\_number\_variable)”. See screenshot as well. Could you perhaps tell me what is going wrong here?  
These flows used to work perfectly for a very long time.

 ![Scherm­afbeelding 2023-08-24 om 14.29.23](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/a/8/a850eba587abe6dc146141f368b223fdf3be39a9.png)

---

<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 24, 2023, 12:49pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/87 "2023-08-24T12:49:08Z")

</div>

> [@JonE](#):
>
> hi @Arie_J_Godschalk another question. Recently when testing / running flows that do something with BLL, it always return this message “Flow Card not registered (type: action, id: increment\_number\_variable)”. See screenshot as well. Could you perhaps tell me what is going wrong here?  
> These flows used to work perfectly for a very long time.

Is this with only this flowcard or all flowcards?

---

<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 24, 2023, 12:51pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/88 "2023-08-24T12:51:48Z")

</div>

All flowcards that do something with BLL.

---

<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 24, 2023, 1:50pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/89 "2023-08-24T13:50:54Z")

</div>

Did you try a restart of the app?

---

<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 24, 2023, 2:33pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/90 "2023-08-24T14:33:03Z")

</div>

Did that, which helped. But 1-2 days later, the same happens again.

---

<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 29, 2023, 8:45pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/91 "2023-08-29T20:45:52Z")

</div>

Send me a diagnostic when ot happends again please?

---

<div class="post-metadata">

**Author:** ![erlend\_oyen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/erlend_oyen/32/18133_2.png) [@erlend\_oyen](https://community.homey.app/u/erlend_oyen)\
**Post date:** [September 14, 2023, 9:01am UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/93 "2023-09-14T09:01:21Z")

</div>

this app has become somewhat unreliable over the last 1-2 months.  
all flows using the app stops working, and when you try to access settings it either loading forever, stopes loading with an error.

need to restart the app before it’s working again

sometimes the issue also occurs after homey planed restart.

it’s very nice app to have and use, but after the last major version stability is not god.

---

<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:** [September 14, 2023, 9:20am UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/94 "2023-09-14T09:20:38Z")

</div>

> [@erlend\_oyen](#):
>
> all flows using the app stops working, and when you try to access settings it either loading forever, stopes loading with an error.

When this happends, can you send me a diag before restarting the app?  
Thanks!

EDIT: I am assuming the Diagnostic was from you; did you send that after your restarted the app or before?  
Because that log shows me the app started correctly.

---

<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:** [September 15, 2023, 11:46am UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/95 "2023-09-15T11:46:51Z")

</div>

Hi @Arie_J_Godschalk it happened again. Here’s the diagnostic report id 3efc9cb9-539a-420d-9a7b-16a1b774dcb7  
This report was created after rebooting the app. Before the reboot all variables in Better Logic were gone, making the corresponding flow to become erroneous. See attached screenshots.  
Do you know what causes this?

 ![1000019747](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/d/1d27a495ff31e9cc9f73bd511438e6f09993c941.png)  
 ![1000019746](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/c/3cb8a4650aee4d2faecb7bdda39aba8eb13b3be6.png)

---

<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:** [September 15, 2023, 12:32pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/96 "2023-09-15T12:32:20Z")

</div>

It seems it doesn’t load correctly.

Variables are recreated based on flows, they are never really lost, the are just not loaded, just like the flowcard-handlers.

Thanks for the diagnostic, it indeed is showing errors!  
This gives me something to work with!

An App restart should fix it for now, or even reinstall (vairables that are used in flows are recreated).  
I’ll have a look (beginning of) next week!  
It’ll be the first think on my list!

---

<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:** [September 15, 2023, 12:45pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/97 "2023-09-15T12:45:05Z")

</div>

Thanks @Arie_J_Godschalk that sounds awesome!  
This particular flow activates my house’s sun screens and we (and our plants 🪴 in particular) we’d be very happy if the screens keep out the strong sun again. Right now they’re 🔥 away! 🙂  
So: looking forward to your fix! 👍

---

<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:** [September 15, 2023, 12:58pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/98 "2023-09-15T12:58:13Z")

</div>

Does it gets temporarily fixed by an app restart?

---

<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:** [September 15, 2023, 1:24pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/99 "2023-09-15T13:24:10Z")

</div>

Correct. It fixes it for a few days or so (i don’t always notice immediately when BLL crashes) and then I have to restart it.

---

<div class="post-metadata">

**Author:** ![Rrrr](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rrrr/32/629_2.png) [@Rrrr](https://community.homey.app/u/Rrrr)\
**Post date:** [October 3, 2023, 12:57pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/100 "2023-10-03T12:57:57Z")

</div>

**BLL expressions within any text (variable)**

I am having more and more fun with BLL.  
The below was not obvious to me so I share here the power of the BLL card “Set variable to text”.

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

This means you can add one or more texts and BLL expressions into any text variable, pass the variable to a central flow where you process it with a single BLL card.

This saves (me) several formatting cards in various flows.

---

<div class="post-metadata">

**Author:** ![Rrrr](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rrrr/32/629_2.png) [@Rrrr](https://community.homey.app/u/Rrrr)\
**Post date:** [October 3, 2023, 2:16pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/101 "2023-10-03T14:16:15Z")

</div>

@Arie_J_Godschalk

1. Can you improve the result for 0 and negative input to the time() function?  
Currently the expression is not parsed and leaves the formula.  
Example with 0 or -120 as input:  
Remaining time {[time(“hh:mm:ss”,1000 \* 0)]} =\> Result: Remaining time {[time(“hh:mm:ss”,1000\*0)]}  
Remaining time {[time(“hh:mm:ss”,1000 \* -120)]} =\> Result: Remaining time -1:-2:-120

2. Time() timeSec input as seconds does not seem to work unless 0 ms is used as an input for timeMs:

- time(format, timeMs?, timeSec?)  
Examples:  
timeSec input:  
60 seconds is {[time(“hh:mm:ss”,0,60)]} =\> Result 00:01:00  
60 seconds is: {[time(“hh:mm:ss”, ,60)]} =\> Result {[time(“hh:mm:ss”,60)]}  
timeMs input:  
60 seconds is {[time(“hh:mm:ss”,1000\*60)]} =\> Result 00:01:00

---

<div class="post-metadata">

**Author:** ![Rrrr](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rrrr/32/629_2.png) [@Rrrr](https://community.homey.app/u/Rrrr)\
**Post date:** [October 4, 2023, 1:33pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/102 "2023-10-04T13:33:39Z")

</div>

@Arie_J_Godschalk

Currently Telegram does not pas STAR \* or UNDERSCORE \_ or BRACKET [.  
To pass all characters I would like to know how I can best do a text replace in a string or text variable.

1. Replace all STAR \* with \*
2. Replace all UNDERSCORE \_ with \_
3. Replace all BRACKET [ with \[

**Example Telegram notification**  
Error: \_app\_not\_valid; The multiplication of 1000 \* number does not work, try again. The temperature is now 11,2 °C. {flow #APP\_Test} [end of message]

Option BLL Expression  
I could not find it.

Option BLL Library  
I refer to the solution proposed by @Patric_Hedin in this [thread](https://community.homey.app/t/app-pro-homesh-controller-homesh-satellite-connect-homey-pro-2023-to-homey-pro-for-led-speaker-zwave-satellite-and-network-resource/70369/263).  
It does not apply to my Telegram requirement, but maybe it shows the way.

Option HomeyScript  
I am not sure this is the right way. Will HS allow me to pass any length of string with many different characters, edit it and then output it? Maintaining a HomeyScript for this seems tedious.

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

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