We’re using a few flows that are managing our main roller blind in the living room. We life in a older house facing a street with a lot of bicycles and pedestrians that could always easily look into our living room. Besides that, we have the morning sun on our front window that’s heating up the house from sunrise till about noon.
What we’re building
Using multiple variables we are building a flow system that’s rolling our blinds up and down using time and the amount of light that’s coming in. In our case we use one roller blind but you can add as many as you wish.
In our case, we use three heights: 20%, 60% and 100% closed. I think it’s more ‘homey’ () when the blinds are not fully open but stay at a 20% height as ‘open’. The 60% is used when there is more light coming OR it’s getting dark outside (lower your blinds a bit) OR it’s getting late in the evening. The 100% closed is used when the sun is very bright and hot soo it keeps the heat out.
What we need, the requirements
In order to build these flows you need a couple of things.
- A Homey (ofcourse )
- A roller blind or curtain motor of any kind
- A light sensor
- A variable ‘Rolgordijn’ (or anything you like) that’s set numeric
In our case we use a TUYA based motor. There are a lot of tube roller blinds that you can build into your system. In our case this wasn’t a option because the tube is very large and we couldn’t find the right motor for this but also our system is build into the wall (don’t know how to explain it) soo we can not make it wider with a build in motor.
This is why I choose for a motor that is rotating the cord of the roller blind. I was a little bit sceptical about this motor but it has been running for about 18 months now and without any problems. I must say that the price went up pretty hard haha, when I bought it I paid 45,00 euro’s and now it’s almost 90,00 euros. However, this is the device that I am using:
For the light sensor I placed a Xiaomi Mijia Light Sensor bought on AliExpress. I find these sensors very stable, they never lost signal and the first battery is still inside and working just fine.
Last, the variable. In previous versions of these flows I sent the calculated height directly to the roller blinds. The problem is that when we came home and the roller blinds were down, it took the system a while before it started calculating and roll them up.
With this variable we are going to do two things; write the new calculated height (even when the whole house is turned off and nobody is home) and read the height when somebody is home or is coming home. This way we always have the right height set.
Ofcourse you have to make sure that the sensor is placed in front of the roller blind / curtain some how soo that it gives the right amount of light even when the blinds are down!
Counting the actions, making sure it’s not going up and down
In the summer there might be a situation that the blinds are going up and down up and down, in order to make sure this isn’t happening I am experimenting with a roller blind counter and a few extra flows. This is still in beta testing soo I am not going to write this all down. Once I am sure this is working fine, I will add a comment below explaining what I did here.
The first flow: calculating the right height
Let’s start building the first flow. First we are going to calculate the right height the roller blind should be in. Please notice that the given amount of LUX might be different in your situation. I suggest you take my numbers first and see what will happen. If this is not giving you the results you’ve wished for, you could change these figures while testing. More about this below!
Oké soo let’s have a look at what I did here. We are going to trigger this flow every 1 minute. The sensor value will update almost live, but this is fine. Once the value is updated the roller blind will move to the desired height and if we do it live the blind may get a new value every X seconds, soo a minute is fine!
In this flow we are first looking at; are we going to put it on an 20% or 60% height?
When the brightness of the light sensor is below 500:
It’s getting dark outside, let’s lower the blinds. We’re not a live television for people walking by .
When the brightness of the light sensor is above 22000:
There is many sunlight coming in, let’s block this sun and keep it cool.
When the the time is passed 20:00 o’clock in the evening:
It is getting light. Specially in summertime this will kick in. It’s not dark enough the close the roller blind but we do not want it to stay up in the evening.
If one of the above kicks in, we will enter the first ‘Then…’ flow cards. Here you’ll find three actions; set the logic to 60 (60%), start a flow for ‘too much morning sun’ (more about that later) and start the flow that sets the 60% height. If none of the above is giving a positive outcome we will head into the ‘Else …’ part which has similar actions except the morning sun flow card.
This flow runs every 1 minute regarding you are home or not. Soo every 1 minute the variable in logic is set to the desired height, even when you’re not at home. Below you’ll find the flows for doing the actual magic, which will focus on you being home. In other words; not at home? Only set the variable. At home? Set the variable and do the magic. All in one flow!
The second flow: there is too much morning sun
This flow is optional. If the blinds you are programming are setup in a direction were you have full sun sometimes you might end up using this flow as well. This one will calculate if it’s more useful to close the roller blinds all the way soo the sun is blocked and your home stays cool.
As a trigger we use ‘If this flow is started’. Scroll back up to the calculation flow, there you’ll see that this flow will be triggered once the calculation hits the 60% value.
In the ‘And …’ part we’re going to check some extra variables. If the outside temperature is higher then 20 degress celcius and if the brightness of the sensor is above 40000 LUX. This combination of values is important; only light will result in roller blinds going all the way down when some sort of lightsource hits the sensor and the amount of sun is only important when it’s warm outside. In other words, if the lightsensor kicks in in winter time for some reason it will not trigger.
Now we are going to set the height to 100% and set the variable to 100. The number stored in the variable is needed for future changes in the height.
I am using the TUYA based roller blind motor as shown above. I am using scenes to roll it up or down. Why? Please look at this post:
The last flow about the history is needed for the beta part were it checks how many times the roller blind went up and down. More about that in a future comment.
Please check the first flow. The flow to check for a strong morning sun has a 5 seconds delay. This is very important because Homey might end up hitting only 60% because the calculation is done at the exact same time. Put some time between them!
The third and fourth flow: rolling them up and down!
Soo now it’s time to really roll them up and down. We have a calculated number, we triggered these flows within the calculation and now it’s time to really do the trick.
There are two flows here; one flow for the 20% height and one for the 60% height. Look in the first flow that calculated the height for a explanation about how to call for them.
Okay soo there are no important triggers here, just a ‘when this flow starts’. This way it will run when I start it from another flow. An extra here is that you can reset the height of the blinds when you have overwritten them in an earlier stage. Run both these flows and see which one kicks in because it has the right variables to do soo!
Next let’s look at the ‘And …’ part:
The house must be turned on
This is the part of ‘is somebody actually at home?’. We use a full house trigger with a virtual device. More information about how and why here:
We are not watching a movie in theater modus
Soo when theater modus is activated our blinds are put in a 80% modus and the lights are dimmed. Once this is active we do not want the calculation to kick in; ‘please leave us alone!’ . More information about our theater modus here:
What about the privacy modus?
Soo we have a privacy mode built into Homey. This modus let’s the house act like nobody is home. Sometimes useful. I have not written a tutorial about this soo I can not add a link .
The variable must be exactly 20 or 60!
This is the part were we are looking for the calculated figure. If the numeric variable is 20, the 20% flow kicks in. Is it 60? Then the 60% flow kicks in! Sounds easy, right?
Ignore the last variable, its still in beta!
Soo once every ‘And …’ has met it’s requirements, the scene for the desired height is triggered. For more information about TUYA scene triggers, scroll back up!
Searching for the right numbers …
It may be possible that you wish that the roller blinds use different numbers to change the height with. In my opinion this is the best way to do this:
- When the moment comes you are not satisfied with the height in combination with the sun, open your Homey app and press and hold the sensor device.
- Look what the amount of LUX currently is. Let’s say it’s set at 3374 LUX (just a random number I come up with); try to set a more logical to work with soo for example use 3250 here or even 3000.
- Go back to the calculation flow and set the new numbers.
The blinds need to go down earlier, it’s already to dark:
Change the ‘Brightness is lower than 500’ part in my first calculation flow, changing 500 in your desired number based on the number the light sensors gives you.
Ofcourse this also works the other way around, for example the roller blinds need to go down on a later moment and you wished it stays up longer.
The sun is too bright already, I wished the 60% kicks in earlier:
Change the ‘Brightness is higher than 22000’ part in my first calculation flow to your desired figure. Use the number the light sensor is giving you.
This also works the other way around, for example you think the 60% kicks in too early and you wish it stays up to 20% longer!
It’s burning hot here! The blinds need to go down to 100% faster!
Open the flow that calculates the hot morning sun, head to the ‘Brightness is higher then 40000’ and change this to the desired figure based on your sensors value.
Also this works the other way around. If the roller goes down to 100% and you think it needs to stay up, change this number as well!
In the summer I want it to stay open much longer/shorter!
Once the required bar of 500 is not reached fast enough (normally in summertime, when the daylight stays until 10 or 11 o’clock in the evening) you may wish to lower your blinds when it’s evening. Mine is set to 20:00 but you can change it to anything you like in the first calculation flow, set ‘Or the time is later than 20:00’ to your desired time.
That’s all folks!
Soo that’s all I have here for now. Hopefully this will help you build your own flows. For any questions or tips, feel free to comment!