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

Hi Arie,

I have created a ticket here: QlusterIT / nl.qluster-it.BetterLogic / issues — Bitbucket about Last Set value. It would be fantastic if you could implement this as it would be almost like a SQL table with a name, value and updated-field (compared to Homey’s native variables). :clap:

Thank you Peter, you always have good advice, but AVD is a bit too advanced for me right now, I’m struggling even setting up a “Badge” with a power-price label ha ha…But thanks! :grin:

1 Like

Thanks, and yes, when i have time, energie and sleep more than 22 hours since last Tuesday, i will implement a card that will allow you to retrieve any “metadata” about the variables. :wink:

No rush Arie, not trying to stress you - sometime in the future would be great! Love your apps by the way, super-valuable! :star_struck:

Hello,

I have used the below flow for years now, but before migrating to a Homey Pro 2023 I need to convert the flow to another flow, without the use of HTTP request flowcards. The flow still works, even with the newest BLL, but I don’t see how I can convert the flow with all the variables at this moment. Do I need a BLL function?
Please help me with some example.

I think this is the way, Marco, but you’ll need to create an Advanced flow.

Then you can use one of these “Then” logics cards:
Screenshot from 2023-05-28 22-42-55

EDIT The example flow is wrong
This is the right one

Example flow:

I think this is what you would want.
You can do it with buildin flowcards, but i am using JSON handler app because you need way less flowcards:

Before the first flowcard, you would need the MQTT message recieved card. I am using a tag as example, because i don’t have MQTT.
Also, i am unsure what type is CO2, IAQ or GASres, i have asumed a number, but you can pick another type:
image

1 Like

Thanks! I found them, did not expect to only find these Logic cards in Advanced flows, while I was searching in standard flows (inconsistent choice from Athom), cards are not that special.

Your second post is probably also possible.

Converted to AF and it works. I have now this:

Thanks again!

Hmm, it does not work yet, result is empty, the value is not read from JSON and not put into the number logic. SO the logic is not updated with the last value.

JSON sample read from MQTT and is printed in Simple log to check:

{“ClientID”:“KT2-Sensor-01”,“Date”:“29-05-2023”,“Time”:“12:18:47”,“CO2”:913,“Temperature”:23.94,“Humidity”:49.45,“Pressure”:1027.53,“IAQ”:84.54,“VOC”:1937,“GASres”:1937}

$.CO2 should read the argument, right? Its the 4th variable in the JSON content.

Where you have the Read JSON and SET cards, you are setting the Paths and than you fill the value with the existing TAG:
image
This card is ment to fill a JSON with values, not read the JSON.

You would need the READ and SELECT cards:


and than use the Tokens from that card to put it into a variable or send it to the log.

1 Like

OMG, difference in text is so little :blush:

But it works now, thanks again!

Ah, I made a little mistake :grimacing:
Ofcourse, one has to set the variable with the result of the Logic ‘parse … as JSON’ card indeed, like Arie alr pointed out.

Earlier I already made a working example, but “remembered it wrong” (like a Dutch politician would say :rofl:):


This saves a lot of ‘Parse … as JSON’ cards’ indeed Arie. Thanks!

1 Like

Yes it is, use kk:
image

1 Like

I apologize for my lack of understanding how to use BLL…
I have set a variable to the date and time something occurred, but then when I try to use that variable (in a Telegram Bot response), I get this error. What am I missing? The variable ‘VVB70Grader’ exists in BLL and has the right value/text.

The flowtoken error says it’s a default Homey Logic variable.
Is there any change you first created a default Homey Logic Variable called VVB70Grader, and thant changed to BLL?

Remove the VVB70Grader tag and reselect it from the BLL variables?

because flowtoken homey:manager:logic:*** has nothing todo with BLL, so somehow, it doesn’t see this as a BLL token.

Edit:
And please share the whole flow, because i don’t see any BLL in it currently :wink:

Thanks for replying. I think my Flow was trying to access a regular variable that I had deleted, that had the same name. When I reload the Flows, that same variable name is now “not available”…
Let me rephrase my noob question then: what is the proecdure to get BLL variables out from BLL and into other flow cards (for example a Telegram Bot flow card)?

Indeed by using a tag, but please show the whole flow so i can advice better :wink:

Okay, here is my flow to set the variable:

The variable in BLL:

And the flow I want to access it in, but now I am unable to find the variable, it does not appear to exist outside BLL, hence my question how to get the variables “out from BLL”…

The bottom card, is that the set variable to BLL Expression card?
If so, remove the {[ and ]}.

And, in BLL remove the variable once, because it says type is Object, that should not be, Object is not a type, and i am not sure how it is created that way.
It should say string, and then there should be a token for it.

You can than Add a string variable yourself with the name VVB70Grader.

Thanks - everything works now! The problem was that I thought the BLLExpression in the BLL Expression flow card should contain {[ and ]}.