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

@Arie_J_Godschalk

Currently Telegram does not pas STAR * or UNDERSCORE _ or BRACKET [.
To pass all characters I would like to know how I can best do a text replace in a string or text variable.

  1. Replace all STAR * with \*
  2. Replace all UNDERSCORE _ with \_
  3. Replace all BRACKET [ with \[

Example Telegram notification
Error: _app_not_valid; The multiplication of 1000 * number does not work, try again. The temperature is now 11,2 °C. {flow #APP_Test} [end of message]

Option BLL Expression
I could not find it.

Option BLL Library
I refer to the solution proposed by @Patric_Hedin in this thread.
It does not apply to my Telegram requirement, but maybe it shows the way.

Option HomeyScript
I am not sure this is the right way. Will HS allow me to pass any length of string with many different characters, edit it and then output it? Maintaining a HomeyScript for this seems tedious.

1 Like

Also happens for me on a regular basis, need to restart the app several times a week now.
Is there hope for a fix ? using one the early homeys 2016-2019
Thank you for the great app

Hi,

I am trying to set a timer with a slidebar to choose the value.
I created, under the “better logic library” configuration, a variable of type “number” named “timer Maëlys”.
I then added a new device, clicked on “better logic library”, chose “NumSlide” and defined min to 0, max to 30 and step to1.
I can now use a slidebar to define the variable which is great.
However, when moving the slide it displays a percentage (from 0% to 100%) instead of displaying the value, which is not convenient.
Furthermore, when I release my finger, it displays 1500% and an error message:


At the end, the value is correctly set, to 15 for example if I choose 50%. However it is not very convenient…

Am I doing something wrong ?

Please send a diagnostic after you recieve this error. Thanks!

@Arie_J_Godschalk

Quick (noob) question.

I’ve got the following BLL in my flow:

And the result is here: 23.397,244

But Google Sheets does not like the dot when creating reports. What format should I pick to get the desired output: 23397,244

Thanks lots!

Hey @Pairis ,

I have just added a StyleOption2 for Decimals.
Update to the latest/current live version, and you can pick: No Grouping as option, resulting in:
image

2 Likes

You’re awesome! Thanks

1 Like

Hi

I modify a BLL Variable with math.format to have in all case 2 digits after the comma (even it is a zero at the last position)
e.g. 24.5 modified to 24.50 or is more than 3 digits long 24.125. to 24.12

In the BLL App the Variable is shown like it should (e.g. 24.50), but If I use that variable in a flow the zero is not available
I need 2 digits for the http-post request, in all case it must be 2 digits after the comma. Otherwise my heating control will not akcept the request (Don’t ask me why )

So what can I do ? Bug ?
I don´t know zero as the last number after the comma as no effect but I need it.

Attached my flow, perhaps somebody has a solution.
The real room temperature has to be a multiple of 0.125 but must be in all case 2 digits after the comma. So only a problem with 0.5. and no comma numbers there I need the an additional digits

Editing the Value in the app, the zero will be not accepted, just possible through the math.format expression in the flow.

Thanks for your help

I hope I got you right, so this crossed my mind:

I think the key is to save it in a string variable, while numbers in a stringvar cannot be changed without overwriting it, and you can use a string variable in the HTTP - POST request card.

And instead of the calculation, you could use the “Format number as style” card, with these settings:
style: “Decimal”,
style option 1: “Compact Long”,
decimals: 2,
locale: English (to keep the decimal point in your temperature value)

1 Like

Indeed, you need to use a String/Text variable if you want to format it.
(Or use the Number flowcard to generate a temporary string/tag)

1 Like

Thanks I will try

Just another short question :wink:

If I have just a Url e.g http://external system/id/“#Variable” as external entry point how I can realize this with Advanced flows or must I use Homeyscript ?
I just found the http request (post, get,) card. I just want sent a “simple” generated URL
Can you provide a simple Homescript example if it is not possible with advanced flows?

A lot thanks for your support

Do you mean the same as in this topic?

Thanks
I got it. It is working

I tried several times since my message but I could not reproduce the issue. I guess I created the timer on my laptop and was using it on my smartphone without a proper refresh of the app.
PEBKAC…
Sorry
However, it still prints a percentage. Would it be possible to make it print the actual value instead ?

Im sorry, i dont fully understand what you are saying.
Could you explain it some more?

Sure, I want to configure a slidebar to choose the value of a timer.
I created, under the “better logic library” configuration, a variable of type “number” named “timer Maëlys”.
I then added a new device, clicked on “better logic library”, chose “NumSlide” and defined min to 0, max to 30 and step to1. The goal is to easily set up a timer from 1 to 30 minutes.
I can use this slidebar to define the variable which is great.
However, when moving the slide with my finger, it displays a percentage (from 0% to 100%) instead of displaying the value, which is not convenient.
I know that 33% will mean 10 minutes, but it is not very comfortable :slight_smile:

Well, to be honest, i would actually advice you to create an Advanced Virtual Device from the Device Capabilities app.
You can customize the field way more.
And only one extra flowpart needed: when the avd.numberfield has changed, set bll variable.
For the rest you can use Reflect for bll variables to update the AVD field.

Like create a Numberield with slider and just configure the step, min, max, title etc. yourself.

Very interesting, I will have a look. Thanks :slight_smile:

@Arie_J_Godschalk

I think this is a bug or inconsistency in the flow card “Execute as tag”.
As per the example in the OP, I entered the below in the card and it gave an error.
When I enter the same in another flow card “Set variable to text”, it works.

It seems that the flow card Execute as tag does not accept non-BLL expressions followed by a BLL expression.

The last one is: {[ _.last([“1”, “2”]) ]}.

image

Well, it’s a direct Expression card.
BLL coding is an BLL expression within brackets to be used within text-arguments.

The Expression cards are for the direct expression, giving it the possibility to return any type of tag, like text, boolean or number.

I could perhaps check if the there is coding within a used expression card, and if so, eun it as text with BLL codings inside.
But then you would not be able to retrieve a text-tag with coding inside anymore.