# \[APP\]\[Pro\] Better Logic Library - Just some better logic, variable and library management

**URL:** <https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568>\
**Category:** Apps\
**Tags:** app, tools, homey-pro, bll\
**Created:** [December 16, 2018, 10:29pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568 "2018-12-16T22:29:57Z")\
**Posts on this page:** 20\
**Page:** 5

<div class="post-metadata">

**Author:** ![vaderag](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/vaderag/32/150_2.png) [@vaderag](https://community.homey.app/u/vaderag)\
**Post date:** [June 15, 2020, 4:10pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/85 "2020-06-15T16:10:59Z")

</div>

So I’m trying to use Math.js for the first time with this app and I’m clearly making a mistake…

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

Initially tried without any ’ or ( or the ‘evaluate’ before realising that I probably needed them. Checked syntax on the math.js website but now I’m stuck

How do I do what I want to do - subtract one humidity value from another and if it’s greated than 8 then do something?

Thanks!

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [June 15, 2020, 6:31pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/86 "2020-06-15T18:31:34Z")

</div>

I would think that Better Logic internally already uses `evaluate`, so just `Humidity - Humidity > 8` might work. Spurious whitespace around tags may be an issue, at least with the regular Logic it is known to cause problems.

---

<div class="post-metadata">

**Author:** ![vaderag](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/vaderag/32/150_2.png) [@vaderag](https://community.homey.app/u/vaderag)\
**Post date:** [June 15, 2020, 6:33pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/87 "2020-06-15T18:33:46Z")

</div>

I tried without evaluate to start with and didn’t seem to work sadly ☹

---

<div class="post-metadata">

**Author:** ![vaderag](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/vaderag/32/150_2.png) [@vaderag](https://community.homey.app/u/vaderag)\
**Post date:** [June 16, 2020, 9:38am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/88 "2020-06-16T09:38:05Z")

</div>

Is it possible to do with Standard logic then? (your comment seems to imply so!)  
I tried with a standard logic variable but equally getting an error… ☹

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/5/25ee607f55b0a0e197fdaaab2a6fa3d0ce282c6e.jpeg)

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [June 16, 2020, 10:21am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/89 "2020-06-16T10:21:04Z")

</div>

What error? Theoretically, it should work:

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

However, it has taken me about 15 minutes to create this flow, because I kept getting all kinds of random errors (one that kept causing saving the flow to fail even when I removed _all_ flow cards from the flow, so I had to create a completely new flow to get out of that loop).

For some reason, it works for _some_ numerical tags (like “Luchtvochtigheid (%)” in my example) but not on others (those give a “non-numerical value” error, even though the tags _are_ numerical).

---

<div class="post-metadata">

**Author:** ![vaderag](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/vaderag/32/150_2.png) [@vaderag](https://community.homey.app/u/vaderag)\
**Post date:** [June 16, 2020, 10:29am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/90 "2020-06-16T10:29:04Z")

</div>

I haven’t managed to view the error, all I seem to get is a red exclamation point in the top left. How do I see what the error actually is?

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [June 16, 2020, 10:41am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/91 "2020-06-16T10:41:02Z")

</div>

Doesn’t a red exclamation point mean that the comparison was false? I.e. that `Humidity - Humidity` wasn’t more than 8.

---

<div class="post-metadata">

**Author:** ![vaderag](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/vaderag/32/150_2.png) [@vaderag](https://community.homey.app/u/vaderag)\
**Post date:** [June 16, 2020, 10:44am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/92 "2020-06-16T10:44:38Z")

</div>

Don’t think so, because I have an action on both outcomes and neither was working  
Also tried reversing to less than

---

<div class="post-metadata">

**Author:** ![Rocodamelshekima](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rocodamelshekima/32/8209_2.png) [@Rocodamelshekima](https://community.homey.app/u/Rocodamelshekima)\
**Post date:** [June 16, 2020, 11:02am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/93 "2020-06-16T11:02:02Z")

</div>

Like Robert mentioned before: be aware of white spaces!!

---

<div class="post-metadata">

**Author:** ![vaderag](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/vaderag/32/150_2.png) [@vaderag](https://community.homey.app/u/vaderag)\
**Post date:** [June 16, 2020, 11:13am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/94 "2020-06-16T11:13:55Z")

</div>

Yeah - made it work with standard logic. Damn white spaces!

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [June 16, 2020, 11:15am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/95 "2020-06-16T11:15:10Z")

</div>

If you feel like it, send Athom a support request about this. Although this has been an issue for so long now that I don’t think they care.

---

<div class="post-metadata">

**Author:** ![schmucke](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/schmucke/32/79913_2.png) [@schmucke](https://community.homey.app/u/schmucke)\
**Post date:** [July 8, 2020, 10:37am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/96 "2020-07-08T10:37:32Z")

</div>

Hello @robertklep

i try to set a betterlogic VAR into a other betterlogic VAR: but i just become the following Error:  
 ![flow error](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/f/8f630b83fc5fe105ec9131b10d29116fcd5252a8.png)

What i try is:  
 ![xi](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/e/5e9b5eb89dc1d4945dfa6ea7b7af05bb5cd159ca.jpeg)

I dont know what is going wrong?!

Edit:  
i fixed it by “Set a variable” without the number Flag.

---

<div class="post-metadata">

**Author:** ![Tino](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tino/32/10934_2.png) [@Tino](https://community.homey.app/u/Tino)\
**Post date:** [August 4, 2020, 2:14pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/97 "2020-08-04T14:14:46Z")

</div>

Hi all!

Is it possible to rounding up a number variable? And how can i do this within a flow?  
The problem ist, that i try to send a room temperature to a wallthermostat. But it is only possible with round numbers like 21.5° or 22°, but unpossible with numbers like 21.4° oder 22.1°

---

<div class="post-metadata">

**Author:** ![Caseda](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/caseda/32/138695_2.png) [@Caseda](https://community.homey.app/u/Caseda)\
**Post date:** [August 4, 2020, 10:37pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/98 "2020-08-04T22:37:58Z")

</div>

you can round to the nearest 0,5 decimal with this calculation: `round(value * 2)/2`

Then you could put it in 1 flow by calculating, then with delay send it to the thermostat, though it does need a few seconds of delay, if you want a faster responds time you could create a second flow that triggers on the change of that variable you are changing for the calculation.

---

<div class="post-metadata">

**Author:** ![anon61197305](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@anon61197305](https://community.homey.app/u/anon61197305)\
**Post date:** [August 20, 2020, 9:32am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/99 "2020-08-20T09:32:07Z")

</div>

I am using this app because of the basic-status it has when I installed some apps when I just bought my Homey. I notice now that I almost never use it, I just use the normal Logic flow cards. The advantage of that is that I can quickly check the statussen in the app under “logic”.

What is (or better: when is) this app better or more suitable than the default logic options?

---

<div class="post-metadata">

**Author:** ![Edwin\_D](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/edwin_d/32/136417_2.png) [@Edwin\_D](https://community.homey.app/u/Edwin_D)\
**Post date:** [September 16, 2020, 6:08pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/100 "2020-09-16T18:08:06Z")

</div>

In order to be able to calculate with time, I sometimes use Chronograph transitions to increase variables, e.g. one step per minute to show length in minutes later on.

---

<div class="post-metadata">

**Author:** ![Edwin\_D](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/edwin_d/32/136417_2.png) [@Edwin\_D](https://community.homey.app/u/Edwin_D)\
**Post date:** [September 16, 2020, 6:12pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/101 "2020-09-16T18:12:37Z")

</div>

I have a lot of numerical variables that have absolutely no use in insights. Wouldn’t it be usefull to be able to indicate whether insights are saved in order to save time and storage?

---

<div class="post-metadata">

**Author:** ![Eddy\_Poot](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eddy_poot/32/9878_2.png) [@Eddy\_Poot](https://community.homey.app/u/Eddy_Poot)\
**Post date:** [September 17, 2020, 6:53am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/102 "2020-09-17T06:53:02Z")

</div>

At that time I owned a Homey (Early 2016) with at least 24 apps. So installing an additional app did not seam like a good idea at the time. I now have a Homey Pro (Early 2019) which can handle a lot more apps. So for sure I will try the chronograph transitions app soon.

---

<div class="post-metadata">

**Author:** ![wvduffelen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/wvduffelen/32/34133_2.png) [@wvduffelen](https://community.homey.app/u/wvduffelen)\
**Post date:** [January 17, 2021, 8:16pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/103 "2021-01-17T20:16:02Z")

</div>

I want to add a numeric value with 4 digits behind the comma but I can only add 2… is this a known issue or a setting or something? I have version 1.0.5 and homey 5rc53

---

<div class="post-metadata">

**Author:** ![Edwin\_D](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/edwin_d/32/136417_2.png) [@Edwin\_D](https://community.homey.app/u/Edwin_D)\
**Post date:** [January 17, 2021, 9:19pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/104 "2021-01-17T21:19:30Z")

</div>

don’t know, but you could try using a calculation to divide a variable by 100 or 10000 and see if the accuracy is right for you. But what could you possibly have that needs this kind of accuracy?

[Previous page](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568.md?page=4)

[Next page](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568.md?page=6)
