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.

How do i create the following flow..

I have a multi sensor which give lux etc.

I use better logic and have a value called 'min_lux' and have a string value of 4 assigned to it.

What i want to create:
on: change lux of sensor
and: lux greater then 'min_lux' variable
then:activate flow XXXX

I cannot seem te get this flow to work, there is no option to use rmore/less with a stored value in betterlogic.

Does anyone have an idea if this is possible and how?

Comments

  • @B3rt can you add a screenshot of the flow you have right now?

    Some comments
    - the better logic parameter you use should not be a string value, but a numeric 
    - in the flow you describe, you don't need a min_lux value defined in better logic; simply add a logic "less then" card in the and column, drag the Lux token to this card and add the threshold value.

    Below flow should work:

  • thx..

    But that is not what i want....
    The value 'min_lux' is variable and set/changed in an other flow..

    I want to use this so on a change of lux (in this case) only activate a flow if the new value is bigger (or smaller) then the old value.

    The old value is in a other flow set on change of sensor data.
    So if the lux sensor has new lux data is saves the old data first in an other variable field and after that it saves the new value in the correct field..  This way i have to old and current values save and i can compare them.

    This way i want to use them to calculate differences, only bigger/less or a min diff of X between them etc etc.
    This way i try to prevent homey to activate flows un attended or unwanted, light on, 3 min laters off etc  (Because of lux changes)

    I will change sting to int, maybe this will fix my problem..
  • making it an int does not solve this.

    I believe this is not possible what i want, as soon i make it numberic i only can choose to increase or decrease a number, not do a match more or less then X
  • @B3rt it is for sure possible... with the MathJS expression.

    This is the flow which I use myself... for the same purpose.

    Which is basically a way to average the the light intensity over the last 3 values:
    Lux-voor-AVG = ( Lux + LUX-voor + LUX-voor-1)/3 
    and afterwards updating the previous values, e.g. Lux-voor-1 = Lux-voor and Lux-voor = Lux

    You could use the mathjs expression in a similar way to do the differential calculation as you like
  • thx, but this is the 'then' statement.

    I have no problem to save it but the problem is in using it in a AND statement in a different flow..

    This different flowmshould do:
    Wen sensor is triggered AND then use current lux sensor value is higher then the value saved in bettelogic 'binnen_lux_old'  variable do this....

    I cannot compare the current sensor value against the saved value, how do i do this?
    Betterlogic has no flow card for this to use flow tags to compare, the native homey app also not
  • Only way I know is to seperate it into 2 flows.
    First flow to calculate the difference (bv "Lux_dif") once the sensor is triggered (like my example above).
    Second flow once "Lux_dif" has changed AND "Lux_dif" is greater than XX THEN switch on the lights
  • Hmmm, this is disapointing, i my case i have to do 3 flows (for each sensor and each change) maybe this could be added to betterlogic as flow card option.....
    I will send a message to the developer of betterlogic if this can be added.
Sign In or Register to comment.