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

<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:** [April 3, 2023, 5:00pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/42 "2023-04-03T17:00:21Z")

</div>

Thank you Peter, you always have good advice, but AVD is a bit too advanced for me right now, I’m struggling even setting up a “Badge” with a power-price label ha ha…But 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:** [April 3, 2023, 5:06pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/43 "2023-04-03T17:06:00Z")

</div>

Thanks, and yes, when i have time, energie and sleep more than 22 hours since last Tuesday, i will implement a card that will allow you to retrieve any “metadata” about the variables. 😉

---

<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:** [April 3, 2023, 5:19pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/44 "2023-04-03T17:19:26Z")

</div>

No rush Arie, not trying to stress you - sometime in the future would be great! Love your apps by the way, super-valuable! 🤩

---

<div class="post-metadata">

**Author:** ![M\_a\_r\_c\_o](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/m_a_r_c_o/32/146_2.png) [@M\_a\_r\_c\_o](https://community.homey.app/u/M_a_r_c_o)\
**Post date:** [May 28, 2023, 7:07pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/45 "2023-05-28T19:07:26Z")

</div>

Hello,

I have used the below flow for years now, but before migrating to a Homey Pro 2023 I need to convert the flow to another flow, without the use of HTTP request flowcards. The flow still works, even with the newest BLL, but I don’t see how I can convert the flow with all the variables at this moment. Do I need a BLL function?  
Please help me with some example.

[https://homey.app/nl-nl/flow/PAELzx/](https://homey.app/nl-nl/flow/PAELzx/)

---

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

</div>

I think this is the way, Marco, but you’ll need to create an Advanced flow.

Then you can use one of these “Then” logics cards:

 ![Screenshot from 2023-05-28 22-42-55](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/a/7ac5a876ca0248a233361426d37c956ffe568061.png)

**EDIT** The example flow is wrong  
This is the right one

> [@\[APP\]\[Pro\] Better Logic Library - For Users](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/52):
>
> Ah, I made a little mistake grimacing Ofcourse, one has to set the variable with the result of the Logic ‘parse … as JSON’ card indeed, like Arie alr pointed out. Earlier I already made a working example, but “remembered it wrong” (like a Dutch politician would say rofl): This saves a lot of ‘Parse .. as JSON’ cards’ indeed Arie. Thanks!

~~Example flow:~~

 ![Screenshot from 2023-05-28 22-38-59](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/d/8da7c01aa6e768f0fcf2c120c31c23540c60b56b.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:** [May 29, 2023, 6:20am UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/47 "2023-05-29T06:20:18Z")

</div>

> [@M\_a\_r\_c\_o](#):
>
> Please help me with some example.

I think this is what you would want.  
You can do it with buildin flowcards, but i am using JSON handler app because you need way less flowcards:

Before the first flowcard, you would need the MQTT message recieved card. I am using a tag as example, because i don’t have MQTT.  
Also, i am unsure what type is CO2, IAQ or GASres, i have asumed a number, but you can pick another type:  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/a/4a22abebe5259c67fb1d90f9ec1f9a20c9e8ec0b.png)

---

<div class="post-metadata">

**Author:** ![M\_a\_r\_c\_o](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/m_a_r_c_o/32/146_2.png) [@M\_a\_r\_c\_o](https://community.homey.app/u/M_a_r_c_o)\
**Post date:** [May 29, 2023, 9:54am UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/48 "2023-05-29T09:54:08Z")

</div>

Thanks! I found them, did not expect to only find these Logic cards in Advanced flows, while I was searching in standard flows (inconsistent choice from Athom), cards are not that special.

Your second post is probably also possible.

Converted to AF and it works. I have now this:

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

Thanks again!

---

<div class="post-metadata">

**Author:** ![M\_a\_r\_c\_o](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/m_a_r_c_o/32/146_2.png) [@M\_a\_r\_c\_o](https://community.homey.app/u/M_a_r_c_o)\
**Post date:** [May 29, 2023, 10:23am UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/49 "2023-05-29T10:23:46Z")

</div>

Hmm, it does not work yet, result is empty, the value is not read from JSON and not put into the number logic. SO the logic is not updated with the last value.

JSON sample read from MQTT and is printed in Simple log to check:

{“ClientID”:“KT2-Sensor-01”,“Date”:“29-05-2023”,“Time”:“12:18:47”,“CO2”:913,“Temperature”:23.94,“Humidity”:49.45,“Pressure”:1027.53,“IAQ”:84.54,“VOC”:1937,“GASres”:1937}

$.CO2 should read the argument, right? Its the 4th variable in the JSON content.

---

<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 29, 2023, 10:37am UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/50 "2023-05-29T10:37:50Z")

</div>

Where you have the Read JSON and **SET** cards, you are setting the Paths and than you fill the value with the existing TAG:  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/9/59d107ff837f816c055b6427267d6e9e91c191b2.jpeg)  
This card is ment to fill a JSON with values, not read the JSON.

You would need the READ and **SELECT** cards:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/9/f/9ff3e5566d4a6c67a748b9da578696604cf9c6bb.png)  
and than use the Tokens from that card to put it into a variable or send it to the log.

---

<div class="post-metadata">

**Author:** ![M\_a\_r\_c\_o](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/m_a_r_c_o/32/146_2.png) [@M\_a\_r\_c\_o](https://community.homey.app/u/M_a_r_c_o)\
**Post date:** [May 29, 2023, 11:42am UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/51 "2023-05-29T11:42:57Z")

</div>

OMG, difference in text is so little 😊

But it works now, thanks again!

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/9/49ee7dfb8e8e3860b5cdf3fd5748766a7f4fcc73.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:** [May 29, 2023, 2:18pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/52 "2023-05-29T14:18:34Z")

</div>

Ah, I made a little mistake 😬  
Ofcourse, one has to set the variable with the result of the Logic ‘parse … as JSON’ card indeed, like Arie alr pointed out.

Earlier I already made a working example, but “remembered it wrong” (like a Dutch politician would say 🤣):

 ![image51](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/0/209b548cdae6f49734db9a5bc432187e331e7d86.png)

> [@\[APP\]\[Pro\] Knmi (Dutch weather, for Homey firmware v5 or above)](https://community.homey.app/t/app-pro-knmi-dutch-weather-for-homey-firmware-v5-or-above/34228/136):
>
> When I use the weerlive API key I still see the “max expected temp” values ‘d0tmax’ ‘d1tmax’ etc. You can compare it with the app values this way (use your own hometown), to see if it is an issue of weerlive, or the Knmi app: [https://weerlive.nl/api/json-data-10min.php?key=MyApiKey&locatie=Alkmaar:](https://weerlive.nl/api/json-data-10min.php?key=MyApiKey&locatie=Alkmaar:) { "liveweer": [{ "plaats": "Alkmaar", "timestamp": "1684891383", "time": "24-05-2023 03:23", "temp": "5.1", "gtemp": "3.5", "samenv": "Licht bewolkt", "lv": "97", "windr": "NW", …

* * *

> [@Arie\_J\_Godschalk](#):
>
> ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/a/4a22abebe5259c67fb1d90f9ec1f9a20c9e8ec0b.png)

This saves a lot of ‘Parse .. as JSON’ cards’ indeed Arie. 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 14, 2023, 5:28pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/53 "2023-06-14T17:28:08Z")

</div>

> [@Peter\_Kawa](#):
>
> Is it possible to add the “GMT +1” part separately?  
> F.i. Homey locale is English,  
> but I want to use 24h time, without changing the BLL locale to Dutch.
> 
> `HH:mm:ss ` but what is the code for GMT+1?

Yes it is, use `kk`:

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

---

<div class="post-metadata">

**Author:** ![KarlO](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/karlo/32/79886_2.png) [@KarlO](https://community.homey.app/u/KarlO)\
**Post date:** [June 28, 2023, 11:01am UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/54 "2023-06-28T11:01:00Z")

</div>

I apologize for my lack of understanding how to use BLL…  
I have set a variable to the date and time something occurred, but then when I try to use that variable (in a Telegram Bot response), I get this error. What am I missing? The variable ‘VVB70Grader’ exists in BLL and has the right value/text.

 ![Screenshot 2023-06-28 at 12.22.39](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/8/08685dbf1665c71044a8c2cfe72dd88b48d5472e.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:** [June 28, 2023, 11:14am UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/55 "2023-06-28T11:14:27Z")

</div>

> [@KarlO](#):
>
> I have set a variable to the date and time something occurred, but then when I try to use that variable (in a Telegram Bot response), I get this error. What am I missing? The variable ‘VVB70Grader’ exists in BLL and has the right value/text.

The flowtoken error says it’s a default Homey Logic variable.  
Is there any change you first created a default Homey Logic Variable called VVB70Grader, and thant changed to BLL?

Remove the VVB70Grader tag and reselect it from the BLL variables?

because flowtoken homey:manager:logic:\*\*\* has nothing todo with BLL, so somehow, it doesn’t see this as a BLL token.

Edit:  
And please share the whole flow, because i don’t see any BLL in it currently 😉

---

<div class="post-metadata">

**Author:** ![KarlO](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/karlo/32/79886_2.png) [@KarlO](https://community.homey.app/u/KarlO)\
**Post date:** [June 28, 2023, 11:31am UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/56 "2023-06-28T11:31:31Z")

</div>

Thanks for replying. I think my Flow was trying to access a regular variable that I had deleted, that had the same name. When I reload the Flows, that same variable name is now “not available”…  
Let me rephrase my noob question then: what is the proecdure to get BLL variables out from BLL and into other flow cards (for example a Telegram Bot flow card)?

---

<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, 11:33am UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/57 "2023-06-28T11:33:49Z")

</div>

> [@KarlO](#):
>
> what is the proecdure to get BLL variables out from BLL and into other flow cards (for example a Telegram Bot flow card)?

Indeed by using a tag, but please show the whole flow so i can advice better 😉

---

<div class="post-metadata">

**Author:** ![KarlO](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/karlo/32/79886_2.png) [@KarlO](https://community.homey.app/u/KarlO)\
**Post date:** [June 28, 2023, 11:57am UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/58 "2023-06-28T11:57:46Z")

</div>

Okay, here is my flow to set the variable:

 ![Screenshot 2023-06-28 at 13.18.26](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/e/7e161f65487908625dc3c26d78a0dc3129a95a2e.png)

The variable in BLL:

 ![Screenshot 2023-06-28 at 13.18.55](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/4/046ae8e0da3169737f1837f39092df0162ec34e6.jpeg)

And the flow I want to access it in, but now I am unable to find the variable, it does not appear to exist outside BLL, hence my question how to get the variables “out from BLL”…

 ![Screenshot 2023-06-28 at 13.53.39](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/c/fc69921aad9d50bd8800b5ab5b052fe860493cca.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:** [June 28, 2023, 12:08pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/59 "2023-06-28T12:08:52Z")

</div>

> [@KarlO](#):
>
> ![Screenshot 2023-06-28 at 13.18.26](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/e/7e161f65487908625dc3c26d78a0dc3129a95a2e.png)
> 
> Screenshot 2023-06-28 at 13.18.26804×1364 89.8 KB

The bottom card, is that the set variable to BLL Expression card?  
If so, remove the {[and]}.

And, in BLL remove the variable once, because it says type is Object, that should not be, Object is not a type, and i am not sure how it is created that way.  
It should say string, and then there should be a token for it.

You can than Add a string variable yourself with the name VVB70Grader.

---

<div class="post-metadata">

**Author:** ![KarlO](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/karlo/32/79886_2.png) [@KarlO](https://community.homey.app/u/KarlO)\
**Post date:** [June 28, 2023, 12:14pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/60 "2023-06-28T12:14:38Z")

</div>

Thanks - everything works now! The problem was that I thought the BLLExpression in the BLL Expression flow card should contain {[and]}.

---

<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:22pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/61 "2023-06-28T12:22:10Z")

</div>

Well, ill see if i can improve the description  
BLL coding can be used within multiple apps within textarguments. A BLL coding is defined by the `{[]}` and within that, there is a BLL expression. 🙂

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

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