Shades by Sun position (Azimuth and elevation)

I recently bought shades for my house… I used Lutron (RA2 select) and they added well into hubitat and homeassistant.

The app allows you to time the shades, but sun moves around quite a bit, so I’ve been working on automating them based on azimuth and elevation. The Sharptools Rules has worked really nicely for me as I’ve never coded before and the visual approach was very helpful.

  • The website Suncalc was super helpful at estimating azimuth. The rest will be by observing real world conditions.

  • Both HA and Hubitat have devices which give sun position in azimuth and elevation.
    -Still experimenting with conditions to avoid dropping the shades on cloudy days. Options are Illumence value in some weather devices (I didnt think was very accurate), actual LUM sensors (I’ve ordered but still waiting on arrival), Cloudiness percent value on some weather devices (using OWM on hubitat).

  • I have battery powered shades, so i wanted to limit the requests sent the shade to only when movement is required. I found virtual switch in hubitat to be super useful for this.

  • Current setup had 4 Rules

  1. If Azimuth changes and is > (starting value for that window) With conditions of (azimuth < exit value for that window AND Elevation > 0 AND elevation <40 (depending on window) AND Cloudiness < 95%) then turn virtual switch to ON.
  2. If Virtual switch changes to on set shade percent to value (this should be the only communication direct to the shade to drop (instead of every 5 minutes telling it to stay at the same level).
  3. If azimuth > exit value of that window change virtual switch to OFF.
  4. If virtual switch changes to off, then raise shade.

Additionally, I have made an additional rule that of reported cloudiness > 95% to turn all switches to off (would raise shades if weather changes and becomes 100% cloudy during the time shade was down.

Any suggestions are welcome. I’m really impressed w/ the Rules machine for someone very new to all of this.