This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.

The Homey Community has been moved to https://community.athom.com.

This forum is now read-only for archive purposes.

[APP] Better logic / Variable management

11920212325

Comments

  • Drag the tag into the speech card. In the flow section u have a tag section on the top of the page. Scroll down to the better logic department and find ur tag there. Drag it into the speech card in the very right colom.
  • Is it also possible to add a color-type to the variables? Currently I have some LED-strips with homemade controllers and I can control them by sending a HTTP-request to a server and it would be nice if I could have a color wheel to select the color. At the moment I have three variables per group of 4 strips for each part of the color (R, G and B) and I had to create 4 flows to control the strips: 3 for when the number variable changed and 1 to update the strips. With 2 groups at the moment, this required 8 different flows. When I want to control each strip by itself, this would require 32 flows!

    It would be great to have just a color wheel in the app to set a single variable which contains 3 values. I hope this is possible.
  • As requested by Patrick.
    Starting from firmware 1.2 0-rc8 my motion detection flow is running while the lights are on and lampen aan boolean is true
    Using version 0.9.10 of betterlogic

    Motion detection:


    Lights on: General flow which can be activated from many flow by using "zet aan" card 


    Lights off: General flow to switch of the lights
  • wingie said:
    As requested by Patrick.
    Starting from firmware 1.2 0-rc8 my motion detection flow is running while the lights are on and lampen aan boolean is true
    Using version 0.9.10 of betterlogic

    Motion detection:


    Lights on: General flow which can be activated from many flow by using "zet aan" card 


    Lights off: General flow to switch of the lights

    Did you copy paste the variables? Or selected them from the dropdown? 



  • wingiewingie Member
    edited March 2017
    Can't remember made these flow a while ago and they have worked perfectly untill 1.2. Can try to alter them this evening as a test.

    Edit: just changed all flows and made sure that i selected them from the dropdown, but my homey also updated to rc9. Will find out this evening if the behaviour is still the same 
  • UrandayUranday Member
    edited March 2017
    Let me know. For me a same kind of flow seems to work. 
  • @Uranday I'd like to expose the BL timestamp to my flows, so I can use it in flow logic. For example, timestamp is more than 5 minutes, trigger flow. Can this possibly be added? It would make for a really useful extra IMHO.
  • Is there a way to convert seconds into hours, minutes and seconds? For example 3732 seconds = 1 hour 2 minutes and 12 seconds.

    I created a flow with tasker and Google maps which tells my GF in how much time I will be home and "Jesper is home in 1 hour 2 minutes and 12 seconds" is better to interpreted as "Jesper is home in 3732 seconds". Furthermore, I could update the remaining travel time every 15 minutes and every time when my GF asks Homey when I get home it will directly give an answer instead of waiting untill my phone found it's Location and went through the tasker actions to send the update to Homey (which could take up to 2 minutes).

    Conversion into whole minutes would already be a huge improvement as well.

    And hopefully @swttt will include the option to view the value of variables on HomeyDash in a future update of his app.

    Thanks a lot for your help (and if somebody want to see how my flow(s) for this work just let me know)
  • Is there a way to trim a variable? For example:

    I want to say: Ok Homey, add "cheese" to the grocerylist. I want to trim the words: "add, to, the, grocerylist" so that only cheese gets on the list... I use an email subject to add the text into my grocerylist.



  • tcarnaltcarnal Member
    edited May 2017
    Hi Patrick.

    just started to work with your Better Logic and the possibilities are awesome.
    But i just ran into a problem.

    maybe im doing something wrong but i have certain single word strings defined and made a flow that receives a message with Telegram.
    upon that flow i have multiple "and" Better logic strings with "Text Contains" but its not able to identify the words



    you can see with the test i use the words but it fails at the first one.
    i have checked if the strings have been made correctly and it looks oké.
    when the tekst is just one wordt and the "and" part has only that word string it's fine
    but when the value of tekst is becoming longer its failing

    the "text contains"  handles like an "is exactly"

    the logic of athom does handle this but i like your version much better

    thx 
    Thijs

  • You can use the build in logic for this flow. What I understand is that Better Logic, only works with Better Logic variables. The variable you are using in this flow isn't a Better Logic Variable.

  • tcarnaltcarnal Member
    thx for the clarification
    Makes sense

    Lets make it a feature request for Better Logic to be able to include external variables in the flow its been used it.
  • Is it possible to create a OR function with Better Logic? I would like to check if a variable contains the text "clear" OR "partial" and if true flip a boolean.
     
  • OetAelse said:
    Is it possible to create a OR function with Better Logic? I would like to check if a variable contains the text "clear" OR "partial" and if true flip a boolean.
     
    You can do this with the mathjs card. 



  • So if the Better Logic variable I want to check is called "status" the expression should be 
    $status$ = "clear" or $status = "partial"
    Is this correct?
  • Solved my previous question by using integers instead of strings.
    Now i want to store time like 11:30 in a variable and use this as tag in a flow, is this possible?
  • JPeJPe Member

    crash V0.9.11 direct after update: also a restart gives directly the error:
    Stack trace:

    SyntaxError: Unexpected token {
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object. (/app.js:3:23)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)

    Exit code: 1
    Exit signal: null

    https://github.com/PatrickSannes/BetterLogic/issues/11

  • B3rtB3rt Member
    i confirm, after (auto) update better logic does not start anymore and immidiatly crashes

    SyntaxError: Unexpected token {
        at exports.runInThisContext (vm.js:53:16)
        at Module._compile (module.js:373:25)
        at Object.Module._extensions..js (module.js:416:10)
        at Module.load (module.js:343:32)
        at Function.Module._load (module.js:300:12)
        at Module.require (module.js:353:17)
        at require (internal/module.js:12:17)
        at Object.<anonymous> (/app.js:3:23)
        at

  • glijieglijie Member
    edited June 2017
    Yep here the same

    Stack trace:

    SyntaxError: Unexpected token {
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/app.js:3:23)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)

    Exit code: 1
    Exit signal: null
  • rtnartna Member
    Also crash over here directly after auto update. Much of my flows depend on the app so this is not a good thing.
  • Same here, lots of flows dead after the update to 9.11 :(
  • arthurarthur Member
    Same crash here as well
  • Same for me.

    This is the stack trace:

    SyntaxError: Unexpected token {
        at exports.runInThisContext (vm.js:53:16)
        at Module._compile (module.js:373:25)
        at Object.Module._extensions..js (module.js:416:10)
        at Module.load (module.js:343:32)
        at Function.Module._load (module.js:300:12)
        at Module.require (module.js:353:17)
        at require (internal/module.js:12:17)
        at Object.<anonymous> (/app.js:3:23)
        at Module._compile (module.js:409:26)
        at Object.Module._extensions..js (module.js:416:10)

    All my flows with better logic are broken. Hope this can be fixed ;).

  • can we downgrade?
  • casedacaseda Member
    Issue has been found and fixed, should land in the app store pretty soon.
  • Fix is already pushed to athom. Will discuss witht hem to have a fast release. If you want to update you better can do this via the dev tools.
  • jjtbsomhorstjjtbsomhorst Member
    edited June 2017
    @Uranday thanks! Just installed it via dev tools and it seems to be working
  • LJSVVLJSVV Member
    Why does it take so long before this app goes live in the Appstore?

    A bunch of flows are dead.....
  • Update is finished. Took a bit longer because I was afk
  • 0.9.12 works like a charm! 
Sign In or Register to comment.