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

1151618202125

Comments

  • MarkSwift said:
    Howdy,

    Is it possible to rename a variable? I have over 50 of them now and really regret my naming convention :(
    No, this is not possible, because I cant alter the names in the cards... 
  • I have the same request as @MarkSwift for exactly the same reason  :s
  • I have the same request as @MarkSwift for exactly the same reason  :s
    Thank god we have cold and dark evenings with nothing better to do ;)
  • It would be a real life saver and avoid my OCD overloading me.
  • Uranday said:
    Fire69 said:
    Reboot didn't solve it.  Everything was gone...
    Had to remove the app, reinstall and import everything again.
    Recreating the lost variable worked now.
    Not sure what happened here. I hope I can reproduce this problem and see what is going on! Ill keep you posted!
    Thanks.
    Seems to be going ok now again, might have been a Homey-problem?
    Anyway, I do an export now regularly, just in case :)
  • Hi

    I created 2 variables, containing indoor and outdoor temperature.
    I want to do some calculations with it and store the result in a third variable every time one of them change.

    Lets say I want  TempIn - TempOut = TempDiff

    How do I do that ?

    Thanks
  • Hi

    I created 2 variables, containing indoor and outdoor temperature.
    I want to do some calculations with it and store the result in a third variable every time one of them change.

    Lets say I want  TempIn - TempOut = TempDiff
    Have something like that here... (only When... & Then... )



    ThermoSmart Changed =>  Then
    1) BetterLogic (BL):  NowTemperatureThS = = <Temp]
    2) HomeyLogic: NowTemperatureThS = = <Temp]
    3) + 1Second : BL: Execute Mathjs : round(($NowTemperatureNA$ + $NowTemperatureThS$)/2,1) to BL Var NowTemperatureLiving

    And a second flow that triggers on NetAtmo Temperature changed almost the same, with NowTemperatureNA and ThS exchanged...

    together they update an average temperature ;-)
  • Would it be possible to create cards that work with epoch values?

    I've created a feature request on gitub: https://github.com/PatrickSannes/BetterLogic/issues/4

  • I'm looking for some expressions to get hours and minutes, so I can store this in 2 separate number-variables, and the complete time in a single string-variable.

    So if the time is 16:57, I want the variable $Hours$ = 16 and the variable $Minutes$ = 57; and $TimeString$ = '16:57'

    How can I do that ?
    I don't seem to be able to make functions work, like
    getHours() -> $Hours$
  • Update is comming soon. Only the bitflip bug is work in progress. Once it is done ill release.


    V0.9.7
    * Feature: Add increment or decrement to API. Call 
    * PUT for increment: HTTP://HOMEYADDRES/api/app/net.i-dev.betterlogic/VARIABLENAME/i/VALUE  Increments the variable with the given value
    * PUT for decrement: HTTP://HOMEYADDRES/api/app/net.i-dev.betterlogic/VARIABLENAME/d/VALUE  Decrements the variable with the given value
    * Bug: Delete all insights on delete all
    * Typo: Change casing of boolean in the variable type dropdown
    * Bug: Fixed the date time representation in the grid
    * Bug: Fixed the variable grid. It was very broken when editing in a filtered list. Sorry for people who lost variables due to this bug.
    * Bug: Bitflip was not working after an update. This is (foing to be I hope) fixed

    Everything is pushed to git already, so if you want to test, njoy!
  • I'm looking for some expressions to get hours and minutes, so I can store this in 2 separate number-variables, and the complete time in a single string-variable.

    So if the time is 16:57, I want the variable $Hours$ = 16 and the variable $Minutes$ = 57; and $TimeString$ = '16:57'

    How can I do that ?
    I don't seem to be able to make functions work, like
    getHours() -> $Hours$
    This is not possible currently. What do you want to do?
  • I want to store the time, when an event happened.
    I want to use the time (hours or hours+ minutes, depending on the specific flow).
    I have a flow to stores the current caller (to my fritzbox), in another flow I want to ask homey, who was the last caller. Homey responds with 'the last caller was' + name.
    I also want to add the time to that: 'at 18:20' for example. OR, and that's why I want the hours and minutes separated, at '6 hours and 20 minutes'
    Or another flow, that tells the time like this (now I have a lot of different flow for it):
    at 8 o'clock,  'good morning, it's 8 o'clock';
    at 9 o'clock,  'good morning, it's 9 o'clock';
    until 12:00
    according this scheme:
    ~5:00 to ~12:30: Good morning.
    ~12:30 to ~ 17:00: Good afternoon.
    ~16:30 to ~5:00: Good evening. 
    I know there is a build in flow for reading the time, but I don't want to use that.
    at 16:00 I want to output: 'Good afternoon, it's 4 o'clock'
    I know this isn't entirely correct, but I'm using it in dutch and then it read: 'goede namiddag, het is 4 uur', then it's correct.
    So for being able to do that, I need to know the hours, and subtract 12, when hours > 12.

    Just to say why I need hours and minutes to be stored in a variable, separately, and do calculations with it.


  • Released the new version. Should be available soon! Njoy!
  • @Uranday ;
    Great!
    Do you think my 'request' (2 replies up) would be possible in the (near) future ?

  • @Uranday ;
    Great!
    Do you think my 'request' (2 replies up) would be possible in the (near) future ?

    I Saw the request. I have to think about how this should be implemented. Because you want hours and minutes, someone else wants year, month, day..... So if I'm going to build it it has to work nice (and no problems with UTC times etc.. 
  • Where is that rename function, it's Christmas after all ;)

    P.S. I realise it might not be possible, but if there's a way...
  • MarkSwift said:
    Where is that rename function, it's Christmas after all ;)

    P.S. I realise it might not be possible, but if there's a way...
    Not sure if it is very easy to implement. Loads of things to considder (bitflip devices, flows, variables). I think you can play with https://forum.athom.com/discussion/2086/app-powershell-cli-for-homey-homeypscli-updated-v0-0-5 to see if you can export -> edit -> and import again.... Let me know if this works.
  • Any way that I can clean up my naming conventions...
  • @Uranday ;
    I made a flow with
    IF: date&time, every minute
    THEN: Betterlogic Set String Variable: TimeString, Value: TimeTag

    TimeString now is '22:16'

    So actually stringfunctions like you have a mathjs flowcard would do the job.
    like:
    TimeString.substring(1, 2) -> TimeHourString
    fixed

    Someone who wants to do that with a date can do the same.

    You think a stringfunction flowcard would be possible ?

    Thanks!
  • @Uranday ;
    I made a flow with
    IF: date&time, every minute
    THEN: Betterlogic Set String Variable: TimeString, Value: TimeTag

    TimeString now is '22:16'

    So actually stringfunctions like you have a mathjs flowcard would do the job.
    like:
    TimeString.substring(1, 2) -> TimeHourString
    fixed

    Someone who wants to do that with a date can do the same.

    You think a stringfunction flowcard would be possible ?

    Thanks!
    Ill take a look in the next release..
  • V0.9.7 is released! Njoy!
  • Excellent, thank you very much - especially for fixing the second bug from the bottom, that got me sooo many times :smile: 

  • Hi. I love this app! I am looking for a way that Homey can tell me the values of all Better Logic variables. Something like: Ok Homey, tell me your status. And Homey says: <variable nam> (temperature), <variable value> (23). 

    Maybe it's possible to add a action card to the app 'tell variable', where I can choose a variable. Or a build in option, that just tells me all variables and the values..

    Or maybe it's already possible, but I don't know it yet.. lol

  • MarkSwiftMarkSwift Member
    edited December 2016
    @Uranday now 1.1 is out (dev preview channel) and allows for global tokens, I really hope we can use BL tags in all of our flows, that would be AWESOME!
  • MarkSwift said:
    @Uranday now 1.1 is out (dev preview channel) and allows for global tokens, I really hope we can use BL tags in all of our flows, that would be AWESOME!
    Hell yeah, instant ability to have Homey speak BetterLogic variables ... :sunglasses:
  • It appears they already work for the most part :)
  • Let me know if any feature is needed! 
  • Hi, I have a suggestion for extending the functionality with schedules. This would really save me a number of flows. Use case would be to set the thermostat high during working hours, and low during non-working hours. In your app you could add a boolean variable that is true during the set schedule, and false otherwise. With a trigger flowcard when the value changes, and a condition flowcard I would be all set. All you would need to do is add is a place to set up the schedule. Something similar to what is displayed below would do the trick :)

    Dou you see this as a good extension of BL?


Sign In or Register to comment.