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

[POSITIVE] Flows that work!

1567911

Comments

  • cbh said:
    Two very simple, but energy saving flows, using @gruijter_devs new app integrating (some) Netgear routers:

    Until now, I had the power to my printer turn on/off as part of some flows dealing with presence - if me or my son was at home, the printer would be on, otherwise it would be off.
    As I only print from my laptop (although in theory possible from other devices) there is no reason why the printer should consume power if it is not on (or, although he almost never goes analouge) if my sons laptop is on...

    Using the new app, I've made to simple flows triggered by a new device going online or offline, respectively, and the two laptops MAC-adresses as parameters:

    First flow turns on mains to the printer if either one of the laptops goes online:


    Second flow turns off mains to the printer if both laptops goes offline:


    Although in absolute numbers the reduction in power consumption is probably diminuscule, in relative terms it is probably a reduction with a factor 10 or more (at least laptops are off when sleeping)...

    where to find add to the log?

    It is not one of my flow cards?

  • yemoHyemoH Member
    edited December 2017
    While searching the forum for an example for the app Sets, I couldn't find one. Therefore I would like to share a use case.

    My problem was that in my living room I have two Hue motion sensors and a Multisensor6, for which the Hue sensor would turn off the lights when only one of the two didn't detect motion. For example I would be working at the dinner table, but since the motion sensor at the television didn't detect any motion, all the lights in the living room were turned off. The lights should only be turned off when all the motion sensors don't detect motion for a certain period.

    For the app Sets each set can have multiple states. In my case I defined the set 'MotionDetectors' and three states, one for each motion sensor. In the print screen below you can see the remaining seconds until the state is de-activated. The number of seconds for the countdown is defined in the next flow.


    Next I defined how for each motion sensor a state is activated and for how long. In this flow a state is activated for 20 minutes, except on a Friday and Saturday evening, when I'm typically coding flows, the state is activated for 40 minutes. 
    Similar flows are created for the other two motion sensors. 


    Finally a light in my living room is turned on when one of the three states is activated. In the past I had a separate flow for each motion sensor and this app reduced the number of flows.
    The Boolean 'Night' is added because during the night hours a different Hue Scene is used, but that is not important for the use case Sets.
    Other cards are available and there is a detailed description for each card in the app store.


    When the countdown is finished the state is de-activated. When all three state are not active, the flow below is started and will turn off the light. 
    The interesting extra is that other triggers can de-activate states which starts the flow below. For example I have a remote which will turn off the light by de-activating the entire set.

    I hope this helps in using the app Sets. 
  • cbhcbh Member
    edited December 2017
    A possible solution to the question here, but posted here, as it's flows that are working :-)

    I have some lights that I would like to turn on when it's getting dark if someone are at home - but not if the house is empty. Further, I want the lights to turn on when someone comes home and it's dark.

    Flow #1: Making a "global" variable: Dark or not?



    A Better Logic Boolean variable (#Dark) that becomes "true" if below a certain value (in this case 50).
    By doing this, I get a global variable that I can use in other flows as a simple conditon (is it dark or not) - to trigger flows or as condition in other flows - and still only have to adjust the limit one place.
    Further, it makes it possible to distinguish between two situations: Is it getting darker or is it getting lighter (Better Logic has a flow card that can trigger a flow, if a Better Logic variable changed at least "something" or specifically in- or decreased "something", but I've not found a way to do this with sensor values directly).

    Flow #2: Turn lights on, if someone are home and it's getting dark



    If the reported value from the motion sensor comes below my limit #Dark is set to "True" and the flow below is triggered. This flow includes a check that somebody is actually at home (a Better Logic variable "Anyone_home" set by other flows) and that I'm not sleeping (sleeping or not is only set for my own profile at present, therefore the "Nobody" card is used). The flow will trigger a separate flow "L-GF-on" in which I keep track of exactly whihc lamps should be included or not (and therefore a single flow to make changes in if needed).

    Flow #3: Turn lights on, if it's dark, when someone comes home



    Based on my Better Logic variable "Anyone_Home" (maintained by other flows and using information from various sources and not only Homey's native presence function) a flow is triggered when someone arrives at home - and if it's dark, the lights are turned on using the same flow as before (L-GF-on).

    Hope it makes sense :-)

    Update (reply to https://forum.athom.com/post/quote/936/Comment_64001):
    Looked at Insights for the sensor and realised, that although the room is well-lit during daytime, the actual measured levels are quite low (the sensor is placed in the "dark" corner of the room) resulting in lumince-levels are actually always below 50 at present (during summertime higher, though).


    As a consequence I'll change the limit to 20.
    Regarding the question about changes caused by turning on lights, the report interval is set to 3600.
    Further, the illumination report treshold is set to 200 lux.
    Therefore, turning lights on obviously doesn't affect values in my present setup - tweaking these values will probably be the solution if turning on lights interferes with the "dark" status.

    Update (reply to https://forum.athom.com/post/quote/936/Comment_64040):
    Fibaro Motion Sensor 2
    #2.JPG 59.7K
    #3.JPG 51.1K
    #4.JPG 113.7K
  • cbh said:
    A possible solution to the question here, but posted here, as it's flows that are working :-)

    I have some lights that I would like to turn on when it's getting dark if someone are at home - but not if the house is empty. Further, I want the lights to turn on when someone comes home and it's dark.

    Flow #1: Making a "global" variable: Dark or not?



    A Better Logic Boolean variable (#Dark) that becomes "true" if below a certain value (in this case 50).
    By doing this, I get a global variable that I can use in other flows as a simple conditon (is it dark or not) - to trigger flows or as condition in other flows - and still only have to adjust the limit one place.
    Further, it makes it possible to distinguish between two situations: Is it getting darker or is it getting lighter (Better Logic has a flow card that can trigger a flow, if a Better Logic variable changed at least "something" or specifically in- or decreased "something", but I've not found a way to do this with sensor values directly).

    Flow #2: Turn lights on, if someone are home and it's getting dark



    If the reported value from the motion sensor comes below my limit #Dark is set to "True" and the flow below is triggered. This flow includes a check that somebody is actually at home (a Better Logic variable "Anyone_home" set by other flows) and that I'm not sleeping (sleeping or not is only set for my own profile at present, therefore the "Nobody" card is used). The flow will trigger a separate flow "L-GF-on" in which I keep track of exactly whihc lamps should be included or not (and therefore a single flow to make changes in if needed).

    Flow #3: Turn lights on, if it's dark, when someone comes home



    Based on my Better Logic variable "Anyone_Home" (maintained by other flows and using information from various sources and not only Homey's native presence function) a flow is triggered when someone arrives at home - and if it's dark, the lights are turned on using the same flow as before (L-GF-on).

    Hope it makes sense :-)

    I love the idea of this. Is really like to use the global "is dark" variable but I'd like to take values from the multiple sensors around the house (e.g. if a light is on in one room you can't use that sensor for a reliable "is dark" since the light affects it. Using multiple would help that
  • Works fine for me with a single sensor (in the stairs) - but it shouldn't be difficult to make a flow that "averages" or use "the worst" value of multiple sensors...
  • cbh said:
    A possible solution to the question here, but posted here, as it's flows that are working :-)

    I have some lights that I would like to turn on when it's getting dark if someone are at home - but not if the house is empty. Further, I want the lights to turn on when someone comes home and it's dark.

    Flow #1: Making a "global" variable: Dark or not?




    What sensor are you using here?
  • A flow I created earlier today to let Homey ask me if I want to put on the lights at sunset. Worked perfectly :smile: 

    ok, so call me silly, but, what is the appropriate answer?

    I did replicate this flow but when Homey asks, it never switches on the lights as I apparently give the wrong reply..? 
  • A simple ja or yes Will do
  • A simple ja or yes Will do
    Must be my pronunciation then ;) I'll try a more clear response next time. 
  • Got a Fitbit Aria (weight scale with wifi) a couple of years ago. Don't ask me why; it has been collecting dust.

    Now about to change apartments, hyping up to get some Z-Wave devices. At the moment though I'm making due :)

    There is no public API (https://dev.fitbit.com/reference/web-api/quickstart/) so I used IFTTT.

    Aria scale (users chosen with foot) -> Aria app account -> IFTTT -> Homey



    NyVikt = New Weight. GammalVikt = Old Weight. GammalNyVikt is the difference between the two.

    In the end it says whether you lost weight, or gained weight, and how much. Now I just need a bluetooth speaker for the bathroom :)
  • To keep you motivated in the difficult Christmas period you might want to consider a long term weight loss as well.
  • vaderag said:
    cbh said:
    A possible solution to the question here, but posted here, as it's flows that are working :-)

    I have some lights that I would like to turn on when it's getting dark if someone are at home - but not if the house is empty. Further, I want the lights to turn on when someone comes home and it's dark.

    Flow #1: Making a "global" variable: Dark or not?



    A Better Logic Boolean variable (#Dark) that becomes "true" if below a certain value (in this case 50).
    By doing this, I get a global variable that I can use in other flows as a simple conditon (is it dark or not) - to trigger flows or as condition in other flows - and still only have to adjust the limit one place.
    Further, it makes it possible to distinguish between two situations: Is it getting darker or is it getting lighter (Better Logic has a flow card that can trigger a flow, if a Better Logic variable changed at least "something" or specifically in- or decreased "something", but I've not found a way to do this with sensor values directly).

    Flow #2: Turn lights on, if someone are home and it's getting dark



    If the reported value from the motion sensor comes below my limit #Dark is set to "True" and the flow below is triggered. This flow includes a check that somebody is actually at home (a Better Logic variable "Anyone_home" set by other flows) and that I'm not sleeping (sleeping or not is only set for my own profile at present, therefore the "Nobody" card is used). The flow will trigger a separate flow "L-GF-on" in which I keep track of exactly whihc lamps should be included or not (and therefore a single flow to make changes in if needed).

    Flow #3: Turn lights on, if it's dark, when someone comes home



    Based on my Better Logic variable "Anyone_Home" (maintained by other flows and using information from various sources and not only Homey's native presence function) a flow is triggered when someone arrives at home - and if it's dark, the lights are turned on using the same flow as before (L-GF-on).

    Hope it makes sense :-)

    I love the idea of this. Is really like to use the global "is dark" variable but I'd like to take values from the multiple sensors around the house (e.g. if a light is on in one room you can't use that sensor for a reliable "is dark" since the light affects it. Using multiple would help that
    hi, can you share more on your Anyone_Home logic? I am still looking for a good solution to detect this
  • cbh said:
    A possible solution to the question here, but posted here, as it's flows that are working :-)

    I have some lights that I would like to turn on when it's getting dark if someone are at home - but not if the house is empty. Further, I want the lights to turn on when someone comes home and it's dark.

    Flow #1: Making a "global" variable: Dark or not?



    A Better Logic Boolean variable (#Dark) that becomes "true" if below a certain value (in this case 50).
    By doing this, I get a global variable that I can use in other flows as a simple conditon (is it dark or not) - to trigger flows or as condition in other flows - and still only have to adjust the limit one place.
    Further, it makes it possible to distinguish between two situations: Is it getting darker or is it getting lighter (Better Logic has a flow card that can trigger a flow, if a Better Logic variable changed at least "something" or specifically in- or decreased "something", but I've not found a way to do this with sensor values directly).

    Flow #2: Turn lights on, if someone are home and it's getting dark



    If the reported value from the motion sensor comes below my limit #Dark is set to "True" and the flow below is triggered. This flow includes a check that somebody is actually at home (a Better Logic variable "Anyone_home" set by other flows) and that I'm not sleeping (sleeping or not is only set for my own profile at present, therefore the "Nobody" card is used). The flow will trigger a separate flow "L-GF-on" in which I keep track of exactly whihc lamps should be included or not (and therefore a single flow to make changes in if needed).

    Flow #3: Turn lights on, if it's dark, when someone comes home



    Based on my Better Logic variable "Anyone_Home" (maintained by other flows and using information from various sources and not only Homey's native presence function) a flow is triggered when someone arrives at home - and if it's dark, the lights are turned on using the same flow as before (L-GF-on).

    Hope it makes sense :-)

    Update (reply to https://forum.athom.com/post/quote/936/Comment_64001):
    Looked at Insights for the sensor and realised, that although the room is well-lit during daytime, the actual measured levels are quite low (the sensor is placed in the "dark" corner of the room) resulting in lumince-levels are actually always below 50 at present (during summertime higher, though).


    As a consequence I'll change the limit to 20.
    Regarding the question about changes caused by turning on lights, the report interval is set to 3600.
    Further, the illumination report treshold is set to 200 lux.
    Therefore, turning lights on obviously doesn't affect values in my present setup - tweaking these values will probably be the solution if turning on lights interferes with the "dark" status.

    Update (reply to https://forum.athom.com/post/quote/936/Comment_64040):
    Fibaro Motion Sensor 2
  • LakemanLakeman Member
    edited December 2017
    Thank you very much this was a good solution. I need a tip where I find "Math.js".
    And how do you create a global variable?
  • LakemanLakeman Member
    edited December 2017

  • Why don't you use 'luminance is smaller than XX", but math.js expression?

  • cbhcbh Member
    edited December 2017
    Eternity said:
    Why don't you use 'luminance is smaller than XX", but math.js expression?
    Don't know... The standard logic card is, well, the most logical to use...
    Think it must be a leftover from having som kind of calculation at some time in the flow card with math.js and just changed the formula at some point...
  • Check this out, just made a flow which cancels the "sorry i do not understand" and replace it by "U" with a red pulse light (optional).


  • I have a problem with the flows that should report when a washer or dryer is finished. The flows work but my washer uses 0.3 and 0.4w idle. So the power usage fluctuates between those numbers. So with every fluctuation the flow gets started and i get a notification that the washer is finished. The flow has a timer when usage has changed and is under 10w for 80 seconds it sends a notification. 

    I have a fibaro plug. how can i solve this?
  • @MichaelD I use the Countdown app. When power drops under x value the the countdown starts. When the washing machine starts again, then the countdown is reset. You just have to check for how long the washer is idle so you setup the countdown greater than the idle time. When the washer finishes for good, then the countdown will reach 0.
    Hope this helps.
  • danone said:
    @MichaelD I use the Countdown app. When power drops under x value the the countdown starts. When the washing machine starts again, then the countdown is reset. You just have to check for how long the washer is idle so you setup the countdown greater than the idle time. When the washer finishes for good, then the countdown will reach 0.
    Hope this helps.

    Yes that part works. But the idle watt is not constant, so it every few seconds it changes from 0.3 to 0.4 etc. so i keep getting notifications every time the watt changes between 0.4 and 0.3. These are my flows:



  • Split the last flow.
    Energie changed AND less then 10----> Set boolean false
    Boolean changed AND wasmachine false----->turn hourglass
  • I already posted (year ago) a working solution for this (at least in my usage cases).

    I measure every 99 seconds the power usage.
    I store this in 4 variables for each device (devicenameX1 - devicenameX4)
    In this example I have 3 devices to measure.
    I use a counter to know what variable to fill.
    You need better logic for this, and create 4 variables per device, a variable for counting up, a boolean for every device to set a flag if it's actually active or not.

    So

    4 flows for measurement

    for every 99 seconds, Energycount = 1
    set Energycount = 2
    set devicenameA2 = energydeviceA
    set devicenameB2 = energydeviceB
    set devicenameC2 = energydeviceC

    for every 99 seconds, Energycount = 2
    set Energycount = 3
    set devicenameA3 = energydeviceA
    set devicenameB3 = energydeviceB
    set devicenameC3 = energydeviceC

    for every 99 seconds, Energycount = 3
    set Energycount = 4
    set devicenameA4 = energydeviceA
    set devicenameB4 = energydeviceB
    set devicenameC4 = energydeviceC

    for every 99 seconds, Energycount = 4
    set Energycount = 1
    set devicenameA1 = energydeviceA
    set devicenameB1 = energydeviceB
    set devicenameC1 = energydeviceC

    Example for checking devicenameA, inactive ?

    if Energycount changed
    and
    devicenameAboolean = true
    devicenameA1 < 3
    devicenameA2 < 3
    devicenameA3 < 3
    devicenameA4 < 3
    then
    set devicenameAboolean = false

    Example for checking devicenameA, active ?

    if energy changed (devicenameA)    <- in my case the card for the fibaro plug
    and
    devicenameAboolean = false
    energy (devicenameA) > 200
    then
    set devicenameAboolean = true

    Instead of 4 flows (400 seconds) you can go for 3 flows, and with less variables, but I found it to be more accurate with 4.

    I can post some screenshots but since the variable names are not entirely visible I thought writing down the flows was better.
  • Thanks both, Will try these, First one looks easier zo Will try that First. Will post The results!
  • I already posted (year ago) a working solution for this (at least in my usage cases).


    Januari 2017 that was!
    Must also add that mine was from november 16 but hey,  if it works it works aye?
  • Hi Rocodamelshe

    Sorry if it sounded like the one (mine) being better than the other (yours). I haven't read all the comments. I remembered that I posted 'my' solution. That's all.

    We're all here to help eachother, and find good ideas.

    Must say I'm quite happy with all the comments I read on the forum. It's quite a mature forum with good input.

    Just want to thank you all !
  • Ow hey, no offence!
    Just added a link to ur flows and wanna thank u for ur effort in posting this to help others.
    Cheers!
Sign In or Register to comment.