I’m starting with my Homey Pro 2023 … added lights, dimmers, shutters, etc … and created some simple flows and some advanced flows.
Now struggling with time calculation for a new flow that should steer my shutters based on the sunset time and a fix time (20u00): Time to go down = ((Sunsettime - 20:00)/2) + 20:00
Example1 when Sunset at 22u00: ((22:00-20:00)/2) + 20:00 = 21:00
Example2 when Sunset at 18u00: ((18:00-20:00)/2) + 20:00 = 19:00
I’ve tried to find a solution with the Better Logic Library app … but, unfortunately, my knowledge isn’t (yet) to a level to solve my challenge.
Can anyone put me on the right track with BLL ?
Goal is to use this in an advanced flow together with other input/conditions/…
I’d like to do some basic variable calculations, mixing or not the intrinsic Homey library and the BLL library
With :
VarX_HomeyLogic = a Homey variable
VarX_BLL = a variable created with BLL
VarY = Another variable, either BLL or Homey
Trying to do things like :
VarX_HomeyLogic=VarX_HomeyLogic+0.21+VarY
VarX_HomeyLogic=VarX_BLL+0.21+VarY
VarX_BLL=VarX_HomeyLogic+0.21+VarY
VarX_HomeyLogic=VarX_HomeyLogic+0,21+VarY
A) Which “Set variable …” box should I use and what should I write in it.
B) The {} and have a particular role apart from doing the same thing as parentheses.
C) could you have some examples to show (or link to basics How Too !)
Then how can I :
D) update VarX_BLL with the content of VarX_HomeyLogic ?
E) update VarX_HomeyLogic with the content of VarX_BLL ?
Maybe it seems easy for number of you but I just didn’t get the trick!
_
4. VarX_HomeyLogic=VarX_HomeyLogic+0,21+VarY
This is equal to 1.)
but, commas are used for functions. Always use decimal points in flowcards and calculations.
Actually, with most flowcards, the variable will be created as soon as you save the flow.
(Only not with bll expression, since the type could be number, text or yes/no)
So, I’ve just tested with both standard and advanced flows: works fine.
but:
advanced flow: I get the same error, when TEST running the flow. So don’t operate the card in any TEST mode I’d suggest!
hi @Arie_J_Godschalk every so many days, this app stops working on my 2019 Homey Pro. It’s quite annoying b/c other (important) flows are depending on this app functioning properly. I have to reboot this app to have it working again for a few days until it stops working again…
Here is the error log code: 72779ce2-788d-49fd-9d1b-fdc47fb09210.
Can you see (hopefully!) what’s going wrong?
Lately the Date and Time app gives problems with sun rise/set time settings.
When you have eg -10 minutes then you can’t edit that canvas. The flow is still working
Because by saving it you get argument error and all your negative values turning red.
For now I use the “sun positions” app (Google translate)
Now I found out the you can use BLL for calculate time.
Someone had to add some day for checking out.
The first flow I copy off that but with the 10 minutes subtracting.
The variable “tijd nieuw” is 10 minutes earlier the time NOW
The last one is when I get to the smallest version after all the trying
To understand the errors I needed my Notepad ++
When they where gone I get always time NOW.
Instead of “Date.now()” I like to use a sun rise or set tag to calculate and put that it to a variable.
Homey unfortunately works with UTC time, which was introduced in june, 2022.
Not sure if I understand your case right, but you can use this card below, which has the option to add your timezone and therefore it shows your local time instead:
I’d like to have a calculated variable to be capped at either 0 or 1 depending if the result is less or more than that - if in between it should return the calculated value. I’d like to avoid using multiple ‘Variable greater than 1’ or ‘Variable less than 0’ cards, is there any BLL expression / math.js function I could put into my existing card?