I have been looking for some time now for a way to make the blinds automatically move with the sun angle, but without success.
I started logging manually by setting the angle each time so that no direct sunlight comes in, but this is impossible and the flows become too long…
I use the app (Zonnestanden App voor Homey | Homey) already for the azimuth and altitude, but I am looking for a calculation that takes into account the dimensions of my blinds.
When the sun shines on the blinds at an angle, the length of the slats changes, which becomes longer and so the angle of the slats must also change.
As your slats most likely have a just a few positions, you might as wel experiment with these few positions, depending upon the actual altitude of the sun. Like a lookup table.
By the way, I don’t think that azimuth is important for the position of the slats. See Azimuth - Wikipedia. The azimuth does define during which hours of the day the slats shall be lowered. This is defined by 2 values, one for in the morning as the slats shall be put down and one value for when the slats shall be raised. You can calculate this 2 values from the orientation of your house in relation to the sun (azimuth) or by measuring this value in the real world.
Shouldn’t the slats always be perpendicular to the sun rays? As in that case they block the sun rays optimal? So depending upon the way you measure the position of the slats, the slats position is (90 decrees minus altitude) or equals the altitude.
Well, that is a complicated way of controlling the slates. To me the ideal positioning of the slats is when as much as possible lights come in, but no direct sunlight comes in.
The biggest challenge for me was determining when to turn on the shading on individual windows and when to turn it off. The position of the sun doesn’t even play that big of a role here. An important thing is the internal temperature and solar contributions to understand whether to prioritize or block solar contributions. Every day is different and every day has different solar contributions, so it’s not that easy. I have abandoned the implementation of shading according to the position of the sun.
Regarding the positioning of my venetian blinds, I didn’t go into too much detail, I chose one position and always set to that position.
That is also difficult, but I have already completed the part when I want to keep the sun out in a flow.
The only thing I’m looking for is a calculation that the slats just keep the sun out based on the position of the sun.
I initially thought this would be quite simple by calculating the height of the sun. But unfortunately the angle is very different if the sun is not directly in front of the shutters.
So the calculation must take into account the azimuth and altitude of the sun.
Just suppose the sun is at a certain position, and the slats are closed enough to keep the sun out. Then imagine you rotate your house. Then you don’t need to reposition your slats, as the rotation of the house is parallel to the slats. The same is true when not your house rotates but the sun. So the position of the slats is independent of the azimuth and equals the altitude, ie always perpendicular to the sun.
The azimuth does determine the time the slats shall be lowered or raised. As your hous faces 187, the slats shall be lowered between (187-90) and (187+90).
It is true what you say that the sun does not change in height. What does change is the width of the slat when the sun shines on the window at an angle. When the slat becomes wider, the angle must be adjusted again.
I just don’t understand your reasoning. Might be due translations problems.
If you make the angle of the slats equal to the altitude, you almost have the ideal solution. As d is almost L. Even when d equals L the sun would still be blocked.
So when L is a litle bit more then D, the angle of the slats could be a little bit less then the altitude, but I don’t think that is a great difference.
I think you could Chatgpt a homey script for this..
If I have difficult scenarios then I use Chatgpt with instructions:
Context Description:**
This script is designed to fetch data from a specified API endpoint, extract a particular value from the API response, and use that value to create a tag in your system.
The script sends a request to the API endpoint and expects the API to respond with a text response. The script then processes this response to extract the required data. This extracted data is then used to create a tag in your system.
If the tag creation is successful, the script returns a success message indicating the name of the tag and the value used. If an error occurs during the tag creation or during the fetch request to the API, the script returns an error message detailing the error.
This script is designed to be run in a Homeyscript environment and assumes that a tag function is available in your environment for tag creation.
Generic Script:
// Define your API endpoint
var apiEndpoint = 'https://your-api-endpoint';
// Fetch data from the API
return fetch(apiEndpoint, {
method: 'POST', // or 'GET', depending on the API
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: 'your-request-body' // if needed
})
.then(response => response.text())
.then(async text => {
// Extract the value you're interested in
var lines = text.trim().split('\n');
var lastLine = lines[lines.length - 1];
var value = lastLine.split(',')[yourValueIndex]; // replace 'yourValueIndex' with the actual index of your value
// Create the tag with the extracted value
try {
await tag('Your Tag Name', value);
return 'Created tag: Your Tag Name, value: ' + value;
} catch (error) {
return 'Error creating tag: Your Tag Name, error: ' + error;
}
})
.catch(error => 'Error fetching data from API: ' + error);
In this template, replace https://your-api-endpoint with the actual API endpoint you’re using, 'your-request-body' with the actual request body if you’re making a POST request, yourValueIndex with the actual index of your value in the last line of the API response, and 'Your Tag Name' with the actual name of the tag you’re creating.