# \[APP\]\[Pro\] Better Logic Library - For developers

**URL:** <https://community.homey.app/t/app-pro-better-logic-library-for-developers/71761>\
**Category:** Apps\
**Tags:** app, homey-pro, logic, bll\
**Created:** [November 5, 2022, 11:51pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-developers/71761 "2022-11-05T23:51:41Z")\
**Posts on this page:** 16\
**Page:** 2

<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:** [February 28, 2023, 8:58pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-developers/71761/22 "2023-02-28T20:58:35Z")

</div>

Okay, update to version 0.6.10  
You can just await like before:

```auto
await BL.init({homey:this.homey});

```

Also the decode is the same, only an NPM update needed 🙂  
I am pushing BLL now, so everyone should be updated in 4 hours.

All changes are in the NPM package, so you can push when you want after updating the NPM.  
The don’t need the latest BLL for this to work correctly, since, when there is an error, it will just resolve and hide it, not raise an error or anything.

---

<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:** [February 28, 2023, 9:01pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-developers/71761/23 "2023-02-28T21:01:30Z")

</div>

### The betterlogiclibrary NPM package has been updated to 0.6.10

Update it in your app to make sure it works correctly on all Homey Pro’s.  
No other changes needed then to update the npm package for optional apps.

---

<div class="post-metadata">

**Author:** ![Heula](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/heula/32/31852_2.png) [@Heula](https://community.homey.app/u/Heula)\
**Post date:** [June 16, 2023, 4:31pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-developers/71761/24 "2023-06-16T16:31:22Z")

</div>

New chapter in my journey through some of your apps.  
Because I was experiencing some issues with Device Capabilities and Homey 2023 I made some adjustments to my AVDs. I have disabled the corresponding flows and have set all devices with reflection and response in the AVD.  
Now I run into a setting on some devices where I don’t yet know what to enter (I don’t understand it yet but hope to understand that soon).  
For example, with one of my Eufy sensors I have to enter a BLL expression and I’m stuck on that for now.

 ![Capture_975](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/e/ee7c7dfafdaf652fb40a0fbdc088ed35e835ea7a.jpeg)

What do I have to enter here and do I have to do something in Better Logic first?  
I see something with $vallue but I have no idea.

Thank you.

---

<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 16, 2023, 5:05pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-developers/71761/26 "2023-06-16T17:05:35Z")

</div>

