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.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
Flow library : your input for advanced flows
Annemarie
Member
Hi!
I'm working on a flow library at the moment. We have some awesome ideas about this for the future, but we thought it would be good to start small and within our reach for this moment. I had a great talk with some of you about what this should look like so now it is a good moment to involve you all.
In the flow Library #1 we will have some really basic flows, but of course it would also be great to have some advanced flows. Flows where we can really see the full potential of the flow editor at this point in time.
For these advanced flows I need your help. I want to ask you to send some best in class flows that you are currently using. For now I do not really have guidelines or expectations, so I'm just really curious about what you are building and are willing to share with me. You can send a screenshot in this thread or in a DM/PM.
If you have any other suggestions about the flow library #1 (don't forget we do this step by step), please let me know!
Thank you!
Annemarie
Happiness Engineer @ Athom
I'm working on a flow library at the moment. We have some awesome ideas about this for the future, but we thought it would be good to start small and within our reach for this moment. I had a great talk with some of you about what this should look like so now it is a good moment to involve you all.
In the flow Library #1 we will have some really basic flows, but of course it would also be great to have some advanced flows. Flows where we can really see the full potential of the flow editor at this point in time.
For these advanced flows I need your help. I want to ask you to send some best in class flows that you are currently using. For now I do not really have guidelines or expectations, so I'm just really curious about what you are building and are willing to share with me. You can send a screenshot in this thread or in a DM/PM.
If you have any other suggestions about the flow library #1 (don't forget we do this step by step), please let me know!
Thank you!
Annemarie
Happiness Engineer @ Athom
Comments
https://forum.athom.com/discussion/936/positive-flows-that-work/p1
https://forum.athom.com/discussion/comment/18339/#Comment_18339
It goes as follows (mind you it is not lean):
- create a timer
- 2nd, 3rd and 4th, create the following flows:
The first flow fires up a 1 second timer to allow the false/true check of the 2nd and 3rd flow to check the boolean condition (otherwise it is always it's standard condition - false).* For the true flow (3rd) you can also add a confirmation by homey if you like. Personally I let homey repeat the confirmation in the individual flows.
One caveat is that the flow does not natively work with built-in commands (I suppose you could implement a workaround for these if you would really want to).If someone has a better way to implement it, let me know!
- With sunset or sunrise, make a "before" option: So for example: 10 mins before sunset
- A checkbox at speech. If checked, homey will ask confirmation before starting a flow that is initiated by your speech.
- An "or" option (or is this already the case if you put 2 boxes in the first column??
- Insight as input. To automate garden irrigation for example. I make an insight for "rainfall". Than at flow state: if Rainfall in last X days is lesser than XX mm than
Cant wait till things are really starting to work fully, so I can throw out Homeseer HSPRO2
For conveniences matters by programming, I give the tip to do in in minutes instead of HH:MM.
In lot of versions it was solved but after testing again it was not.
@Annemarie
What will de Library #1 be like?
- an Forum / wiki / support page with examples? (Like our postings here on the forum)
- an online repository with examples we can clone/copy to Homey?
- or .....
And wil lit be possible to ask questions / discuss the entry's in the library. (or do we have to discuss on the forum about something in the library?)
Will the library be filled by Athom (with verified examples) or can we all create new examples in the library?
I thought there would be an option to share flows, or is that FlowLibrary #2 or #3 or #n ...?
Curious what kind of Library is coming....
- it will be a page on the website based on situations and devices (so you can search for light and for evening)
- As I would love that for now that stays on the forum
- in #2 you will be able to add examples yourself
- Also sharing will be in the next version
You probably saw quite a lot on the forum,
Question is if the Library-flows are created using a dummy homey online (fe a web interface with same options as Homey but read-only and "non functional" )
or are pages with screenshots (hiding all inputs in to small fields.... )
or flows described in text with an consistent syntax (fe where to put the Little black <labels] ;-) )
Of course you can look at what I already created and borrow the best from it...
These are my examples on the forum:
- Advanced Automatic SunScreen with Complex WAF (https://forum.athom.com/discussion/1897/advanced-automatic-sunscreen-with-complex-waf)
and the- - 1st: setting the LED Idle mode
- - 2nd: Restarting Homey from a Flow
- - 3rd: Sending Logs to Athom ;-)
and look at what description works best for documentation. Try to make such a flow using the description, and than ask "your mother" or "sister" if she could do it with that description ;-)It should be a Flow for Dummie's ;-)
As basic flow, I can recommend:
- The Parrot flow (repeat voice commands to test the accuracy)
- The clock flow (tell the time with the sound of the Big Ben or cuckoo clock in the background)
I'm currently playing with a flow which changes the colors of my hue lamps every few minutes. Changing the color gives a bit of a wow-factor every time I enter the room. The goal is not to notice the color changes while you are in the room.
I started by selecting a relatively neutral picture in the Philips hue mobile app. The color pallet must be suitable for daily, so no bright colors, but more pastel like in the yellow-red range. I used the randomize function to create 4 scenes. These scenes all look very much alike with only minor differences.
Next step is to create a few flows in Homey.
- Scene flow 1..4
- Stop flow
Scene 1..4 are triggered when the "scene" variable change AND when the scene variable equals the scene number. It sets Philips hue scene and after 10 minutes, it changes the scene variable to another number (1>2>3>4>1). This way, the colors will change over time.The Stop flow will be triggered when the "scene" variable is set to 0. It will turned off the lights.
It is easy to add switches and events to this flow.
For example:
The next step would be to slowly dim the lights when they are turned off automatically. While allowing the wall switch to instantly turn them off.
Here's what I'd like to get:
When set-temp is higher then inside-temp then variable heating is true
when (var.) heating is true switch on floorheating pump (elro switch)
when (var.) heating is false switch off floorheating pump (elro switch)
when the pump is off for 24 hrs switch it on for 2 min. (so it won't get stuck)
- Sensors which will stay "on" for as long as someone is in the room. These sensors often use infrared, so they also work well when you're sitting still.
- Sensors which have an internal timer which is reset when motion is detected again. These are quite common.
- Sensors which give a signal when motion is detected. These are a bit harder to use as they can give a lot of signals.
The first thing I do when I buy a sensors (motion or otherwise) is to install it somewhere and let it gather data for a few days to see the behavior. Based on that, I determine the "states" which are needed and I create a flow to test the states.
For example:
A motion sensor gives a on signal when motion is detected. This signal is given once in a while, but it is sometimes irregular (that's what happens with cheap sensors). A typical pattern would look like this:
________-_-_-_---_-__________-_-_----_-_-___---_-______
Since the signal is not registered more then once every few minutes. I was in the room for 3 times. The 2nd and 3rd time is a bit hard to distinguish, but since they are somewhat close together, that doesn't really matter. What we need to do is to ensure the off times are bridged for a short while before actually switching off the lights.
As a bonus feature, I want to first dim the lights to warn any undetected occupants that the lights will switch off shortly.
The challenge is to keep the lights on even sometimes no motion is detected. To achieve this, I introduce a variable "livingroom-presence" with 3 possible values (states) "Empty", "Occupied", "Leaving".
The lights will behave based on changes to the livingroom-presence variable.
Light will be 100% if Occupied, 0% if Empty, 75% if Leaving.
When motion is detected, the state is changed to Occupied. I record time time in a variable called "livingroom-presence-time".
5 minutes after motion is detected another flow is triggered. I check if the livingroom-presence-time is atleast 5 minutes ago (to ensure it has not been overridden with a more recent time) AND the livingroom-presence is still Occupied. If so, I set livingroom-presence to Leaving.
1 minute after the livingroom-presence is set to Leaving another flow is triggered. If the livingroom-presenceis still leaving, livingroom-presence is set to Empty.
Tweaking the time from 5 to 7 or 10 minutes might improve the accuracy at the cost of a few more watts. You want it as short as possible without having it switch to the Leaving state while you are in the room. You will notice the lights dim when you're cutting it too close.
If you want to add a switch or remote, you might want to add an additional state "Manual-off" for example to ensure the motion is ignored for the next 30 seconds, or "Manual-on" to ensure the lights are on for at least the next half hour. You can also add multiple (motion) sensors to work together. The use of states allows you to expend the behavior independently of the results (which will make managing multiple lights a lot easier) and slowly make it more intelligent.
I use a motion sensor in our toilet because the kids always forgot to turn off the light.
Flow1:
When variable motion_toilet changes to True (this is done in another flow when motion is detected):
- Turn on Hue
- stop timer_toilet
Flow2:
When variable motion_toilet changes to False (this is done in another flow when no more motion is detected):
- start timer_toilet (60 seconds in my case)
Flow 3:
When timer_toilet reaches 0:
- Turn off Hue
I only use the timer because my wife complained that sometimes the light when out (I guess she falls asleep on the toilet
Depends a little on where you put your sensor and how sensitive it is, maybe you won't even need a timer.
I had that before in my toilet and when some one takes a long shit the light will go off.
I solved it with a infrared sensor. Measure the temp of the sensor itself and surrounding temp. That way u can sit still for as long as u like and the light will stay on.
For the livingroom it's another challenge. U need to move every now and then to keep the lights on.
IR sensors could work but u need a lot of those. For the toilet it's a great presence detection, for a living room we need something different.
BTW, ur flow looks a lot like this flow . I don't mean anything with that, just noticed.
I must admit that I haven't used the start and stop timer functionality yet. That would make it all a bit easier.
The use of states still has some advantages:
- It allows you to configure and modify complex scenes independently of behavior.
- It makes it easier to fine-tune and add more behavior to it later.
- It allows for easier interaction between various areas (one state interacting with another state) and thus allow you to build layer upon layer of abstraction.
For a toilet light, using states is overkill, but I noticed that the number of states for my living room is expending rapidly as I add more behavior to it. I need to get better at using the Homey logic, but the use of states has made it easy to add some pretty nifty and natural behavior without breaking a sweat.
(Depends on the placement of the sensor also of course)
In bigger rooms, you'll need another solution (longer timeout, more sensors, ... )
Flows do indeed look alike
I think it will get complicated enough over time with more and more flows, so I try to keep it as simple as possible
It's because of some of your posts explaining how you made your flows that I started using variables and such, so you're my biggest inspiration (Homey-wise )
I'm still trying to simplify the flows I have now by converting them to use variables, but I find it difficult sometimes to cleanly split actions and triggers
https://forum.athom.com/discussion/comment/33664/#Comment_33664
https://github.com/athombv/com.fibaro/issues/98
https://github.com/athombv/homey/issues/934
Hi Jerryvdv . Goede flow. Dat kan mijn familie ook wel gebruiken. Ik kan de zandloper al niet vinden? Waar kan ik die toevoegen? Dank.