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

Hi all

Is there a way to make a "if difference between A and B is more than insertvalue ?

I’m setting up two temp sensors for my house and want to try some stuff.

vkr
victor :slight_smile:

Use the MathJS card.
Might need to add the OR to check 2 calculation if one gives you a negative value
((A-B)>insertvalue) or ((B-A)>insertvalue)

what do you mean with "check for negative?
I don’t quite get it. insert value will make the variable this or? how would it work?

You would like to check if the difference between your two sensors are a certain value correct?
You can use the mathjs expression is true card in the AND slot.

The example I gave may give a negative value if the first sensor gives a lower value than the second sensor in the equation. Ie a 19c and 26c temp reading will be -7 and 7 in the respective equation.
If your insertvalue is 5, the -7 result will still be true when it checks if the result is <5 and that’s not desired. So the correct equation should be
(((A-B)>*insertvalue*) and (a-b)>0)) or (((B-A)>*insertvalue*) and (b-a)>0))

The insertvalue can be a number you type in or a global tag.

Hi!

I have problems with Better Logic and have not been able to get help.
I enclose pictures of the error message and the flow. It is a total of 3 flows.
When I try to share the flow. I only get an error message. As you can see, it applies to all three flows. I also attach a picture from Better Logic.
I do not know and have not been able to get an answer if there is a fault with Homey or Better Logic.
The flows work as they should!

I think that Homey doesn’t like the spaces in your variable names. If that doesn’t solve the problem, also try removing all accents from characters.

robertklep
I have other flows with swedish letters and space in the name without problems!
But now I have tet to write the flows without swedish letters and space. And you can see it is the same!
That answer I get from the Homey support was they think its any messes with the code of the better logic app?
That is why I write here either for help or for anyone who knows the code for better logic to see if there is anything wrong

When exactly do you get that error? When you test the flow, or when you just open the flow in the editor?

Ah, I can reproduce the problem when you try to share the flow. You should ask Athom’s support where app developers can find any guidelines to prevent these issues (hint: there aren’t any! I have to conclude that this a bug in Athom’s “share” code).

Below you can see the answer from Homey support

Hi Hans,

Thank you for reaching out to us. Unfortunately, Better Logic is an app that is developed by a Community Developer, and I cannot offer detailed support on this. Having stated this, looking at the error message and screenshot, I suspect that there is a . somewhere in one of the variables used in this flow, which messes with the code of the Better Logic app.

Please check this, and if it is the case, try to contact the Developer of the Better Logic app, as I cannot help you any further than this when it comes to this app.

I trust that this answers your question, even though I might not be able to help you to a point that actually solves your issue. I’m closing your ticket as I cannot help you beyond this point.

If you need additional support regarding Homey, please feel free to re-open your ticket by answering this email (or add the question in your other ticket).

I wish you a great day and a lot of fun with Homey!

Best Regards,

Boaz

The Athom support team.

Have you explained clearly to them that this problem occurs when you try to share the flow? It’s not an error that occurs in the Better Logic app, it’s an error that occurs in Homey’s “Share Flow” system.

You can see what I wrote below. For me, it’s crystal clear. :slight_smile:

Hi!

I have problems with Better Logic and have not been able to get help in the group.
I enclose pictures of the error message and the flow. It is a total of 3 flows.
When I try to share the flow. I only get an error message. As you can see, it applies to all three flows. I also attach a picture from Better Logic.
I do not know and have not been able to get an answer if there is a fault with Homey or Better Logic.

Yes, Boaz makes assumptions without actually reading your question or testing it himself :roll_eyes:

What do you think I should do now?

You can try and explain to him yet again that it happens when you try to share a flow, and that it’s not an application error but a Homey system error.

Literal text that you could use:

"
Boaz,

The error happens when I try to share any flow that uses a Better Logic token. The error is not generated by the Better Logic application (whose code doesn’t even contain the particular error message that I’m getting) but somewhere the Homey infrastructure (in fact, it looks very much like a MongoDB error, which definitely isn’t part of Better Logic, but very likely part of Homey’s “Share” backend system).

Others can reproduce the problem as well.
"

Thank You very much!

If you can send images as part of your support request, I wrote a proof of concept that will trigger the same error as with Better Logic:

This is the code I used to reproduce:

new Homey.FlowToken('foo.bar', { type : 'string', title: 'foo bar token' }).register();

EDIT: also happens when you don’t use periods in the flow token id:

new Homey.FlowToken('foobar', { type : 'string', title: 'foo bar token' }).register()

So something is fundamentally broken in Homey’s backend system.

It has been brought to the attention of Athom’s development team, and they will fix it :+1:t2:

1 Like

How nice!
Did you contact them too?
I saw this morning that you wrote your test code. I sent it to Boaz, this morning.

I contacted them through Slack, they confirmed the issue and said that it will be solved. No timeline on when, though, but I assume soon.

That’s nice!