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

13468925

Comments

  • Some good stuff there again. I'm gonna see if I can use this somehow to do something x minutes before sunset ... :expressionless: 
  • Phuturist said:
    Some good stuff there again. I'm gonna see if I can use this somehow to do something x minutes before sunset ... :expressionless: 

    Let me know how it works. 

  • Uranday said:
    Phuturist said:
    Some good stuff there again. I'm gonna see if I can use this somehow to do something x minutes before sunset ... expressionless 

    Let me know how it works. 

    It's actually quite simple to do this ... :smile: 

    The math.js function in the action card is $timenow$ + 84600 (where 84600 is one day minus half an hour). The other function checks every minute to see if this moment has passed and can then trigger any action.


  • So all that is needed to trigger something x time before a sunset/sunries, homey does not support such evaluations natively?
  • So all that is needed to trigger something x time before a sunset/sunries, homey does not support such evaluations natively?
    Not yet, Emile mentioned somewhere that it will be added in the future but there are bigger fish to fry first. For the time being this will give you the same functionality although a little more complicated.
  • Alternatively, use the delay option in the action card and set it to 23.5 hours.
  • Alternatively, use the delay option in the action card and set it to 23.5 hours.
    True, but this does not survive a reboot (which I have to do quite often on the current firmware .. :neutral: )
  • aloftaloft Member
    Those features will greatly enhance my motion sensor flows, where I now need 7+ flows to get a light on or off for N seconds based on movement. Thanks!
  • Its published.
  • Is it possible to "Get" a variable in the then column if I want to pass this in a message for example, even if I have not used this in then when column?
  • AndyWilde said:
    Is it possible to "Get" a variable in the then column if I want to pass this in a message for example, even if I have not used this in then when column?

    This is currently not supported in the homey firmware. Hacky workaround would be to assign with the mathjs library (assuming it is an number) to itself and then trigger a new flow on it that also triggers on setting a variable without changing.
  • I'm wondering (keep in mind that my Homey hasn't arrived yet, so I can't simply test something easy like this) the following:
    Since you can change a variable fairly easy via a web URL, is it also possible to request the current value of a variable via a web URL, to use that for different apps?
  • Yep, get support is available in de better logic api
  • Uranday said:
    Yep, get support is available in de better logic api
    Wonderful!
  • aloftaloft Member
    With the upgrade to 0.8.27 I sometime lose the variable overview in the BetterLogic settings. It happened twice now.
    After a reboot of Homey they are back. Anyone else experiences this?
  • Nope, and I've rebooted a few times since updating :)

    Do the variables keep working when the overview is gone? And which version of BL are you on?
  • aloftaloft Member
    edited April 2016
    Hmm, last reboot didn't help. Variables are not shown and it seems the flows are not working.  



    When using a card, it won't find the variables either.



    BetterLogic version: v0.9.2

  • Shouldn't have replied to this:




    So yeah, I have that too (now). Variable list empty, variables not responding.

    This .27 turns out to be quite the fun release!
  • aloftaloft Member
    In addition to not seeing variables, I also wasn't able to add variables.
    I un-installed the SoundBoard app, as that was another change I did after upgrading to 0.8.27
    After a reboot I didn't see variables, but I could add new ones... The old ones are still in flows, but not working.
    If I add a variable with the same name as a current one, that works, and the flow starts working again.

    Although not entirely sure it is related to the SoundBoard app, maybe there is a collision between those two apps somehow?
  • Let's ask @Uranday - he'll know :)
  • I will test later. This is weird. Maybe there is a braking change? 
  • aloftaloft Member
    I lost all BetterLogic variables again, without installing SoundBoard or other changes to the system... So it is not related to SoundBoard.
  • edited April 2016
    Whatever it is - it has a pretty big impact, I don't think I have a single flow that doesn't rely on a Better Logic variable.

    Athom, could you include BL in your next pre-release test cycle? It's pretty much part of the base image for most of us
  • Same her, no new additions and update to .27. All variables ar gone... And I can't add new variables. 
    Restarted and now I can Add them again, but all defined variables are gone.
  • aloftaloft Member
    Same her, no new additions and update to .27. All variables ar gone... And I can't add new variables. 
    Restarted and now I can Add them again, but all defined variables are gone.
    The variables that I re-added (for the most critical flows) went away again after 3 hours ( maybe sooner, but I checked after 3 hours), and again, unable to add them.

    Let the forum know if you have the same experience or that re-adding was a more permanent solution. 
  • In the chat I see other modules with this problem. It seems to be an global problem. 
  • That's sort of a bonus - at least it'll have some priority to get fixed.
  • I think I thought of a work around. I'll implement it tomorrow. I hope to speak upfront with athom about it. Instead of storing them in memory for fast reading and saving them to Disk I'll read also from Disk. This should prevent the loss of variables. I'll keep you all posted on an update. 
  • @Uranday, are the variables that where added in the past now completely lost or will your workaround bring them back again (I want to avoid having to re-add them all).
  • Not sure, yesterday I had to do some work related stuff at a customer. I hope I can see what the heck is going on this afternoon/evening.
Sign In or Register to comment.