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.
Closed

Flows with booleans

I think this forum needs a "flows" section as well ;-)

Now, it could be I am blind and completely overlooking things, but I can't seem to make flows based on a if <boolean> = true, .bla blah blah
With the builtin logic, as well as with the BetterLogic App, the only options I have are "when a variable changed", "when a variable is set",...
But for example, on my previous controller, I used to create flows based on booleans that defined the part of day.
So I have a flow that sets the boolean "night" to true, at 22.00h.
Then I want to have my motionsensor monitor movement and tv power consumption, in order to control lights.
So can I start a flow with : If <night> = true; then....?

Comments

  • aloftaloft Member
    I see two scenarios, but i might misunderstand your question:

    - It becomes night (at 22:00) : So then you have a flow
        if variable "night" changed AND "boolean night is TRUE" THEN $action
    - Certain flows should only run at night:
        if $trigger (e.g. TV is turned on) AND "boolean night is TRUE" THEN $action

    You could argue that the first flow could have a simpler statement " if variable "night" changed to TRUE THEN . That is not implemented right now, you need the middle column in the flow.  I am not sure if this is possible to implement e.g. in BetterLogic  @Uranday



  • heretic1988heretic1988 Member
    edited April 2016
    Yes, the second scenario is what I am used to be doing.

    - From 22.00, var $night = true
    - if there is no movement for 30min -> var $movement = false, if movement detected -> var = true
    - if tv is on -> var $tv = true

    I would also have a boolean that indicates if I am on a holiday, because it would trigger other scenarios

    So then there would be a flow : if $holiday=false, and, $night=true, and $tv=false, and $movement=false THEN <lights off>

    So the first column would be a better place for that.

    It could also be that I am creating my flows not correctly, and that there are much eayser ways to accomplish the same....
  • aloftaloft Member
    I think it still works when you do this:

    WHEN variable changed ( which can be either holiday, night, tv or movement ) 
    AND  $holiday=false, and, $night=true, and $tv=false, and $movement=false   ( 4 cards in that column )
    THEN lights-off

    Or do you need any "OR" statements in that flow? Or should the flow trigger on either of those variables going to their required value ? 


This discussion has been closed.