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.

Flow editor - do's and don'ts / reference guide

MarkVanWindenMarkVanWinden Member
edited February 2016 in Archive
I was a wondering, since there have been some questions about the lightening flows etc. Can someone sum up a list of do's and don'ts.

Or is it wise to start a topic and combine some sort of guideline reference.
E.g. How to control your lights ( a specific one, multiple at a time, all in one room)

Comments

  • 1. Don't create a flow with the word 'Light' or any other keyword (whatever they are).
  • Not sure if this helps a lot, maybe a start: https://jsfiddle.net/zz93y0ut/
  • Keep in mind witch device is actually trigger the flow.

    If you want e.g. that a light is going on between some hours when a moving sensor sees movement.
    Here you have to put the device of a moving sensor in the when... column and the conditions where under in the ...and... column.

  • Vincent said:
    1. Don't create a flow with the word 'Light' or any other keyword (whatever they are).
    So what are the keywords?
    And what about a bunch of lights?


    Hey Athom, is there a manual or something that we use? 
  • My personal recommendation:
    Create "triggering" flows and "executing" flows.

    Basic example:
    I want to turn on several lights to create a nice scene in the living room. I want the scene to be set when I come home after dark, when I press a switch, or when I give a voice command.
    Rather than duplicating the scene 3 times, I create 3 "triggering" flows which all set the same variable LivingroomSceneOn to 1. 
    Upon setting the variable, another "executing" flow reacts and sets the scene by turning on all the lights and resetting the LivingroomSceneOn to 0.

    This way, I can modify the scene, extend it with additional lights or change a brightness value once and all triggers will still set the same scene. I can also easily add more add or modify triggering flows. 

    Advanced example:
    Now I want to randomize the colors of my hue lamps each time the scene is activated.
    I already have the LivingroomSceneOn variable. I add the variables RandomColor.
    When LivingRoomSceneOn is triggered, an additional flow is triggered for the hue lamp which depends on the value of RandomColor.  
    If LivingroomSceneOn = 1 and RandomColor = 1 > Set hue color to red and change RandomColor to 2
    If LivingroomSceneOn = 1 and RandomColor = 2 > Set hue color to blue and change RandomColor to 3
    etc...

    You can add as many as you want. You can also add an additional flow to break the cycle.
    With a 30% chance Set RandomColor to 1
    With a 30% change Set RandomColor to 4
    Don't worry about overriding it multiple times. We want randomness anyways. 


    I haven't implemented this yet, but I quickly noticed that I was duplicating a low of scenes and triggers. Separating triggers and executors will allow you to more easily extend scene-based behavior of your home. Try to begin simple and expend slowly.
    Once I have managed to implement this myself, I hope to post more details on how I used variables and how Homey handles it.
  • JaapPelt said:
    My personal recommendation:
    Create "triggering" flows and "executing" flows.

    Basic example:
    I want to turn on several lights to create a nice scene in the living room. I want the scene to be set when I come home after dark, when I press a switch, or when I give a voice command.
    Rather than duplicating the scene 3 times, I create 3 "triggering" flows which all set the same variable LivingroomSceneOn to 1. 
    Upon setting the variable, another "executing" flow reacts and sets the scene by turning on all the lights and resetting the LivingroomSceneOn to 0.

    This way, I can modify the scene, extend it with additional lights or change a brightness value once and all triggers will still set the same scene. I can also easily add more add or modify triggering flows. 

    With the better logic extension v0.0.4 (which isnt in the app store yet) I managed to reduce this basic example to 3 flows and one bitflip device in total. The bitflip device is a device that can be registered to flip a boolean.
    Flow 1: at certain time then set bitflip device to on
    Flow 2: at voice command then set bitflip device to on
    Flow 3: at bitflip device turned on then turn on the lights

    With three flows you can time control, voice control and button control some lights.

  • Much more efficient than doing manual value flips. Forget one and an entire flow doesn't work.

    Combined with the variable list showing current values 0.0.4 is a promising release indeed!
Sign In or Register to comment.