Thought I'd open a new thread (old thread link) on this driver because there has been some recent interest and I've accepted a merge request which added SVG and Emoji outputs to the driver.
Available via HPM or github at https://raw.githubusercontent.com/thebearmay/hubitat/refs/heads/main/moonPhase.groovy
Driver can be set to automatically refresh image at sunset or be used on demand for the current or a requested date/time (yyyy-MM-dd HH:mm:ss format).
Outputs are:
- HTML with an image suitable for dashboard display
- Link to image only
- Phase Emoji
- Generated SVG image (which should be closer to the "live view" than the static images)
6 Likes
Excellent! And thanks as always for your amazing apps and drivers.
A few observations worth noting:
-
The moonPhaseSvg graphic draws the calculated moon phase at 18x higher resolution (compared with traditional lunar charts**) thus should more closely reflect actual viewing conditions at any given time. This <SVG> output should be directly usable within a (classic) Dashboard tile of type Attribute (thus works with remote connections).
-
The moonPhase attribute can now be used more easily to trigger (or restrict) rules, since its preset values will appear as a pick list – instead of typing free-form text:
-
Ditto the moonPhaseEmoji values, which (also being Strings) are well suited for use in custom Notifications:
**This essentially means the SVG graphic should update every ~4 hours vs. the standard 3.5 days!
1 Like