[APP][Pro] Better Logic Library - Just some better logic, variable and library management

The original message was very not correct…

@Dijker Geurt, now I see how your tags show as expected, and I can reproduce that.

As long as a BL or a native Logics var or tag resides in a BL card, it is shown ok.
BL var’s / tags within other apps’ cards, show a ? sign.

Screenshot of the same flow:

2 Likes

I have a simular problem and not sure how to solve it.

I want to start a flow using: One of these variables changed
I type in (for test) my logica values: gordijn_keuken_open, gordijn_terras_open
And in THEN i do something, tried send push and log etc

It simply does not work, also tried to select the tag cards but this also does not work.
When i test the flow then the flow works, but when the value changes nothing happens.

The logica values are all true/false logica values

Anyone an idea what i do wrong here?

1 Like

Don’t know without showing your flow :wink:
But, I tested with 3 values and it works.

  1. I Added 3 BL boolean vars:
  2. The flow starts with BL - One of these vars has changed.
    Here you copy/paste the var names you entered at step 1. with a , as divider.
  3. (Optional) At the AND section, add 3 BL - If True (or inverted) cards, 1 for each var. Now you select your var with the Tag icon button thing.
  4. Here’s my flow: https://homey.app/f/7tQg8z

4a. Only the tags don’t show @ action cards here (and no one believes this is a bug…). Screenshot of that:

  1. The result after altering every var from false to true and to false again

I hope it’s of any use @B3rt !

1 Like

i think i found the problem, i use Homey logic values on change, i suspect it only works with better logic values.

if that is the case then i can uninstall better logic because it has no use for me…

1 Like

This works also with Homey logics as condition:

Without BL you can’t use “If one of these values has changed” card
With Homey logics you have to build 3 flows for every “If a variable has changed” trigger…

1 Like

I made some simple flows to test the „One of these variables changed“ function, but it doesn’t work.

3 flows with Boolean variable like this

1 flow with a numeric variable like this

Flow with „One of…“ function. Output should be a message.

Sorry for the ?, but this is a bug. And for sure, I used the BL variables/tags.

So when I start/test one of the first 4 flows (= changing the variables!), nothing happens with the 5th flow. No message is shown.

EDIT: Roco find out that I did a mistake. I used the tags in the card „One of these variables changed“ instead of typing in the name of the variables.

1 Like

Just tested this with variable1, variable2, variable3
No problem at all.
Make sure u type the names and don’t use tags like the tooltip says.
Variable1,(space)variable2,(space)variable3

2 Likes

Hocus pocus, it works! :+1:t3:

Thanks @Rocodamelshekima!

I hate it when I make mistakes like that… :face_with_symbols_over_mouth:

3 Likes

So you missed point 2.? :crazy_face:

Although Roco mentions a divider should be [comma][space], a comma only as a divider works as well, as I just tested (but it looks awfull in the card…)

This looks better :wink:

1 Like

Hi Peter, hi all,

I would like to define a flow with Better Logic conditions, but I don’t understand how to set the text condition :

When Variable ‘Description’ changes AND Variable ‘Descritpion’ contains “clear sky” THEN …

See below :

I’m sure it’s really easy to do this but I do not find the solution :frowning:

Please could somebody help me ?

Thanks a lot !

1 Like

Hi Hervé
I hope this helps you a bit.
In the BL “text contains” card, you can select the variable at the (…). The text field, where you had selected the variable, should only hold the text which you expect to be stored in the variable

1 Like

Oh thanks Peter, I understand now ! I did not know that I had to define some BL variables first, si I could not add such a NaamVenDag variable :pleading_face:

I have 2 more questions for you, Peter :

  1. For this BL card, Is it possible to use Homey’s variables instead of BL variables ? I guess not but maybe there’s a solution for this …
  2. I’m trying tu use the Maths.js card but I do not undertsand how to write this. It seems my formula is wrong (the Description variables are from different apps even if they have the same names) :
    image

ICOuld you still help me, please ?

Thanks a lot !

1 Like

FYI, when using a BL “one of these variables has changed” card, you’ll have to type in the variable names, seperated by a comma. But only variables you created in BL can be used, not the variables provided by an app. Then Homey’s Logics is needed.
See

Okay, about the goal you want to reach. I’m guessing you try to catch a changed weather description here?
I use Openweathermap, and trigger the flow with “The weather has changed”.
Then, at the AND section, I add a Homey Logic card of the type “text contains”.
Now select the local variable “weather description” (=weersbeschrijving in Dutch), which is provided by the trigger card. In the web app it can be found under “This Flow” in the selection box.


Now enter f.i. “clear sky” as text.
You can add 2 more logics cards, with a different weather description of your choice. Make sure to drag the cards down, so “OR” appears between them.

In my example, the notification gets sent when the weather type is “clear sky” or “few clouds” or “whatever weather”.

As you can see in the Timeline notification card, Homey provides for a weather description too (“Beschrijving”), but I can’t find a way to monitor it for changes.

The BL math.js card can be used to calculate with numeric variables
The equivalent Homey logics card is called “calculate a value”
Examples:

1 Like

Oky, thanks Peter !

2 Likes

Hi,

How can I use the function “concat”?

For example, I would like to combine two numbers like 5 and 6. Not adding them up to 11, but using the function consat, so I get 56.

Or if I want to combine 5 and 6, but with a word in-between. For example: 5house6?

1 Like

https://mathjs.org/docs/reference/functions/concat.html

1 Like

Hi Peter,

Yes, I read that piece, but I can’t figure out how to use it.

I got a little further. Using the Mathjs card I use:

concat(“5”,“6”)

And it gets written to a number BL variable. I can see it on the config-page, but when I want to send the value in a push notification, it returns a 0

Maybe something to do with the format of the value? Text or number?

1 Like

Try

number(concat(“5”,“6”))

1 Like

@Dijker

Yes, that works indeed! Thank you!

Is there a way to combine this with text, for example 5to6? And write the whole string to a BL text var.? And then you use the var. In, let’s say, a push notification?

1 Like

@Uranday Patrick, I’ve donated most of the apps i use. But i’ve forgotten one of the basic ‘Need to haves’ . Do you have paypal so i buy you a beer :wink: ?

1 Like