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

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

Hi, great app thank you. I need to understand better what is exactly “Variable is set”. Does it mean that the value of the variable is True? When does this flow trigger then? Thanks for explanation.

FYI i have two variables Hot and Cold. But if I put two flows one “Variable is set Hot” second with “Variable is set Cold” (and in other flow it could be only either Cold or Hot listening to themperature) it seem the change of variable stutuses for both between True/False triggers both initial flows “Variable is set Hot” and “Variable is set Cold”. So I dont get it why it triggers them both if I have value “Hot is tru” and “Cold is false”.

1 Like

Updating homey pro to 7.2.1 removed all my better logic variables.

Now what?

1 Like

Oww
 I didn’t hear about that one yet.
Try to restore a backup from before the update?

1 Like

For me the update worked without issues.
If you have a export of the variables you can import them again.els you need te recreat them.

1 Like

I don’t know if this script still works

2 Likes

Phew! Did a restart of the app and all the variables came back. That was good news.

4 Likes

Hi,

Bug? No more trigger on tags?

Want to start a flow when a tag changes (weather: outside temperatur from homey).

Has someone the same Problem? Or a workaround with another app?

Thanx!

Stefan

1 Like

That has no relation with Better logic, and it is no bug.
That particular tag is (unfortunately) just not available in triggercards.

Workaround: create Text and Numeric Logics variables, and let them be filled by the outside Weather / Temperature from Homey, by a timer

1 Like

Thanx Peter,

why is this no triggercard for tag temperature? Just for me to understand :wink:

image

1 Like

The Better Logic triggercard works with Better logic variables, which names should be entered by hand.
Screenshot from 2022-10-10 16-10-31

And the Homey Logics card “a variable has changed”, works with Homey Logics variables. The Homey weather, or any apps tags are available. Hence the workaround I showed.
(The workaround can be created with BL as well, but I don’s see a reason why)

2 Likes

Wiht BL and the triggercard you like, you’d create something like this:

1 Like