> [@Heula](#):
>
> What do I have to enter here and do I have to do something in Better Logic first?

Well, you are setting a Textfield, but the capability is a Boolean (Contact Alarm).  
Either create a Yes/No field with those settings, so you do not need a BLL expression, or do you want some special text?

B:LL expression is required when the reflect capability is different then the Fieldtype.

---

<div class="post-metadata">

**Author:** ![Heula](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/heula/32/31852_2.png) [@Heula](https://community.homey.app/u/Heula)\
**Post date:** [June 16, 2023, 5:18pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-developers/71761/27 "2023-06-16T17:18:41Z")

</div>

The yes/no field was what I needed. No need for special text.  
Learned again today. 👍😉

Thanks.

---

<div class="post-metadata">

**Author:** ![janrikard](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/janrikard/32/34785_2.png) [@janrikard](https://community.homey.app/u/janrikard)\
**Post date:** [November 19, 2023, 1:54pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-developers/71761/28 "2023-11-19T13:54:48Z")

</div>

Hi @Arie_J_Godschalk

I needed to get the current hour as a tag so i started to build a app and added other things I thought could be useful for someone.  
I made a lot of flowcards.  
It looks like this

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/4/d42e4ccb77bb600c07501b15cd5685d4454de512.png)  
But i got problem that it showed 1 hour wrong and after reading a bit I read in a thread that you recomended using BLL.

Im not that good programmer in javascript so i was thinking you might include this feature in BLL.

Personally I only need the swedish hour so im fine with my app not published, but someone else maybe needs to do calculations on time or something.

/Rikard

---

<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:** [November 19, 2023, 2:36pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-developers/71761/29 "2023-11-19T14:36:24Z")

</div>

> [@janrikard](#):
>
> Im not that good programmer in javascript so i was thinking you might include this feature in BLL.

I think most options are already build into BLL.

You can use the BLL expression as Tag flowcard and fill it with, f.i:  
`parseInt(date('hh'))`

---

<div class="post-metadata">

**Author:** ![janrikard](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/janrikard/32/34785_2.png) [@janrikard](https://community.homey.app/u/janrikard)\
**Post date:** [November 19, 2023, 3:11pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-developers/71761/30 "2023-11-19T15:11:17Z")

</div>

maybe it is, but that gave me the time 12 hour off.

Im still not that good programmer to guess how that works.

thanks anyway

/Rikard

---

<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:** [November 19, 2023, 3:22pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-developers/71761/31 "2023-11-19T15:22:19Z")

</div>

@janrikard Ah, sorry, use capital HH, if you want 24 hour based.  
See the BLL app settings for all examples. 🙂

---

<div class="post-metadata">

**Author:** ![janrikard](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/janrikard/32/34785_2.png) [@janrikard](https://community.homey.app/u/janrikard)\
**Post date:** [November 19, 2023, 3:36pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-developers/71761/32 "2023-11-19T15:36:12Z")

</div>

thanks, that works for me.

I should se if i could solve this in my code so users can get this without you have to give personal support

/Rikard

---

<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:** [November 19, 2023, 5:34pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-developers/71761/33 "2023-11-19T17:34:23Z")

</div>

> [@janrikard](#):
>
> thanks, that works for me.

I can add a flowcard to retrieve date-parts as number.  
It wouldn’t need this many flowcards, just a pickerlist with all the date-parts that BLL supports.

---

<div class="post-metadata">

**Author:** ![janrikard](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/janrikard/32/34785_2.png) [@janrikard](https://community.homey.app/u/janrikard)\
**Post date:** [November 19, 2023, 6:06pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-developers/71761/34 "2023-11-19T18:06:47Z")

</div>

I would appreciate that and I think other users with even less programming skills could use it.

/Rikard

---

<div class="post-metadata">

**Author:** ![Johan\_Persson1](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/johan_persson1/32/48190_2.png) [@Johan\_Persson1](https://community.homey.app/u/Johan_Persson1)\
**Post date:** [May 13, 2024, 3:54pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-developers/71761/35 "2024-05-13T15:54:48Z")

</div>

HomeyScript (New Api) and Better Logic Library

Does anyone know how to read and write BLL variables using the new, latest Homey API?

Old code:

```auto
// BLL
var testStr = “1.01,1.02,1.03”;
let BLApp = await Homey.apps.getApp({id:“net.i-dev.betterlogic” });
log(BLApp);
BLApp.apiPut(‘TestStr/’ + testStr);

```

Script Error  
Type Error: BLApp.apiPut is not a function

Maybe it’s not possible. (Yet) 🙂  
Thanks!

---

<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 13, 2024, 6:29pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-developers/71761/36 "2024-05-13T18:29:48Z")

</div>

Please use the topic for Homeyscript testers, I would recommend discussing issues with topic starter Jeroen (Athom), and read the updated docs posted there, thanks!

> [@HomeyScript looking for testers](https://community.homey.app/t/homeyscript-looking-for-testers/109249):
>
> We are looking for some test users for the new HomeyScript version [HomeyScript | Homey](https://homey.app/en-nl/app/com.athom.homeyscript/HomeyScript/test/) that uses our new [homey-api - npm](https://www.npmjs.com/package/homey-api) library under the hood for new scripts. All old scripts will keep working and can be upgraded but it’s not necessary. To upgrade scripts the following guide can be followed. [Tutorial: Migrating deprecated scripts - HomeyScript (athombv.github.io)](https://athombv.github.io/com.athom.homeyscript/tutorial-migrate.html) This has been a pain point for some time since the web api docs have been for our new api but HomeyScript was still using the old …

But, while I looked it up already, this might fix it, Johan; it seems like `apiPut` has to be replaced by `put`

![Screenshot from 2024-05-13 20-27-12](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/d/6d58aaffa766e2f1a859b730979ff766cc00c40d.png)

---

<div class="post-metadata">

**Author:** ![Johan\_Persson1](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/johan_persson1/32/48190_2.png) [@Johan\_Persson1](https://community.homey.app/u/Johan_Persson1)\
**Post date:** [May 13, 2024, 9:46pm UTC](https://community.homey.app/t/app-pro-better-logic-library-for-developers/71761/37 "2024-05-13T21:46:04Z")

</div>

Ah, excellent!

Thanks!

---

<div class="post-metadata">

**Author:** ![bonaventure](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/bonaventure/32/79712_2.png) [@bonaventure](https://community.homey.app/u/bonaventure)\
**Post date:** [December 30, 2024, 7:46am UTC](https://community.homey.app/t/app-pro-better-logic-library-for-developers/71761/42 "2024-12-30T07:46:44Z")

</div>

HomeyScript seems not to “know” defined global variables, i.e.  
global.keys() and global.get(‘blah’) are not working.  
didn’t check set.

setting the variables in flows works.

Why?

[Previous page](https://community.homey.app/t/app-pro-better-logic-library-for-developers/71761.md?page=1)
