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.
Replace all STAR * with \*
Replace all UNDERSCORE _ with \_
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.
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
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:
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
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)
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?
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 ?
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
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.
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.
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.