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

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

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

Also the decode is the same, only an NPM update needed :slight_smile:
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.

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.

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.

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.

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.

1 Like

The yes/no field was what I needed. No need for special text.
Learned again today. :+1::wink:

Thanks.

1 Like

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


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

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'))

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

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

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

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.

2 Likes

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

/Rikard

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:

// 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) :slight_smile:
Thanks!

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!

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

Ah, excellent!

Thanks!

1 Like