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

Ah, I missed that detail obviously! :face_with_spiral_eyes::face_with_peeking_eye::rofl:
I think I never understood the functionality of this card, and forgot about it’s existence (sorry for that).

And when using the expression card for whatever reason, it’ll just needs backticks for this to work.

True, but tbh, single quotes or double quotes should work to afaik.

Anyway, using the expression card for this is kind of a waist for performance. The string is already combined/finished by the default homey way of inputting text with tokens, and running the javascript engine to just return it as string/text is not needed.

I do like that backticks work like this though :face_with_hand_over_mouth:

Hi all, I’m stuck and hope some people much cleverer than me can help.
I have a FIFO buffer for logging to Google Sheets. Sheets is quite finnicky about rate limiting so I built a rate limiter which feeds my log lines slowly to Google Sheets. This works well although it’s overly complex and I’m trying to simplify. This is where I get stuck. I have a function in BLL:
function(s) {
let a = s.split(ā€˜|’);
return {gesplitst:a};
}
I then have a card


which takes the input from variable bll.arr.ratelimit.queue:
[ā€œKoelkast|02-dec-2025 23:40:07|721.31|35||||||ā€,ā€œWeer|03-dec-2025 00:00:00|Bewolkt|100|1010|4.8|6.6|88|⇑ ZZO 2|9ā€,ā€œVerbruik|03-dec-2025 00:00:00|335|31574.116|5806.75|0|0|3||ā€,ā€œBadkamer|03-dec-2025 00:00:00|45.4|22.5||||||ā€,ā€œKeuken|03-dec-2025 00:00:00|58|20|2|159||||ā€,ā€œNatte ruimte|03-dec-2025 00:00:00|45.3|22.5||||||ā€,ā€œZolderkamer|03-dec-2025 00:00:00|53.9|21.1||||||ā€,ā€œWerkkamer|03-dec-2025 00:00:00|47.4|21.4|47.4|21.4||||ā€,ā€œEnergieprijs|03-dec-2025 00:00:05|03-dec-2025|2025-12|0,1|0,34|0,2631|0|0|ā€,ā€œHoofdslaapkamer|03-dec-2025 00:00:00|49|20.7||||||ā€,ā€œHal|03-dec-2025 00:00:00|50.7|21||||||ā€,ā€œTuin|03-dec-2025 00:00:00|24|11|36|0|60|0||ā€,ā€œWoonkamer|03-dec-2025 00:00:00|17|18.8|6.6|9|0.0050000000001091|||ā€,ā€œKoelkast|03-dec-2025 00:00:28|721.32|33||||||ā€]
and peels off one item such as [ā€œKoelkast|02-dec-2025 23:40:07|721.31|35||||||ā€] and then feeds the result {ā€œgesplitstā€:[ā€œKoelkast|02-dec-2025 23:40:07|721.31|35||||||]} to JSON Handler:

This is then ready to be logged to different columns in Google Sheets.

So this all works great, but I want to get rid of the BLL function since it’s hard to maintain, troubleshoot etc. So I’ve been experimenting with HomeyScript cards (but they don’t do objects or JSON as tag, only text/boolean/number, so that won’t work with JSON Handler) and BLL cards Execute BLL Expression (as tag) and Execute text (as tag), but whatever I try, I get identical-looking output but JSON Handler keeps saying
Missing token value: action::87796ea1-afd6-45f9-8c29-f71f07a1d6c6::text

How can I get JSON Handler to play nice?

How do you re-use a BLL-variable? I can set it, but I’ve tried everything I could think of, but I see no way to use one in a calculation. If I have for example VarName than the following don’t work: VarName, ā€œVarNameā€, $VarName, [VarName], {VarName}, [{VarName}].

See the screenshot for example

EDIT: found it, if you press the ā€œtagā€ icon they can actually be found and added…..

How do I save a value from another app (Find Me) to a BLL variable?
Example: ā€œWhen distance from Home(y) in mi becomes less than ā€˜# tracker distance’ (a BLL numeric variable) Then set ā€˜# tracker distance’ to distance from Home(y) in mi. I then do a ā€œSend ā€˜# tracker distanceā€™ā€ to my phone.

The value I see in the ā€˜Send’ notification is 0.

FYI: I’m also posting this in the Find Me thread.

Normally you would use this flowcard:

In the Number placeholder you select the respective tag or input a number directly.

I tried the expression version with ā€œset var to {[round(var)]}ā€ but it errors with ā€œround is not definedā€.

What if you try: math.round(your_tag)?

Leave out the { and [ characters if you are using the BLL expression card, as they are not required in that specific card.

That works!!! Thank you so much.

Hello Guys,

Using Homey pro 2023 v 12.11.0 & better logic library 3.4.16, i see that some of my variables, even if they seem ok in BLL, are not displayed in the homey insight graphs.

In the picture joined as example, the 3 BLL variables are defined the same way, but only 2 are displayed.

Going in the application, i can see the values of the variables are correctly defined.

(The history of values is usefull for debugging my heating system)

Any idea on how to solve this ?

Thanks

Looks like the a value for the first variable was never set. Wat happens is you manually set a value for that variable via the BLL app?

In the app the values are all correctly defined !

ok forcing the value once’s in the app solves the problem.

Thanks for the idea :wink:

FYI: this has been solved in BLL update. The issue is Homey since hp2023 sends a checkbox/cross character instead of true/false.

Within BLL expressions, I replace those characters with true/false, so it works normal again.

Hi Arie,

at first thank you for your work here with these apps. I’m quite new to Homey and learning still. I have problem with BLL, it seems to crash frequently. I’m using in Docker, no cpu or ram limit. During night I backup Homey, for this the container is being stopped.

During the day I can find them BLL is not working anymore. I’m using it in Device Capabilities and Flows. I recognize this because BLL expressions are not calculated anymore in DC.

When I restart BLL in Homey then I can see immediately BLL running again. How long I can’t say exactly.

After backup when the Homey container starts I already tried a flow which restarts BLL after 6 Minutes, sadly no success.

What can I do?

Hi Avaatar,

Not a fix for BLL, but removing the cause can be considered a fix I think :grimacing:
There’s ways to backup without stopping the container:

Hi Peter,

thank you :slight_smile: Im using btrfs on Unraid on my cache where SHS data is stored. I was thinking over the snapshot backup too but I am honest, I didn’t look more deep into it. The backup and restore with Appdata Backup/restore works that great without any problems, I wouldn’t like to switch away from this :slight_smile:
I will try different things but keep your advise in my mind :slight_smile:

Thank you again.