[APP] Better logic / Variable management (v1.0.4)

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

1 Like

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:

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 !

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

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 !

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:

Oky, thanks Peter !

1 Like

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?

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

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?

Try

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

@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?

@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: ?

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”.

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

Now what?

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

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.

I don’t know if this script still works

1 Like

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

3 Likes