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

<div class="post-metadata">

**Author:** ![wvduffelen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/wvduffelen/32/34133_2.png) [@wvduffelen](https://community.homey.app/u/wvduffelen)\
**Post date:** [January 17, 2021, 10:23pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/105 "2021-01-17T22:23:44Z")

</div>

I can fill it as number when creating it but I can’t set it in a flow… it’s the cost for one KWH to calculate my use of energy!

---

<div class="post-metadata">

**Author:** ![Edwin\_D](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/edwin_d/32/136417_2.png) [@Edwin\_D](https://community.homey.app/u/Edwin_D)\
**Post date:** [January 17, 2021, 10:40pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/106 "2021-01-17T22:40:14Z")

</div>

I would then still calculate everything 100 times higher and divide by 100 when appropriate.

---

<div class="post-metadata">

**Author:** ![wvduffelen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/wvduffelen/32/34133_2.png) [@wvduffelen](https://community.homey.app/u/wvduffelen)\
**Post date:** [January 18, 2021, 9:01am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/107 "2021-01-18T09:01:43Z")

</div>

Will try that! Thanks! Maybe it’s only possible in older versions because a saw an example in the ‘washing machine flow’ from @Rocodamelshekima

---

<div class="post-metadata">

**Author:** ![wvduffelen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/wvduffelen/32/34133_2.png) [@wvduffelen](https://community.homey.app/u/wvduffelen)\
**Post date:** [January 18, 2021, 2:47pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/109 "2021-01-18T14:47:10Z")

</div>

It didn’t work in the mobile app, but it did work on the Homey Web app!

---

<div class="post-metadata">

**Author:** ![Pieterv123](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pieterv123/32/13353_2.png) [@Pieterv123](https://community.homey.app/u/Pieterv123)\
**Post date:** [January 21, 2021, 9:06am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/110 "2021-01-21T09:06:11Z")

</div>

Just a question, how to make a variable timenow in milliseconds? (exactly since 1970)

---

<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 21, 2021, 3:33pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/111 "2021-01-21T15:33:45Z")

</div>

Try HomeyScript.

---

<div class="post-metadata">

**Author:** ![Twan\_Veugelers](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/twan_veugelers/32/129333_2.png) [@Twan\_Veugelers](https://community.homey.app/u/Twan_Veugelers)\
**Post date:** [January 26, 2021, 9:22am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/112 "2021-01-26T09:22:35Z")

</div>

is it possible to convert a logic variable **hour** into a(nohter) login variable **hour in decimals** so for example **13:45** would become **13.75**. Not sure how to do that.

---

<div class="post-metadata">

**Author:** ![peltsi51](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peltsi51/32/12564_2.png) [@peltsi51](https://community.homey.app/u/peltsi51)\
**Post date:** [January 26, 2021, 3:06pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/113 "2021-01-26T15:06:16Z")

</div>

Make following mathjs calculation every minute

number(#HH)+number(#mm)/60

and save it into a variable

---

<div class="post-metadata">

**Author:** ![Twan\_Veugelers](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/twan_veugelers/32/129333_2.png) [@Twan\_Veugelers](https://community.homey.app/u/Twan_Veugelers)\
**Post date:** [January 26, 2021, 3:27pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/114 "2021-01-26T15:27:53Z")

</div>

> [@peltsi51](#):
>
> number(#HH)+number(#mm)/60

Hi @peltsi51  
I have created this flow, but not sure what I do incorrect, but running in ends in an error; Unexpected end of Expression.  
[https://homey.app/f/cMtk-s/](https://homey.app/f/cMtk-s/)

---

<div class="post-metadata">

**Author:** ![peltsi51](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peltsi51/32/12564_2.png) [@peltsi51](https://community.homey.app/u/peltsi51)\
**Post date:** [January 26, 2021, 3:42pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/115 "2021-01-26T15:42:12Z")

</div>

Okey, the forum edit is deleting the dollar signs.

You should write

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

Noticed also that you use some variabletag in the calculation Zonsopkomst? Remove it. The number() function will convert the hour and minute values into number format.

---

<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 26, 2021, 4:21pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/116 "2021-01-26T16:21:18Z")

</div>

> [@peltsi51](#):
>
> number(#HH)+number(#mm)/60

He did forget to mention the curled brackets {{number(#HH)+number(#mm)/60}}

---

<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 26, 2021, 4:28pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/117 "2021-01-26T16:28:22Z")

</div>

> [@JPe4619](#):
>
> He did forget to mention the curled brackets {{number(#HH)+number(#mm)/60}}

U sure about that?

---

<div class="post-metadata">

**Author:** ![peltsi51](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peltsi51/32/12564_2.png) [@peltsi51](https://community.homey.app/u/peltsi51)\
**Post date:** [January 26, 2021, 6:20pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/118 "2021-01-26T18:20:55Z")

</div>

Yes in normal logic but I’m using better logic app

---

<div class="post-metadata">

**Author:** ![Twan\_Veugelers](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/twan_veugelers/32/129333_2.png) [@Twan\_Veugelers](https://community.homey.app/u/Twan_Veugelers)\
**Post date:** [January 27, 2021, 8:04am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/119 "2021-01-27T08:04:43Z")

</div>

> [@peltsi51](#):
>
> Noticed also that you use some variabletag in the calculation Zonsopkomst? Remove it. The number() function will convert the hour and minute values into number format.

Hi @peltsi51

The ‘Zonopkomst’ tag is the dutch version of SunRise. Which is the actual value I need. So at 00:01 I will run the flow ones, that transforms the SunRise time for that day to a real number.

By the way this works, with the current time, as you instructed. But I need to calculate that from a time in the Sunrise tag.  
 ![2021-01-27 09_11_16-Homey van Twan en Patricia](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/5/c5c431b687e77b6230e2880531a0b965763ee4da.jpeg)

---

<div class="post-metadata">

**Author:** ![peltsi51](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peltsi51/32/12564_2.png) [@peltsi51](https://community.homey.app/u/peltsi51)\
**Post date:** [January 27, 2021, 6:57pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/120 "2021-01-27T18:57:25Z")

</div>

Ahh. Misunderstood your question. Don’t have any idea how to do that.

---

<div class="post-metadata">

**Author:** ![Twan\_Veugelers](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/twan_veugelers/32/129333_2.png) [@Twan\_Veugelers](https://community.homey.app/u/Twan_Veugelers)\
**Post date:** [January 27, 2021, 9:36pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/121 "2021-01-27T21:36:56Z")

</div>

No problem. But why can’t I use them? I have seen earlier in this topic that tags are used. Or is the problem that the tag I’m using is a text tag?

---

<div class="post-metadata">

**Author:** ![OH2TH](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/oh2th/32/111414_2.png) [@OH2TH](https://community.homey.app/u/OH2TH)\
**Post date:** [January 28, 2021, 10:43am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/122 "2021-01-28T10:43:19Z")

</div>

Is it possible to create new variables to Better logic from homeyscripts?

---

<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:** [January 28, 2021, 10:52am UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/123 "2021-01-28T10:52:06Z")

</div>

If I am correct only using the BL api.

---

<div class="post-metadata">

**Author:** ![peltsi51](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peltsi51/32/12564_2.png) [@peltsi51](https://community.homey.app/u/peltsi51)\
**Post date:** [January 28, 2021, 3:33pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/124 "2021-01-28T15:33:24Z")

</div>

I think there isn’t any function in the better logic or mathjs that could divide the :-separated string into two variables. So you propably have to use homey script to do that

---

<div class="post-metadata">

**Author:** ![Twan\_Veugelers](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/twan_veugelers/32/129333_2.png) [@Twan\_Veugelers](https://community.homey.app/u/Twan_Veugelers)\
**Post date:** [January 28, 2021, 3:57pm UTC](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/125 "2021-01-28T15:57:00Z")

</div>

yeah, for now, I will run the calculation of sunrise at the sunrise time, and sunset the same. So for the next day, these times will be fine (more or less) the 1 or 2 minutes difference does not make a real large impact.

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

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