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

<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, 2025, 7:40pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/514 "2025-08-24T19:40:31Z")

</div>

> [@Mike1233](#):
>
> calculation from Brian

Well, see the above message (not sure about math.js card,) but the expression card would allow for questionmarks, yes.

And no, extra spaces would not mind, the bll expression card handles the input like a javascript expression (with some extra methods available).

The math.js flowcard, which was part of the original BetterLogic app, is a bit different than how the BLL expression (and coding) works.

---

<div class="post-metadata">

**Author:** ![Mike1233](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mike1233/32/20991_2.png) [@Mike1233](https://community.homey.app/u/Mike1233)\
**Post date:** [August 24, 2025, 8:07pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/515 "2025-08-24T20:07:26Z")

</div>

Thank you for this explanation.

---

<div class="post-metadata">

**Author:** ![Timmm](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/timmm/32/110251_2.png) [@Timmm](https://community.homey.app/u/Timmm)\
**Post date:** [September 7, 2025, 7:40pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/516 "2025-09-07T19:40:30Z")

</div>

Hi!

I’m working on a project to track the contents of my freezer using **Homey Pro** and the **Better Logic Library (BLL)**. (together with chatgpt and WE can’t get it to work hahah)

- The contents are stored in a single text variable `vriezer_inhoud` in JSON format.

- Example content:

- I use Telegram commands like `/vriezer_overzicht`, `/vriezer_toevoegen`, and `/vriezer_verwijderen`.

- The overview should be sent back to Telegram as a nicely formatted list (bullets, with THT dates).

- Adding and removing items should update the JSON (append, increment, filter).

### Problem

- Showing the overview works with the _Format JSON as CSV_ card, but I want to format the output more nicely (bullets, labels, etc.).

- Attempts with `map()`, `concat()`, and `join()` result in errors like _“Reference error join is not defined”_.

- It’s unclear which functions are available in BLL expressions and how to best format a JSON array into readable text.

- I also need a reliable way to add or subtract portions and grams in the same JSON structure.

### Questions

- How can I format a JSON array into a readable overview (bullets, multiple fields per line) in BLL expressions?

- Are there examples of a correct `map()` → string output without using the CSV workaround?

- What is the recommended way in BLL to **modify JSON** (append, update, filter) and write it back to the same variable?

Any idea?

---

<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:** [September 7, 2025, 8:12pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/517 "2025-09-07T20:12:13Z")

</div>

> [@Timmm](#):
>
> I use Telegram commands

Telegram, as in the phone’s Telegram app, or one of the Homey apps?

---

<div class="post-metadata">

**Author:** ![Timmm](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/timmm/32/110251_2.png) [@Timmm](https://community.homey.app/u/Timmm)\
**Post date:** [September 7, 2025, 8:32pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/518 "2025-09-07T20:32:21Z")

</div>

Hi Peter,

[Telegram App voor Homey | Homey](https://homey.app/nl-nl/app/com.spkes.telegramNotifications/Telegram/) this app. So use those commands /vriezer…

If answer to question is X then

Or

If message has been received AND it’s precisely /vriezer then

I want to add, remove something in freezer or check it’s contents

Chatgpt said to use bll and json. But we 😁 can’t get it to work

---

<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:** [September 7, 2025, 10:53pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/519 "2025-09-07T22:53:07Z")

</div>

Ah yes, that app is a great tool to interact with flows.

So I asked [Homey bot](https://community.homey.app/t/hi-support-chat-bot/142701):  
“How do I store AND edit JSON data in Better Logic Library string variables?”  
The response seems pretty usable (_assuming_ you’ll get the same reply 😬 ).

In the meantime, check out the app “[JSON Handler](https://community.homey.app/t/66317)” also built by Arie .

---

<div class="post-metadata">

**Author:** ![Timmm](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/timmm/32/110251_2.png) [@Timmm](https://community.homey.app/u/Timmm)\
**Post date:** [September 8, 2025, 6:13am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/520 "2025-09-08T06:13:29Z")

</div>

Ahhh didn’t know about that chat got!! Thanks will try!!

---

<div class="post-metadata">

**Author:** ![Brian\_Monninkhof](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/brian_monninkhof/32/59307_2.png) [@Brian\_Monninkhof](https://community.homey.app/u/Brian_Monninkhof)\
**Post date:** [September 12, 2025, 7:36am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/521 "2025-09-12T07:36:27Z")

</div>

How do I use yes/no variable? I am getting a ❌ of ✅.

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

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

---

<div class="post-metadata">

**Author:** ![Rogier\_Verheugen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rogier_verheugen/32/77406_2.png) [@Rogier\_Verheugen](https://community.homey.app/u/Rogier_Verheugen)\
**Post date:** [September 12, 2025, 7:45am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/522 "2025-09-12T07:45:00Z")

</div>

Put every thing between {{ }}

{{(koken actief\*_ReserveA)+(wasmachine_\*ReserveA)}}

Example:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/f/8fa15d56ebe6f368ccbe4104efabf0826085f172.png)

MMM, I never used a boolean in a calculation.

---

<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:** [September 12, 2025, 1:25pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/523 "2025-09-12T13:25:09Z")

</div>

It’s a bit confusing, but in Better Logic cards, used by Brian, there’s no need for the {{ }} around calculations.

@Brian_Monninkhof I as well think you can’t use booleans in calculations. You can use those in expressions, like

 ![Screenshot_20250912_153226_Firefox](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/b/4baf6ec2fde364f21082b817ff892b3acf5ba095.jpeg)

---

<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 13, 2025, 3:47pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/524 "2025-09-13T15:47:58Z")

</div>

> [@Brian\_Monninkhof](#):
>
> How do I use yes/no variable

Which flowcard are you using?

---

<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 13, 2025, 5:46pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/525 "2025-09-13T17:46:36Z")

</div>

> [@Timmm](#):
>
> What is the recommended way in BLL to **modify JSON** (append, update, filter) and write it back to the same variable?

Use the JSON Handler app for that.

---

<div class="post-metadata">

**Author:** ![Brian\_Monninkhof](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/brian_monninkhof/32/59307_2.png) [@Brian\_Monninkhof](https://community.homey.app/u/Brian_Monninkhof)\
**Post date:** [September 16, 2025, 5:24pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/526 "2025-09-16T17:24:19Z")

</div>

I removed all yes/no variables, I use 1/0 instead.

---

<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 27, 2025, 11:04am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/527 "2025-09-27T11:04:13Z")

</div>

> [@Brian\_Monninkhof](#):
>
> How do I use yes/no variable? I am getting a ❌ of ✅.

Hey Brian and @Peter_Kawa ,

I just released another version of BLL.

Whenever a ❌ or ✅ is send within expressions or codings, it is replaced with a true or false.

This means you can use yes/no tokens again on a HP2023.

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/a/6a2bea29a6851fde8aa983819df99896f2e69aa5.png)

---

<div class="post-metadata">

**Author:** ![CaptainVoni](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/captainvoni/32/3549_2.png) [@CaptainVoni](https://community.homey.app/u/CaptainVoni)\
**Post date:** [September 27, 2025, 7:32pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/528 "2025-09-27T19:32:41Z")

</div>

> [@Arie\_J\_Godschalk](#):
>
> Whenever a ❌ or ✅ is send within expressions or codings, it is replaced with a true or false.

Great improvement, but please be aware that this change breaks existing flows that used ❌ of ✅ in codings.

---

<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 27, 2025, 7:53pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/529 "2025-09-27T19:53:20Z")

</div>

> [@CaptainVoni](#):
>
> breaks existing flows that used ❌ of ✅ in codings.

Well, i don’t think there are many ways coding could really break.

If you have the x or check as string/text output through an expression, yes, that will probably be effect yes.

But unless you have as an yes/no condition `'x'=='x'` i think breaking flows won’t happen that easily.

This change was on my list since hp2023, but didn’t have it implemented yet.

---

<div class="post-metadata">

**Author:** ![Marcel\_R](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marcel_r/32/47933_2.png) [@Marcel\_R](https://community.homey.app/u/Marcel_R)\
**Post date:** [October 9, 2025, 6:31pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/530 "2025-10-09T18:31:46Z")

</div>

Hi all,

For most of you, it’s probably a piece of cake, but I simply lack the knowledge:

A card in the Tesla app generates a time (‘time to destination’) as output (HH:mm). But, I don’t want the ‘time to destination’, I want the ‘arrival time’. So, somehow, I need to add the ‘time to destination’ to the now() time.

I checked all posts here (and to be honest, most look like food for programmers, which I’m not, so most I don’t understand and lots of respect for all Homey users knowing all this stuff) and hoped to find something similar to used. I found, but still after trying two evenings, I didn’t get it work.

So, does somebody know how to make a calculation with times and add the output (e.g. 18:45) of the Tesla app card to the actual time to generate the ‘time of arrival’?

Thanks in advance!

Marcel.

---

<div class="post-metadata">

**Author:** ![SunBeech](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sunbeech/32/111391_2.png) [@SunBeech](https://community.homey.app/u/SunBeech)\
**Post date:** [October 9, 2025, 8:58pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/531 "2025-10-09T20:58:28Z")

</div>

This example adds the variable ‘Tesla Time’, that contains the time to destination in HH:mm format, to the current date/time stamp (which is in milliseconds) and formats the result again as HH:mm. That is the output of the last card, which you can then use in your flow.

 ![BLL Add Timestamp to Current Time](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/d/1da76baf970e493651a9936273a385b9829da50f.png)

---

<div class="post-metadata">

**Author:** ![Marcel\_R](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marcel_r/32/47933_2.png) [@Marcel\_R](https://community.homey.app/u/Marcel_R)\
**Post date:** [October 10, 2025, 7:37am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/532 "2025-10-10T07:37:56Z")

</div>

Thanks a lot! I understand your flow, but I couldn’t figure out myself (lack of knowledge, like ‘parseInt’ function…).

---

<div class="post-metadata">

**Author:** ![Patrick\_Van\_Deursen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/patrick_van_deursen/32/56539_2.png) [@Patrick\_Van\_Deursen](https://community.homey.app/u/Patrick_Van_Deursen)\
**Post date:** [October 10, 2025, 8:05am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/533 "2025-10-10T08:05:16Z")

</div>

did it a bit differently in a different flow to extract the time of dusk which I use in different flows:

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

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

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