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

<div class="post-metadata">

**Author:** ![Herve69](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/herve69/32/37183_2.png) [@Herve69](https://community.homey.app/u/Herve69)\
**Post date:** [June 25, 2021, 10:34am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/146 "2021-06-25T10:34:17Z")

</div>

Oh thanks Peter, I understand now ! I did not know that I had to define some BL variables first, si I could not add such a NaamVenDag variable 🥺

I have 2 more questions for you, Peter :

1. For this BL card, Is it possible to use Homey’s variables instead of BL variables ? I guess not but maybe there’s a solution for this …
2. I’m trying tu use the Maths.js card but I do not undertsand how to write this. It seems my formula is wrong (the Description variables are from different apps even if they have the same names) :  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/6/2632378328c36b353d5a4943b3aa17e9a88a56c2.png)

ICOuld you still help me, please ?

Thanks a lot !

---

<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:** [June 25, 2021, 11:35am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/147 "2021-06-25T11:35:35Z")

</div>

FYI, when using a BL “one of these variables has changed” card, you’ll have to type in the variable names, seperated by a comma. But only variables you created in BL can be used, not the variables provided by an app. Then Homey’s Logics is needed.  
See

> [@DirkG](#):
>
> I used the tags in the card „One of these variables changed“ instead of typing in the name of the variables.

Okay, about the goal you want to reach. I’m guessing you try to catch a changed weather description here?  
I use Openweathermap, and trigger the flow with “The weather has changed”.  
Then, at the AND section, I add a Homey Logic card of the type “text contains”.  
Now select the local variable “weather description” (=weersbeschrijving in Dutch), which is provided by the trigger card. In the web app it can be found under “This Flow” in the selection box.

 ![weatherdescriptionChanged](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/b/3bdb462e312f4c1c4a200f737af756bade002019.png)  
Now enter f.i. “clear sky” as text.  
You can add 2 more logics cards, with a different weather description of your choice. Make sure to drag the cards down, so “OR” appears between them.

In my example, the notification gets sent when the weather type is “clear sky” or “few clouds” or “whatever weather”.

 ![weatherconditions](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/5/55b30163fb3c62d442907206e0b7211bb550efac.png)

As you can see in the Timeline notification card, Homey provides for a weather description too (“Beschrijving”), but I can’t find a way to monitor it for changes.

The BL math.js card can be used to calculate with numeric variables  
The equivalent Homey logics card is called “calculate a value”  
Examples:

> [@Available math functions](https://community.homey.app/t/available-math-functions/16622):
>
> Are there built-in math functions that can be used in variable calculations (in basic logic flows, not Homeyscript)? If so, where can I find the docs?

> [@List of available Math.js functions](https://community.homey.app/t/list-of-available-math-js-functions/18665):
>
> Is there a list of math functions that do work? Not all functions listed on [https://mathjs.org/docs/reference/functions.html](https://mathjs.org/docs/reference/functions.html) work. Functions like “{{mean(2, 1, 4, 3)}}” and “{{round(5.345,2)}}” work flawlessly, but but XOR (like {{ xor(8, 2) }}), OR and AND do not seem to work. Or am I missing something? I’m looking for a way to do some bitwise operations in flows. Any help is greatly apprecieated.

---

<div class="post-metadata">

**Author:** ![Herve69](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/herve69/32/37183_2.png) [@Herve69](https://community.homey.app/u/Herve69)\
**Post date:** [June 25, 2021, 12:52pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/148 "2021-06-25T12:52:57Z")

</div>

Oky, thanks Peter !

---

<div class="post-metadata">

**Author:** ![Dennis\_van\_Dinter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dennis_van_dinter/32/28180_2.png) [@Dennis\_van\_Dinter](https://community.homey.app/u/Dennis_van_Dinter)\
**Post date:** [July 25, 2021, 10:37am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/149 "2021-07-25T10:37:12Z")

</div>

Hi,

How can I use the function “concat”?

For example, I would like to combine two numbers like 5 and 6. Not adding them up to 11, but using the function consat, so I get 56.

Or if I want to combine 5 and 6, but with a word in-between. For example: 5house6?

---

<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:** [July 25, 2021, 4:01pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/150 "2021-07-25T16:01:37Z")

</div>

[https://mathjs.org/docs/reference/functions/concat.html](https://mathjs.org/docs/reference/functions/concat.html)

---

<div class="post-metadata">

**Author:** ![Dennis\_van\_Dinter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dennis_van_dinter/32/28180_2.png) [@Dennis\_van\_Dinter](https://community.homey.app/u/Dennis_van_Dinter)\
**Post date:** [July 25, 2021, 4:53pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/151 "2021-07-25T16:53:02Z")

</div>

Hi Peter,

Yes, I read that piece, but I can’t figure out how to use it.

I got a little further. Using the Mathjs card I use:

concat(“5”,“6”)

And it gets written to a number BL variable. I can see it on the config-page, but when I want to send the value in a push notification, it returns a 0

Maybe something to do with the format of the value? Text or number?

[https://homey.app/f/xN\_AuH](https://homey.app/f/xN_AuH)

---

<div class="post-metadata">

**Author:** ![Dijker](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@Dijker](https://community.homey.app/u/Dijker)\
**Post date:** [July 25, 2021, 5:20pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/152 "2021-07-25T17:20:12Z")

</div>

Try

number(concat(“5”,“6”))

---

<div class="post-metadata">

**Author:** ![Dennis\_van\_Dinter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dennis_van_dinter/32/28180_2.png) [@Dennis\_van\_Dinter](https://community.homey.app/u/Dennis_van_Dinter)\
**Post date:** [July 25, 2021, 5:32pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/153 "2021-07-25T17:32:52Z")

</div>

@Dijker

Yes, that works indeed! Thank you!

Is there a way to combine this with text, for example 5to6? And write the whole string to a BL text var.? And then you use the var. In, let’s say, a push notification?

---

<div class="post-metadata">

**Author:** ![Heronimus](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/heronimus/32/3564_2.png) [@Heronimus](https://community.homey.app/u/Heronimus)\
**Post date:** [September 8, 2021, 12:55pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/154 "2021-09-08T12:55:25Z")

</div>

@Uranday Patrick, I’ve donated most of the apps i use. But i’ve forgotten one of the basic ‘Need to haves’ . Do you have paypal so i buy you a beer 😉 ?

---

<div class="post-metadata">

**Author:** ![Daniel\_S](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/daniel_s/32/24881_2.png) [@Daniel\_S](https://community.homey.app/u/Daniel_S)\
**Post date:** [October 21, 2021, 12:15pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/155 "2021-10-21T12:15:41Z")

</div>

Hi, great app thank you. I need to understand better what is exactly “Variable is set”. Does it mean that the value of the variable is True? When does this flow trigger then? Thanks for explanation.

FYI i have two variables Hot and Cold. But if I put two flows one “Variable is set Hot” second with “Variable is set Cold” (and in other flow it could be only either Cold or Hot listening to themperature) it seem the change of variable stutuses for both between True/False triggers both initial flows “Variable is set Hot” and “Variable is set Cold”. So I dont get it why it triggers them both if I have value “Hot is tru” and “Cold is false”.

---

<div class="post-metadata">

**Author:** ![Esset](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/esset/32/39038_2.png) [@Esset](https://community.homey.app/u/Esset)\
**Post date:** [December 19, 2021, 10:08pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/156 "2021-12-19T22:08:42Z")

</div>

Updating homey pro to 7.2.1 removed all my better logic variables.

Now what?

---

<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:** [December 19, 2021, 11:38pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/157 "2021-12-19T23:38:27Z")

</div>

Oww… I didn’t hear about that one yet.  
Try to restore a backup from before the update?

---

<div class="post-metadata">

**Author:** ![Dijker](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@Dijker](https://community.homey.app/u/Dijker)\
**Post date:** [December 20, 2021, 5:47am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/158 "2021-12-20T05:47:07Z")

</div>

> [@Esset](#):
>
> Now what?

For me the update worked without issues.  
If you have a export of the variables you can import them again.els you need te recreat them.

---

<div class="post-metadata">

**Author:** ![Dijker](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@Dijker](https://community.homey.app/u/Dijker)\
**Post date:** [December 20, 2021, 6:03am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/159 "2021-12-20T06:03:09Z")

</div>

I don’t know if this script still works

> <https://github.com/Dijker/nu.Dijker.UnseenHomeyScripts/blob/master/recreateBL&CD-BackupFromFlows.js>

---

<div class="post-metadata">

**Author:** ![Esset](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/esset/32/39038_2.png) [@Esset](https://community.homey.app/u/Esset)\
**Post date:** [December 20, 2021, 6:41am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/160 "2021-12-20T06:41:35Z")

</div>

Phew! Did a restart of the app and all the variables came back. That was good news.

---

<div class="post-metadata">

**Author:** ![Stefan\_1](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/stefan_1/32/128096_2.png) [@Stefan\_1](https://community.homey.app/u/Stefan_1)\
**Post date:** [October 10, 2022, 7:43am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/161 "2022-10-10T07:43:48Z")

</div>

Hi,

Bug? No more trigger on tags?

Want to start a flow when a tag changes (weather: outside temperatur from homey).

Has someone the same Problem? Or a workaround with another app?

Thanx!

Stefan

---

<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:** [October 10, 2022, 1:29pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/162 "2022-10-10T13:29:23Z")

</div>

> [@Stefan\_1](#):
>
> Want to start a flow when a tag changes (weather: outside temperatur from homey).

That has no relation with Better logic, and it is no bug.  
That particular tag is (unfortunately) just not available in triggercards.

Workaround: create Text and Numeric Logics variables, and let them be filled by the outside Weather / Temperature from Homey, by a timer

 ![Screenshot from 2022-10-10 15-26-05](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/f/6fbb1c91ce6e9a76bb20485e0a1a77a233a35c58.jpeg)

---

<div class="post-metadata">

**Author:** ![Stefan\_1](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/stefan_1/32/128096_2.png) [@Stefan\_1](https://community.homey.app/u/Stefan_1)\
**Post date:** [October 10, 2022, 1:58pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/163 "2022-10-10T13:58:43Z")

</div>

Thanx Peter,

why is this no triggercard for tag temperature? Just for me to understand 😉

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/7/37d6b1f53e7af9517df1b7aa79b0803d82214924.png)

---

<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:** [October 10, 2022, 2:12pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/164 "2022-10-10T14:12:21Z")

</div>

The Better Logic triggercard works with Better logic variables, which names should be entered by hand.  
 ![Screenshot from 2022-10-10 16-10-31](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/9/6/967a8374c5852c2bd0bbb7f31ef473cefbad55e8.png)

And the Homey Logics card “a variable has changed”, works with Homey Logics variables. The Homey weather, or any apps tags are available. Hence the workaround I showed.  
(The workaround can be created with BL as well, but I don’s see a reason why)

---

<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:** [October 10, 2022, 2:25pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/165 "2022-10-10T14:25:06Z")

</div>

Wiht BL and the triggercard you like, you’d create something like this:

 ![Screenshot from 2022-10-10 16-24-03](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/2/1236a5f3cb8a5e70b6706397d01dc1ef15c0c06c.png)

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

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