Need advice for creating data for PLEG or Reactor triggers

Good morning,
I’m struggling trying to make a way to execute a decision based upon the position of the sun in the sky. I’ve recently purchased 10 MyIBlinds to control the blinds in my home. I’m going to purchase another 4 in the future, but shelling out a grand for these was enough to get me in trouble. :slight_smile:

The problem I’m trying to solve, is that certain times of day throughout the year, the sun shines right in my face in the morning when I’m still waking up, and into my office in the afternoon when I’m trying to work. This isn’t year round, or every day, just because the nature of solar geometry, time of day for sunrise and sunset, etc. Ideally, I’d love an app that just computed solar azimuth and elevation integrated into Vera, but I wouldn’t even know where to begin. The computations are complex, and I’m not even sure what language I can use to program on the Vera.

So, this leads me to my second thought. There are online calcutors out there that quickly spit out tables for any given day, or even a whole year. I can have a table of CSVs for 10 or 15 minute intervals that provide azimuth and elevation that could be used in my logic to change the angle of my blinds. Is this possible, or would I better off going down the path of developing an app to compute on the fly?

Your answer is the Heliotrope app, by @futzle, which does exactly that.

https://apps.mios.com/plugin.php?id=1348

Wonderful, I’ll check that out. I had just found some Javascript that does the solar calculations, but I wasn’t sure how to integrate into Vera.

Thanks!

Heliotrope is a good start. You may want to try Darksky for tracking the sky conditions - if cloudy, no sense closing up the window coverings. Similarly, light sensors can help with slat control to keep the light fairly constant in the room, especially on blustery and cloudy days when it may be sunny 1 moment, dark the next.

1 Like

I tried something similar a couple of years ago with PLEG but could never get it to work.
I got hopelessly lost in State Variables in trying to get PLEG to step every degree the sun moved across the horizon (out initially, in after the sun was directly overhead but the programming was too involved.
Futzle’s PI was the basis component in making it work.
Interested in how you go?.

I’m not tracking every degree. The variables I’m seeing in PLEG for Heliotrope “Sun azimuth increases past…, Sun azimuth decreases past…, Sun altitude increases past, sun altitude decreases past…” In theory, I should be able to use a combination of solar azimuth and solar elevation, and a series of And’s and Or’s to control the blinds for a specific area of the sky that causes issues, along with Dark Sky, as Phillid2 had suggested (was already planning on that). The hard part may actually be determining what elevation and azimuth I need, as I left my sextant in the Navy :slight_smile:

I like this idea a lot. Has anyone messed around with light sensors to achieve this? If so, which ones did you use?

While I haven’t used these for this purpose, the Sensative Strips are the first one I would try:
https://sensativesupport.zendesk.com/hc/en-us

Check out their ambient light (LUX)/temp sensor. (Just lay in the window or attach to the side.)
I’ve used the door/window strips for over a year, and love them. Battery life looks to be amazing (advertised to be 10 yr).

Be sure to turn off the controller polling and wakeup intervals per their instructions:

I also picked up a few more from zwaveproducts.com (had a very attractive sale price over black-friday and may still be on sale)

These look awesome. Now, to see if they can be purchased in Canada. :expressionless:

Attached is my Kitchen PLEG status report PLEG - Kitchen[303].pdf (135.2 KB) for an example of controlling lights when it is bright enough outside. I have a similar setup for the living room.