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

<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:** [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/1 "2018-12-16T22:29:57Z")

</div>

![large](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/e/ebe8de9b1ea962788d98f715e80a71d1988be0b0.png)

# [Better Logic Library](https://homey.app/a/net.i-dev.betterlogic/).

The Better Logic App has been rebranded to Better Logic Library.  
Check out the new App Settings for the new features, like **BLL coding** in [supported apps](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/4)!

> [@\[APP\]\[Pro\] Better Logic Library - For Users](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/4):
>
> Apps that support BBL coding in (certain) flowcard: Better Logic Library BLL coding, see the App settings to get a better view on what that is and how to use it. FTP Client FTP client now supports BLL coding in all it’s text-arguments, like saving an image to FTP: Google Services Google Services now supports BLL coding in all it’s text-arguments, like Start saying […]:

# See:

[[APP][Pro] Better Logic Library - For Users](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876)  
[[APP][Pro] Better Logic Library - For Developers](https://community.homey.app/t/app-pro-better-logic-library-for-developers/71761)

* * *

Currently containing:

**Triggers**

- A variable changed
- A variable is set
- A number variable changed
- One of these variables changed
- Any variable changed (DEBUG)

**Conditions**

- Text contains
- Text starts with
- Text is exact
- Number is exact
- _Variable_ greater than
- _Variable_ less than
- _Variable_ is true/false
- Math.js expression is true/false

**Actions**

- Set string variable
- Set number variable
- Increment number variable
- Decrement number variable
- Execute mathjs expression
- Set boolean variable
- Flip boolean variable
- Execute a trigger
- Set a variable

**Devices**

- BitFlip
- NumSlide
- Trigger

# Current / old App Store text:

Welcome to the Better Logic Library.

An advanced logic library with variable and library management for Homey.

This apps supplies your Homey with Better Logic and Libraries:

- Variable management in a smart, integrated way.
- Advanced action- and conditioncards with Better Logic, like Math.js.
- Devices to directly manage the variables.
- Datetime formatting, fully customisable, shared with other apps.
- BLL coding and BLL expressions to use directly within other apps flowcards.
- Custom functions to use within BLL coding and BLL expressions.
- Libraries to use within BLL coding and BLL expressions, like Math.js and Lodash.
- A File Server that can be consumed by other apps, like Simple (Sys) LOG, to serve files on you LAN or to download them on the Homey Mobile App or the Developertools.
- Libraries for other Apps to consume, reducing app sizes and redundancies and improving management.
- APIs for variable management, using the File Server or other BLL functions.

Check out the (new) App Settings for all features and explanations, like BLL coding in supported apps!

Example BLL coding: When you place this within a textargument: - Hello, today is {[date(“dddd”)]} -, BLL will automaticly find those expressions within the texts and decode them, resulting in - Hello, today is monday - .

Further: Manage variables directly in flows!

Just type a variable name within any when- and thencard and select it from the list: the variable will be automaticly created.  
If you want to use the tag, press save first.  
Variables that were automaticly created from within flows will also be automaticly deleted when they are no longer used in flowcards.  
Variables can also still be managed from the settings screen. These variables will not be automaticly deleted if not used, but must be manually deleted.

And the Delete All button has a confirm now!

- Feature: Added API support to GET, GET all variables and SET (post) a value.

- Feature: Trigger to API. Call

- Feature: Add increment or decrement to API. Call

- Feature: Add toggle of boolean (true-\>false or false-\>true) to API support

- Feature: Add $timenow$ as a special variable for mathjs. This will retrieve the current time in seconds since epoch This variable is not stored in the overview, but used in expressions.

- Feature: Added #DD (day), #MM (month), #YYYY (year), #HH (hours), #mm (minutes) #SS (seconds) as reserved words next to timenow in the mathjs flows. You can now for example assign #HH to a variable to get the hours. Also I changed timenow to #timenow for consistency.

### Please report **issues** or **feature** requests at [QlusterIT / nl.qluster-it.BetterLogic / issues — Bitbucket](https://bitbucket.org/QlusterIT/nl.qluster-it.betterlogic/issues?status=new&status=open).

### Apps:

> [@\[Profile\] Arie J. Godschalk](https://community.homey.app/t/profile-arie-j-godschalk/70663/2):
>
> Apps developed or maintained by me: [Advanced Triggers](https://community.homey.app/t/app-pro-advanced-triggers-trigger-and-action-cards-with-eventname-for-advanced-flows/65651) , [BeNext](https://community.homey.app/t/app-pro-benext-benext-devices-for-homey/76104) , [Better Logic](https://community.homey.app/t/app-pro-better-logic-just-some-better-logic-and-variable-management/5568) , [Chronograph](https://community.homey.app/t/app-pro-chronograph-adds-precise-timer-stopwatch-and-transition-functionality-to-homey/18214) , [Device Capabilities](https://community.homey.app/t/app-pro-device-capabilities-enhance-the-capabilities-of-devices/43287) , [Advanced Virtual Device](https://community.homey.app/t/app-pro-advanced-virtual-device-device-capabilities-app-with-unique-text-status-indicator/68198) , [FTP Client](https://community.homey.app/t/app-pro-ftp-client/70876) , [Google Services](https://community.homey.app/t/google-services-app-for-translate-and-new-text-to-speech-for-any-device-with-url-input/43257) , [Homesh Controller](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) , [Homesh Satellite](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) , [JSON Handler and Manipulator](https://community.homey.app/t/app-pro-json-handler-and-manipulator/66317) , [LOQED](https://community.homey.app/t/app-pro-loqed-your-personal-doorman/89816) , [Music Url Converter](https://community.homey.app/t/music-url-converter-play-music-urls-on-homey-bigger-then-900-kb/43546) , [Simple Log](https://community.homey.app/t/simple-log-app/146) , [Universal Media Player](https://community.homey.app/t/universal-media-player-a-generic-storages-place-for-your-homey-speakers-tvs-or-other-media-devices/43450) and [Virtual Devices](https://community.homey.app/t/app-pro-virtual-devices-virtual-devices-to-simulate-1-or-more-real-devices/1723) . [Goto profile of Arie J. Godschalk](https://community.homey.app/t/profile-arie-j-godschalk/70663) for more …

### Donations or Sponsorship

> [@\[Profile\] Arie J. Godschalk](https://community.homey.app/t/profile-arie-j-godschalk/70663/3):
>
> Donations or Sponsorship. You can help with the development, maintenance and support for the Apps, by donating or becoming a sponsor. This would be much appreciated! The more donations i receive, the more time i can make free for development and support. slight_smileDonations can be done through: [[PP] PayPal](https://paypal.me/QlusterIT) Requires a PayPal account. [[GS] Github Sponsors](https://github.com/sponsors/XeroxQ) Allowes for CreditCard. Sponsorships can be done through: [[P] Patreon](https://www.patreon.com/QlusterIT/membership) Requires a Patreon account. [[GS] Github Sponsors](https://github.com/sponsors/XeroxQ) …

---

<div class="post-metadata">

**Author:** ![Fire69](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/fire69/32/8758_2.png) [@Fire69](https://community.homey.app/u/Fire69)\
**Post date:** [December 17, 2018, 5:05am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/2 "2018-12-17T05:05:48Z")

</div>

This is a compatible upgrade to the current app? Meaning when you install this app everything should continue working without the need to redo all your flows?

---

<div class="post-metadata">

**Author:** ![SailingDuck](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sailingduck/32/2988_2.png) [@SailingDuck](https://community.homey.app/u/SailingDuck)\
**Post date:** [December 17, 2018, 6:53am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/3 "2018-12-17T06:53:52Z")

</div>

That’s what we have to find out in the experimental release. Everything was developed using a separate app id to get every part up and running. When I moved everything back to the existing app id it loaded my existing variables.

There might be a possibility the numslide device might not be fully working as it used a device class that’s not allowed in sdk2 so I had to pick an other. But seems to be loading fine when I added one in sdk1 and uograded to sdk2.

There’s currently an homey issue with triggers so not yet fully sure if it completely works in v2.0. But the whole v2.0 firmware is in experimental for a reason, not everything is going to work from the start. But you knew that when you flipped the experimental switch 😉

For the moment I’d say if you have to upgrade to homey 2.0 it might never hurt to do an export of your variables first 😉

---

<div class="post-metadata">

**Author:** ![Uranday](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/uranday/32/2047_2.png) [@Uranday](https://community.homey.app/u/Uranday)\
**Post date:** [December 17, 2018, 8:04pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/4 "2018-12-17T20:04:05Z")

</div>

I just posted the SDK2 release as beta. Now it is just waiting for validation. Many thanks to SailingDuck for the help!

---

<div class="post-metadata">

**Author:** ![Uranday](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/uranday/32/2047_2.png) [@Uranday](https://community.homey.app/u/Uranday)\
**Post date:** [December 18, 2018, 9:33pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/5 "2018-12-18T21:33:38Z")

</div>

The beta app is in the appstore!

---

<div class="post-metadata">

**Author:** ![Eternity](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eternity/32/102113_2.png) [@Eternity](https://community.homey.app/u/Eternity)\
**Post date:** [January 4, 2019, 12:04pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/6 "2019-01-04T12:04:30Z")

</div>

Could someone point me to the place where I can find all functions of Better logic? I am looking for stuff like Round{{…}}

Searched but couldn’t find it, and the flow I used ‘round’ in, I have deleted 😥

---

<div class="post-metadata">

**Author:** ![JPe4619](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jpe4619/32/9017_2.png) [@JPe4619](https://community.homey.app/u/JPe4619)\
**Post date:** [January 4, 2019, 12:31pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/7 "2019-01-04T12:31:35Z")

</div>

@Eternity Is it not like [http://mathjs.org/examples/index.html](http://mathjs.org/examples/index.html) ?

---

<div class="post-metadata">

**Author:** ![Eternity](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eternity/32/102113_2.png) [@Eternity](https://community.homey.app/u/Eternity)\
**Post date:** [January 4, 2019, 1:14pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/8 "2019-01-04T13:14:54Z")

</div>

Checked the link, it is ‘similar’ 😉

I am looking for somthing like {{round, var;2}} to change a variable from x,xxxxxx to x,xx

---

<div class="post-metadata">

**Author:** ![SailingDuck](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sailingduck/32/2988_2.png) [@SailingDuck](https://community.homey.app/u/SailingDuck)\
**Post date:** [January 4, 2019, 1:32pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/9 "2019-01-04T13:32:04Z")

</div>

Put variables between $ signs. These are not displaying here.  
round(variableName, 1)

---

<div class="post-metadata">

**Author:** ![Fire69](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/fire69/32/8758_2.png) [@Fire69](https://community.homey.app/u/Fire69)\
**Post date:** [January 4, 2019, 1:41pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/10 "2019-01-04T13:41:58Z")

</div>

I have a flow that rounds a random number between 1 and 5.  
I had to use round(random(1,5)) so not {} but ()

---

<div class="post-metadata">

**Author:** ![JPe4619](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jpe4619/32/9017_2.png) [@JPe4619](https://community.homey.app/u/JPe4619)\
**Post date:** [January 4, 2019, 2:02pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/11 "2019-01-04T14:02:03Z")

</div>

(round( WnkDimVal \*100))/100

---

<div class="post-metadata">

**Author:** ![Eternity](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eternity/32/102113_2.png) [@Eternity](https://community.homey.app/u/Eternity)\
**Post date:** [January 4, 2019, 2:38pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/12 "2019-01-04T14:38:30Z")

</div>

This was what I did, and worked:

{{round (Energiekosten vandaag,2)}}

to round the variable _Energiekosten vandaag_ to 2 decimals

---

<div class="post-metadata">

**Author:** ![SailingDuck](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sailingduck/32/2988_2.png) [@SailingDuck](https://community.homey.app/u/SailingDuck)\
**Post date:** [January 4, 2019, 3:02pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/13 "2019-01-04T15:02:03Z")

</div>

What card are you using?

---

<div class="post-metadata">

**Author:** ![Eternity](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eternity/32/102113_2.png) [@Eternity](https://community.homey.app/u/Eternity)\
**Post date:** [January 4, 2019, 3:40pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/14 "2019-01-04T15:40:30Z")

</div>

![14](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/4/46b6228f17495159dc2366f823108de2286aece0.png)

---

<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:** [January 4, 2019, 3:42pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/15 "2019-01-04T15:42:58Z")

</div>

And when u try it without the brackets?

---

<div class="post-metadata">

**Author:** ![Eternity](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eternity/32/102113_2.png) [@Eternity](https://community.homey.app/u/Eternity)\
**Post date:** [January 4, 2019, 3:45pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/16 "2019-01-04T15:45:19Z")

</div>

![58](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/b/bf259f836e1436bf7b6e8c90fdb433f0ee28fc62.png)

Works too 🙂

---

<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:** [January 4, 2019, 3:46pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/17 "2019-01-04T15:46:20Z")

</div>

Ok cool. Because that’s what all say in the above posts.

---

<div class="post-metadata">

**Author:** ![Eternity](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eternity/32/102113_2.png) [@Eternity](https://community.homey.app/u/Eternity)\
**Post date:** [January 4, 2019, 3:48pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/18 "2019-01-04T15:48:19Z")

</div>

Confusing for me was that I had a calculation within a calculation. I have changed that… Anyway… all thanks for helping 🙂

Have a great weekend!

[JPe had a bracket too… haha (round( WnkDimVal \*100))/100 😛]

---

<div class="post-metadata">

**Author:** ![JPe4619](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jpe4619/32/9017_2.png) [@JPe4619](https://community.homey.app/u/JPe4619)\
**Post date:** [January 4, 2019, 4:51pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/19 "2019-01-04T16:51:29Z")

</div>

> [@Eternity](#):
>
> [JPe had a bracket too… haha (round( WnkDimVal \*100))/100 😛]

No curled brackets!!

---

<div class="post-metadata">

**Author:** ![Techniman](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/techniman/32/8654_2.png) [@Techniman](https://community.homey.app/u/Techniman)\
**Post date:** [January 12, 2019, 8:58am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/20 "2019-01-12T08:58:12Z")

</div>

Just installed the beta app but i cannot seem to add any variables…  
I push the button but is does not add the var to the overview 😕

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