This topic will be used to share examples for H.O.O.P..
Anyone may and is encouraged to leave messages with examples with H.O.O.P.
Since Trigger Cards device, some double flows in the examples may be reduced to one flow, like Volume based on time (Day/night) - Single flow.
Please leave a link to the flow(s), place a wrap element below it (so you get the flow inline in the message) and write a (short) explanation.
Example link with wrap element:
[Example flow](https://homey.app/nl-nl/flow/Z7rDvx/)
[wrap=iframe id=Z7rDvx][/wrap]
Only post Examples here. For questions and answers, please use the main H.O.O.P. Topic.
The first examplesshow’s the usefullness of H.O.O.P.
It collects a list of to do, like the vacuum-bin needs to be emptied and the dishwasher is done, and then announces the todo list through Google Service TTS throughout the house.
First, the flow will only run if the variable IsThuisVandaagAlBegroet (IsHomeAllreadyBeenGreeted) is false.
Then it sets the textuale variable teDoenMeldingen (ToDoMessages) to an (almost) empty string (a space).
After that it will execute multiple IF statements, and if so, add a a message to the textuale variable TeDoenMeldingen.
After the collection of the messages has been done, the messages are played through Google Services TTS and the variable IsThuisVandaagAlBegroet is set to true, preventing the execution again today.
(The IsThuisVandaagAlBegroet variable is reset every night)
First, put a Javascript Array into a Flow Variable type JSON called Kids.
(Variables are created on the fly, no need to define them in settings, just start the flow to use them)
Then set Flow Variable Testname (type String) to: random(Flow Variable - Kids).
(The returning type needs to be the defined type, in this case a string. JSON accepts any kinds of input)
Now you can use the Flow Variable - Testname and send it to your watch, or use it the way you need it.
This is one I use to restore my tado heating when the patio door is closed.
Homey has no options to set a dropdown type action card from a variable so H.O.O.P comes to the rescues here.
To set the scene:
I have a flow that is triggered when the patio door opens and that sets a timer.
Next a flow is triggered when the time reaches 0 and that stores the current heating mode tag from the tado lounge thermostat.
I also have a flow that runs when the door is closed and that resets the door open timer, so it doesn’t timeout if it hasn’t already, and then runs the following H.O.O.P flo
Example Method Group - Announcement (P.A.) Methods
These flows are used in my announcement system, used by many other flows to direct speech-output/announcements throughout the house.
(I might rewrite some flows now that i have the Flow Director cards for IF-THEN-ELSEIF.)
I have all these flows dublicated in sync and async.
The sync methods can be used it you want to do something after annoouncement is done, because the method will wait for the execution to finish and complete with the rest of the flow that executed the method.
I will be sharing the synchronised methods, since asynchronised is just default.
Example Using one button for multiple purposes (multiple fired)
This flow can be triggered from a single source (like a button or flow-trigger) but will handle it as if the button can be clicked multiple times.
Because HOOP doesn’t have a debounce-functionality yet, i have created a Countdowntimer called PushButtonPushesResets.
I have also created (in the flow) a number variable called PushButtonPushesCount.
Where ever you see the questionmark, it’s the PushButtonPushesCount variable.
(After you create a flow-variable in flow, they flow needs to be triggered once for the variable to become visible (and to select it)).
Then comes the IF PushButtonPushesCount equals 1 THEN
Then comes the INNER IF Light is Off THen
Turn light On
Else Turn light Off
End If
ElseIf PushButtonPushesCount equals 2 THEN dim light to 50%
ElseIf PushButtonPushesCount equals 3 THEN dim light to 100%
END IF
And finally, in the 3th And group (watch carefull where you place it!), start the (restart) countdown with an amount of seconds (here 3 is used) which will set PushButtonPushesCount to 0 (zero).
Example Using one button for multiple purposes (waits a second before firing)
Thanks to Arie_J_Godschalk
He created this flow, I used some time to understand and add flowcards
Therefore you will see flow comments that is not needed You need to create a counter called "PushButtonPushesDebounce"
1 Push = ON/OFF
2 Push = Dim 50%
3 Push = Dim 100%
Nice too see!
You can even easily add dim steps, or other actions with a certain no. of pushes.
I realized f.i. my table lights have 3 favorite dim values: 20%, 50% and 100%
So an extra step is simple to add:
IF “PushButtonPushesCount” = 2
THEN (Set light 20%)
IF “PushButtonPushesCount” = 3
THEN (Set light 50%)
IF “PushButtonPushesCount” = 4
THEN (Set light 100%)
I like it!
I made this 3-step-dim-and-off function earlier on with standard flows, and it took me 7 flows. Yes… seven!
Example: A 5-function-sequence-click (pulse) button
2 flows needed
– You can add as much steps as you like! (with respect to Homey’s limits)
Expected functionality:
Clicking within x secs follows the sequence;
Clicking after those x secs, should always turn the light off.
(So no need for remembering how many clicks are needed here).
Sequence:
1st click = dim light to 20%
1st click after x secs = turn light off
2nd click = dim light to 30%
3rd click = dim light to 50%
4rd click = dim light to 100%
5th click = turn light off
You could use H.O.O.P. Flow Variables cards, but I chose to use BetterLogics variables.
NumVar used: Eettafel1btnCount
Chronograph timer used: Eettafel1btnCountTmr
Note, on the BL cards, the zero isn’t shown
Flow 1: The sequence function & steps & timer trigger
Flow 2: The resetting of the Variable
Have fun. Questions, suggestions, improvements welcome!
well… it is a hue motion sensor… all of them i have give the same values inside the house. once outside it goed very high.
0 is pitchblack? that is very weird coz even 1 is not needed to have the light on. and yes, i also thought it is strange but i dont know better…
but i do can change it to a static value, i can also try that… but… the value was this afternoon about 5 and that is higher then 3 so, it should change it… but it doesn’t.