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

<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 29, 2019, 6:56am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/41 "2019-01-29T06:56:07Z")

</div>

You need to type the variable names. Using the tags it gives the values of the tags so I dont know which ones have changed.

---

<div class="post-metadata">

**Author:** ![MartijnT](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/martijnt/32/12800_2.png) [@MartijnT](https://community.homey.app/u/MartijnT)\
**Post date:** [January 29, 2019, 5:51pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/42 "2019-01-29T17:51:58Z")

</div>

Thanks. Problem solved. Typing the variables was the solution. Call me stupid 🤪

---

<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:** [February 9, 2019, 1:29pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/43 "2019-02-09T13:29:16Z")

</div>

I added a hint in the latest version (1.0.4) that tags will not work 🙂

---

<div class="post-metadata">

**Author:** ![Bob\_Mijwaard](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/bob_mijwaard/32/11736_2.png) [@Bob\_Mijwaard](https://community.homey.app/u/Bob_Mijwaard)\
**Post date:** [March 6, 2019, 11:14am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/45 "2019-03-06T11:14:42Z")

</div>

Would it be possible to move the “delete all” button. This button is placed directly under the “add variable” button and on a phone the delete button is touched easily. Instead of adding you will delete all variables.

---

<div class="post-metadata">

**Author:** ![Osorkon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/osorkon/32/43026_2.png) [@Osorkon](https://community.homey.app/u/Osorkon)\
**Post date:** [March 26, 2019, 3:16pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/46 "2019-03-26T15:16:34Z")

</div>

Which mathematical operators can be used?  
Are this only +,-,/,\*?  
Or can logarithm and exponentiation functions also be used?

---

<div class="post-metadata">

**Author:** ![viix](https://avatars.discourse-cdn.com/v4/letter/v/4af34b/32.png) [@viix](https://community.homey.app/u/viix)\
**Post date:** [March 27, 2019, 9:45am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/48 "2019-03-27T09:45:17Z")

</div>

any [mathjs](https://mathjs.org/) operators will work

---

<div class="post-metadata">

**Author:** ![Rrrr](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rrrr/32/629_2.png) [@Rrrr](https://community.homey.app/u/Rrrr)\
**Post date:** [May 28, 2019, 3:39pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/49 "2019-05-28T15:39:29Z")

</div>

Just note something may have changed: I had to use {{ and }} around the expression in the “Set a variable” card.

{{round(Total/60/60,0)}}

---

<div class="post-metadata">

**Author:** ![cmd](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/cmd/32/8427_2.png) [@cmd](https://community.homey.app/u/cmd)\
**Post date:** [June 25, 2019, 6:28am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/50 "2019-06-25T06:28:14Z")

</div>

Hello!  
First love this system, works very well.

I do have an issue I havent solved which is rounding to a half number.  
For example I want 22.3 to be rounded to 22.5 instead of 22 or 23.

Tried some different methods but this mathjs dosent seem to support things like ceiling/ceil(number, 0.5), round10, ceil10 etc.

Is this possible today?

---

<div class="post-metadata">

**Author:** ![Ton\_Meek](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ton_meek/32/149_2.png) [@Ton\_Meek](https://community.homey.app/u/Ton_Meek)\
**Post date:** [June 25, 2019, 3:43pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/51 "2019-06-25T15:43:06Z")

</div>

Try round(x\*2)/2

---

<div class="post-metadata">

**Author:** ![cmd](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/cmd/32/8427_2.png) [@cmd](https://community.homey.app/u/cmd)\
**Post date:** [June 27, 2019, 4:42am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/52 "2019-06-27T04:42:41Z")

</div>

Thank you, worked

---

<div class="post-metadata">

**Author:** ![jolerius](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jolerius/32/7907_2.png) [@jolerius](https://community.homey.app/u/jolerius)\
**Post date:** [August 4, 2019, 8:10pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/53 "2019-08-04T20:10:33Z")

</div>

Any way to split a variable and only keep one part?

Ex variable contains:  
“Homey Blog  
[https://blog.athom.com/](https://blog.athom.com/)”

Can I split it and only keep the webadress?

---

<div class="post-metadata">

**Author:** ![Sander\_Vlotman](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sander_vlotman/32/7855_2.png) [@Sander\_Vlotman](https://community.homey.app/u/Sander_Vlotman)\
**Post date:** [August 30, 2019, 9:30am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/54 "2019-08-30T09:30:39Z")

</div>

Hi there, is there any manual or step by step explanation of how to use better logic? I like to build a string with a variable #YYYY and #MM #DD of the current day in it to create a string to stream the dutch news (20.00 nos journaal) to chromecast but tried and could not solve this myself. So what I want is [https://download.omroep.nl/nos/content/mp4/web02/2019/08/29/43866/mp4\_web02.mp4](https://download.omroep.nl/nos/content/mp4/web02/2019/08/29/43866/mp4_web02.mp4)  
where I replace the date with a vriable. But a general manual on how it works would even be greater as I see lots of possibilities for it (like triggers, etc).

---

<div class="post-metadata">

**Author:** ![Sander\_Vlotman](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sander_vlotman/32/7855_2.png) [@Sander\_Vlotman](https://community.homey.app/u/Sander_Vlotman)\
**Post date:** [August 30, 2019, 4:10pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/55 "2019-08-30T16:10:35Z")

</div>

Ha discovered myself how it works (with the function mathjs expression and then dollar sign `$ # YYYY $` in it for the year) somehow `$` disappear in this forum. Now I come to the next challenge. Via IFTT and an RSS feed I retrieve a string containing a unique number for the mp4 of that journal. [https://nos.nl/b/43885](https://nos.nl/b/43885) now I want to get that number from this string so need to remove a part of the string ([https://nos.nl/b/](https://nos.nl/b/)). Again a manual or some help is welcome. I will then share my project with the NOS chromecast feed app that no longer works.

---

<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 2, 2019, 6:40pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/58 "2019-09-02T18:40:30Z")

</div>

Hi, how have you been able to use the time in an expression? I am trying to copy time (#HH and #mm) into 2 separate variables. However, the variables change to empty

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/8/8438bc4884f2eb888f31b3d2d27ef10096b4092e.jpeg)  
Any help will be apreciated

---

<div class="post-metadata">

**Author:** ![Sander\_Vlotman](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sander_vlotman/32/7855_2.png) [@Sander\_Vlotman](https://community.homey.app/u/Sander_Vlotman)\
**Post date:** [September 2, 2019, 8:01pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/59 "2019-09-02T20:01:01Z")

</div>

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/0/06688b923dede90a8b55f73283f9b765f932e678.jpeg)  
You have to use dollar sign. hope it works

---

<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 2, 2019, 8:22pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/60 "2019-09-02T20:22:26Z")

</div>

Don’t know what I did wrong, but now it is working. Thannks very much for the fast response!

---

<div class="post-metadata">

**Author:** ![piotro](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/piotro/32/27212_2.png) [@piotro](https://community.homey.app/u/piotro)\
**Post date:** [October 7, 2019, 6:04pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/61 "2019-10-07T18:04:18Z")

</div>

Hello everybody,

I am setting the BL string var in homeyScript, but it does not work due to “/” char.

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/2/1298bbb332db44967db0ec3c17cccd9868a1a2fe.png)

console.log gives:  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/1/11510c2f2a02b0c60836fbb473c5cc112d49028a.png)

but the BL variable RandomMusicURL is not updated.

I found out that all works as expected when removing “/” sign from the string. But / is not an escape char, so what’s wrong here?

---

<div class="post-metadata">

**Author:** ![Edgar](https://avatars.discourse-cdn.com/v4/letter/e/b487fb/32.png) [@Edgar](https://community.homey.app/u/Edgar)\
**Post date:** [December 22, 2019, 10:50am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/62 "2019-12-22T10:50:33Z")

</div>

I am also looking for the answer to that question. Do you already know it?

Or maybe somebody else?

---

<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:** [December 22, 2019, 5:29pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/63 "2019-12-22T17:29:55Z")

</div>

let BLApp = await Homey.apps.getApp({id:“net.i-dev.betterlogic” });  
BLApp.apiPut(‘Klok12h/’ + theHour);

---

<div class="post-metadata">

**Author:** ![PEAR7777](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pear7777/32/12956_2.png) [@PEAR7777](https://community.homey.app/u/PEAR7777)\
**Post date:** [January 18, 2020, 4:07pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/64 "2020-01-18T16:07:30Z")

</div>

Great app, would like to see a figure at the number slide device?

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

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