Sun radiation/direction

Posted on
Tue Aug 04, 2015 1:59 am
MarcoGT offline
Posts: 1091
Joined: Sep 11, 2014
Location: Germany

Sun radiation/direction

Hi all,

windows in my flat are towards south and west.
In summer, in North Germany, we have sun till 2245 about.
Is there a way to get the solar incidence/radiation/direction and close/open the shades?

Anyone already tried something?

Thanks

Posted on
Tue Aug 04, 2015 4:01 am
DaveL17 offline
User avatar
Posts: 6741
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Sun radiation/direction

I looked at Weather Underground data, but this doesn't appear to be available via the API. I did find this site which has data for Berlin: NOAA Solar Calculator. It may have data that you can use, or at least point you to something useful.

Cheers,
Dave
Last edited by DaveL17 on Tue Aug 04, 2015 7:37 am, edited 1 time in total.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Tue Aug 04, 2015 6:37 am
MarcoGT offline
Posts: 1091
Joined: Sep 11, 2014
Location: Germany

Re: Sun radiation/direction

Thanks, I will give it a try, but at first look I have not found anything about Hamburg in Germany.

I also found http://pysolar.org/, mentioned also on the forum, but it seems, as already said, too much.

Posted on
Tue Aug 04, 2015 7:36 am
DaveL17 offline
User avatar
Posts: 6741
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Sun radiation/direction

MarcoGT wrote:
Thanks, I will give it a try, but at first look I have not found anything about Hamburg in Germany.

Apologies. It's Berlin and not Hamburg. Would that not be close enough?

I also found http://pysolar.org/, mentioned also on the forum, but it seems, as already said, too much.

That looks really interesting!

Dave

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Tue Aug 04, 2015 1:51 pm
freshwuzhere offline
Posts: 105
Joined: Apr 05, 2012

Re: Sun radiation/direction

You checked out Cynical Weather? It will give you 2 of your 3 requirements for an "orientation device".

http://www.cynic.org/indigo/plugins/online/weather.html

Posted on
Tue Aug 04, 2015 3:03 pm
MarcoGT offline
Posts: 1091
Joined: Sep 11, 2014
Location: Germany

Re: Sun radiation/direction

Very nice, this is basically what I need :) thanks :)

Posted on
Wed Aug 05, 2015 11:22 pm
MarcoGT offline
Posts: 1091
Joined: Sep 11, 2014
Location: Germany

Re: Sun radiation/direction

Yesterday I tried with the Cynical Weather plugin and it works; I get basically and index (one for each window) between 0-100 which indicates "how much sun" I have on the windows.
Now I can play with it to adjust my shades; about that I have a question :mrgreen:

I can do for example

Code: Select all
if index_bedroom > 80
    set shades at 50


But it could also be that later I set the shade manually at 80
At the next evaluation of "index" Indigo will set again the shade at 50 :mrgreen:

I thought I could set a variable "override" and set it to "true" when I moved the shade manually, but I have to modify all my triggers/schedules at setting that variable to "false".
How can I distinguish that the shade was moved by me and not by a schedule/trigger?

Thanks

Posted on
Thu Aug 06, 2015 5:11 am
DaveL17 offline
User avatar
Posts: 6741
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Sun radiation/direction

MarcoGT wrote:
How can I distinguish that the shade was moved by me and not by a schedule/trigger?

You can do it with Python, but does it matter who did what? You could do something like this:

Code: Select all
if index_bedroom > 80 and shade_level < 50:
    set shades at 50

But what might even be a bit easier is if you can come up with a simple ratio for index to shade level--say:

Code: Select all
shade_level = index_bedroom - 30
new_shade_level = lambda(shade_level): (abs(shade_level) + shade_level) / 2

if new_shade_level < current_shade_level
    set shades at new_shade_level

which lets you use one block of code to evaluate every shade condition (the second line--the one with Lambda--ensures that new_shade_level is never a negative value.

Dave

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Thu Aug 06, 2015 5:57 am
MarcoGT offline
Posts: 1091
Joined: Sep 11, 2014
Location: Germany

Re: Sun radiation/direction

DaveL17 wrote:
You can do it with Python, but does it matter who did what? You could do something like this:

Code: Select all
if index_bedroom > 80 and shade_level < 50:
    set shades at 50



Well, this cannot work always (if I am not missing something)
If for example index > 80 and shade < 50, the action is triggered and shade is set at 50
But then, my wife sets manually shade at 40, the Indigo set it again at 50, am I missing something?
Last edited by MarcoGT on Thu Aug 06, 2015 6:20 am, edited 1 time in total.

Posted on
Thu Aug 06, 2015 6:17 am
DaveL17 offline
User avatar
Posts: 6741
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Sun radiation/direction

Ah. I misunderstood.

Do your shades report back a status change when someone moves them manually?

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Thu Aug 06, 2015 6:22 am
MarcoGT offline
Posts: 1091
Joined: Sep 11, 2014
Location: Germany

Re: Sun radiation/direction

DaveL17 wrote:
Ah. I misunderstood.

Do your shades report back a status change when someone moves them manually?


Yes, at least if with "status change report" it means that Indigo logs something.
In logs there is the changing of value (0=totally close-100=totally open)
But I think it is hard to understand who did the change, if my wife or Indigo due to trigger/schedule

Posted on
Thu Aug 06, 2015 6:55 am
MarcoGT offline
Posts: 1091
Joined: Sep 11, 2014
Location: Germany

Re: Sun radiation/direction

Yes, yestarday I started to implement it with variable on auto/manual (or true/false)
What was missing is the schedule :)
You gave me the hint, thanks a lot :)

Posted on
Thu Aug 06, 2015 7:05 am
DaveL17 offline
User avatar
Posts: 6741
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Sun radiation/direction

Sorry--I hit 'submit' instead of 'preview'. :) Here's one way you can accomplish this.

    Create a variable that represents a manual override of the shade level. This can be whatever you want (true/false), (manual/auto), etc.

    Create a schedule that resets this variable to automatic mode at midnight or whenever.

    Create a trigger that changes the value of this variable to manual if a change in shade level is reported.

    Create a trigger that sets the shade level based on the radiation index only if the override variable doesn't indicate a manual override.

Each day would start with the shades in automatic mode. If someone manually changes a shade, the mode would switch to manual mode for the rest of that day. You could add additional logic based on other events (i.e., if you set your status from 'home' to 'away', resume automatic mode). You might need to put in a slight delay on the setting of the variable by the radiation trigger to account for confirmations (i.e., if Indigo changes the shade level and then the device reports back it's confirmation of the action.)

I'm not sure that I'm being clear--does that all make sense?

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest