Homey Community Forum

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

v2
app

#1

large

As many of you have noticed Better Logic is not compatible because of the missing settings screen. I started the sdk2 development a while ago and since V2.0 entered experimental it was time to finish it. This version is only available to Homeys with firmware v2.0 installed.

Aim of the port was to get everything up and running again. Currently containing:

Triggers

  • A variable changed
  • A variable is set
  • A number variable changed
  • One of these variables changed
  • Any variable changed (DEBUG)

Conditions

  • Text contains
  • Text starts with
  • Text is exact
  • Number is exact
  • Variable greater than
  • Variable less than
  • Variable is true/false
  • Math.js expression is true/false

Actions

  • Set string variable
  • Set number variable
  • Increment number variable
  • Decrement number variable
  • Execute mathjs expression
  • Set boolean variable
  • Flip boolean variable
  • Execute a trigger
  • Set a variable

Devices

  • BitFlip
  • NumSlide
  • Trigger

Links

History

  • V1.0.4

Bug: Slider was limited from 0 to 1
Bug: Fixed new variables only showing up after the app
Bug: Updated styling of numslide pairing page

  • 1.0.1
    SDK2 rewrite

#2

This is a compatible upgrade to the current app? Meaning when you install this app everything should continue working without the need to redo all your flows?


#3

That’s what we have to find out in the experimental release. Everything was developed using a separate app id to get every part up and running. When I moved everything back to the existing app id it loaded my existing variables.

There might be a possibility the numslide device might not be fully working as it used a device class that’s not allowed in sdk2 so I had to pick an other. But seems to be loading fine when I added one in sdk1 and uograded to sdk2.

There’s currently an homey issue with triggers so not yet fully sure if it completely works in v2.0. But the whole v2.0 firmware is in experimental for a reason, not everything is going to work from the start. But you knew that when you flipped the experimental switch :wink:

For the moment I’d say if you have to upgrade to homey 2.0 it might never hurt to do an export of your variables first :wink:


#4

I just posted the SDK2 release as beta. Now it is just waiting for validation. Many thanks to SailingDuck for the help!


#5

The beta app is in the appstore!


#6

Could someone point me to the place where I can find all functions of Better logic? I am looking for stuff like Round{{…}}

Searched but couldn’t find it, and the flow I used ‘round’ in, I have deleted :disappointed_relieved:


#7

@Eternity Is it not like http://mathjs.org/examples/index.html ?


#8

Checked the link, it is ‘similar’ :wink:

I am looking for somthing like {{round, var;2}} to change a variable from x,xxxxxx to x,xx


#9

Put variables between $ signs. These are not displaying here.
round(variableName, 1)


#10

I have a flow that rounds a random number between 1 and 5.
I had to use round(random(1,5)) so not {} but ()


#11

(round( WnkDimVal *100))/100


#12

This was what I did, and worked:

{{round (Energiekosten vandaag,2)}}

to round the variable Energiekosten vandaag to 2 decimals


#13

What card are you using?


#14

14


#15

And when u try it without the brackets?


#16

58

Works too :slight_smile:


#17

Ok cool. Because that’s what all say in the above posts.


#18

Confusing for me was that I had a calculation within a calculation. I have changed that… Anyway… all thanks for helping :slight_smile:

Have a great weekend!

[ JPe had a bracket too… haha (round( WnkDimVal *100))/100 :stuck_out_tongue: ]


#19

No curled brackets!!


#20

Just installed the beta app but i cannot seem to add any variables…
I push the button but is does not add the var to the overview :confused: