Solar Noon QuickApp for Z-Box

Recently I published a Z-Box QuickApp for controlling devices such as window blinds/shades by interfacing to the Bond Bridge. You can find that post here. Along with that app, I use several Block Scenes to drive it: Open All Shades, Close All Shades, Open Kitchen Shade, an so on.

The details…

One of the contributing bits of data used by a couple of those scenes is a trigger based upon a concept called “Solar Noon.” There are plenty of references out there on the 'net where you can learn much more about this topic, but the gist is because the moment of Solar Noon is when the sun passes its zenith or highest location in the sky before it begins its descent toward sunset. As it happens, our house is oriented roughly along a north/south line–so Solar Noon is when the sun exposure occurs on the rear of our house. (It is also the time the front of the house is no longer fully exposed to the sun’s rays.)

If you wish to assist your HVAC system (keep it cooler in summer or warmer in winter), Solar Noon might be a useful way to help automate your window shades, along with temperature, weather conditions, and whatever…

Two ways to install

Simple: Download the .fqa file from the GitHub repository and upload it straight to your Z-Box — no coding required.

Advanced: Grab the Lua source code from the repo if you want to dig in, customize, or modify it for your specific use(s).

Configuration

  • Create a global Custom Event named “eSolarNoon”
  • A Quick App variable named “MinutesOffset” will be created at startup & set
    to zero if not present and may be adjusted by the user (see below).

Usage:

When the “Update” button is pressed, the QuickApp calls the sunrisesunset.io API to look up the local time of Solar Noon for your latitude & longitude. Use a Block Scene to press the “Update” button sometime after midnight when things probably aren’t too busy–a good time to do this might be in a Block Scene that runs at dawn (and may do other housekeeping chores, too) and avoids issues
with transition to/from Daylight Savings Time.

If Solar Noon is in the future, the QuickApp will wait until then. It emits an event (eSolarNoon) to signal any listening Scene to perform actions when Solar Noon occurs. If Solar Noon is in the past, nothing happens. Another scene may trigger on the event–perhaps checking other conditions, as well, such as Home/Away–to cause automations to occur each day at Solar Noon.

The user may optionally set an offset (in minutes) to be applied to Solar Noon the next time it is retrieved by adjusting the slider control.

That’s it! Hopefully some of you find this useful & you’re welcome to share your stories here. If you run into issues or have feature requests, GitHub Issues is the best place to track them — or just reply here. I reserve the right to accept or reject changes, but you’re free to use this code simply as a starting place for your application.

2 Likes