Zooper Clock with Time-Accurate Sun/Moon-rise/set

Search This thread

lydonw

Member
May 21, 2012
8
6
This is a project I have been working on for the last couple weeks.

Premise: I wanted to display the current weather conditions and moon phase as an icon, while also putting their position on an arc that represents their position between when they rise and set. I was also not satisfied with existing solutions which used a half circle, as I found the height of the 180 degree arc unpleasant, and wanted something a bit shallower.

Result: This widget displays the time, date, sunrise/set time, current temp, the day's high/low, with current wind speed and direction. These are in a static position. The current moon phase and weather conditions each move along a 120 degree arc, and are shown for the periods at which they are visible. At night a field of stars is displayed with astrological constellations highlighted, roughly accurate to the day of the year (not pictured).

Extension: Using popup widget 2, clicking on the current conditions or current moon phase icon pops up another widget, which displays the weather/moon forecast.

Time & Weather Zooper widget: attached
Weather Popup widet: attached
Moon Phrase popup widget: attached
Popup widget 2: Available on play store (I can't post links yet)
 

Attachments

  • Screenshot_2014-06-23-12-48-40.jpg
    Screenshot_2014-06-23-12-48-40.jpg
    203.1 KB · Views: 1,592
  • Screenshot_2014-06-23-12-48-44.jpg
    Screenshot_2014-06-23-12-48-44.jpg
    209.3 KB · Views: 1,491
  • Screenshot_2014-06-23-12-48-57.jpg
    Screenshot_2014-06-23-12-48-57.jpg
    208.4 KB · Views: 1,518

lydonw

Member
May 21, 2012
8
6
Wanted to provide a few more details.

The advanced parameters for the current weather conditions are as follows:
[ar]160[/ar]
[as]$-60+((120/((#ASH#+(#ASmm#/60))-(#ARH#+(#ARmm#/60))))*(#DH#-#ARH#)))$[/as]

This essentially determines how many hours (in decimals) there will be in the day, which is used to determine how many steps will be necessary to show the sun's arc over 120 degrees. This is then multiplied by the number of hours that have past since sunrise, and sets sunrise at -60 degrees (or the left horizon).


The truly troubling one was setting the Moon's arc, specifically because it is more complicated. This is because the moon can rise and set at vastly different times, the most problematic being when the moon rises before midnight and sets after; this breaks the math I used for the sun, as sunset hour ends up being less than sunrise hour at these times.

The advanced parameters I used for the moon are as follows:
[ar]160[/ar]
[as]$#AMSH#<#AMRH#&&#DH#>#AMRH#?(-60+((120/((24+#AMSH#+(#AMSmm#/60))-(#AMRH#+(#AMRmm#/60))))*(#DH#-#AMRH#)))$
$#AMSH#<#AMRH#&&#DH#<#AMRH#?((120/((24+#AMSH#+(#AMSmm#/60))-(#AMRH#+(#AMRmm#/60))))*(#DH#))$
$#AMSH#>#AMRH#?(-60+((120/((#AMSH#+(#AMSmm#/60))-(#AMRH#+(#AMRmm#/60))))*(#DH#-#AMRH#)))$[/as]

This one is much more complicated, but essentially considers three conditions -

1) Will the sunset be earlier than the sunrise, and is the current time greater than sunrise? If these are true, this tells me that the moon will cross the midnight threshold, but has not yet done so. What follows is a formula similar to the current conditions arc, but adds 24 to #AMSH# to accurately determine how many hours the moon will be in the sky.
2) Will the sunset be earlier than the sunrise, and is the current time less than sunrise? If these are true, this tells me the moon has already crossed the midnight threshold. The previous formula is used, although arc origin is not moved -60 degrees, and the current hour is used to determine location on the arc (#AMRH# is not subtracted from it).
3) Will sunset be later than sunrise? If true, the moon will not cross the midnight threshold and my formula is largely unchanged from that which governs the current weather condition arc.


(hopefully someone finds all of this useful. If there is anything incorrect about this, please let me know)
 

thinker5555

Member
Aug 13, 2014
12
1
Wanted to provide a few more details.

The advanced parameters for the current weather conditions are as follows:
[ar]160[/ar]
[as]$-60+((120/((#ASH#+(#ASmm#/60))-(#ARH#+(#ARmm#/60))))*(#DH#-#ARH#)))$[/as]

This essentially determines how many hours (in decimals) there will be in the day, which is used to determine how many steps will be necessary to show the sun's arc over 120 degrees. This is then multiplied by the number of hours that have past since sunrise, and sets sunrise at -60 degrees (or the left horizon).


The truly troubling one was setting the Moon's arc, specifically because it is more complicated. This is because the moon can rise and set at vastly different times, the most problematic being when the moon rises before midnight and sets after; this breaks the math I used for the sun, as sunset hour ends up being less than sunrise hour at these times.

The advanced parameters I used for the moon are as follows:
[ar]160[/ar]
[as]$#AMSH#<#AMRH#&&#DH#>#AMRH#?(-60+((120/((24+#AMSH#+(#AMSmm#/60))-(#AMRH#+(#AMRmm#/60))))*(#DH#-#AMRH#)))$
$#AMSH#<#AMRH#&&#DH#<#AMRH#?((120/((24+#AMSH#+(#AMSmm#/60))-(#AMRH#+(#AMRmm#/60))))*(#DH#))$
$#AMSH#>#AMRH#?(-60+((120/((#AMSH#+(#AMSmm#/60))-(#AMRH#+(#AMRmm#/60))))*(#DH#-#AMRH#)))$[/as]

This one is much more complicated, but essentially considers three conditions -

1) Will the sunset be earlier than the sunrise, and is the current time greater than sunrise? If these are true, this tells me that the moon will cross the midnight threshold, but has not yet done so. What follows is a formula similar to the current conditions arc, but adds 24 to #AMSH# to accurately determine how many hours the moon will be in the sky.
2) Will the sunset be earlier than the sunrise, and is the current time less than sunrise? If these are true, this tells me the moon has already crossed the midnight threshold. The previous formula is used, although arc origin is not moved -60 degrees, and the current hour is used to determine location on the arc (#AMRH# is not subtracted from it).
3) Will sunset be later than sunrise? If true, the moon will not cross the midnight threshold and my formula is largely unchanged from that which governs the current weather condition arc.


(hopefully someone finds all of this useful. If there is anything incorrect about this, please let me know)


I just wanted to say that this is really awesome. I just got into Zooper last week, and one of the first things I did was to try to create a moon phase widget. I was able to come up with something that works "ok", but it's ugly as sin and could definitely use a lot of improvement. If I have some time, I'm going to try yours out. Also, the explanation on the math and advanced parameters is helpful as I was disappointed that Zooper didn't handle the time math in the way I expected.

Thanks,
Jeremy
 

albosandra

Member
Jul 30, 2008
5
0
I find very interesting your work: it was long expected that a solution like the one you proposed. Thank you. I'm trying to apply your directions, but I trust in your work complete.
 

kemonine96

Inactive Recognized Developer
Jan 27, 2011
1,349
1,288
Michigan
I'm just finding this now and have to thank you very much for the hard work. Looks great, I'm definitely going to be incorporating some of this into my existing Zooper dashboard.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 4
    Wanted to provide a few more details.

    The advanced parameters for the current weather conditions are as follows:
    [ar]160[/ar]
    [as]$-60+((120/((#ASH#+(#ASmm#/60))-(#ARH#+(#ARmm#/60))))*(#DH#-#ARH#)))$[/as]

    This essentially determines how many hours (in decimals) there will be in the day, which is used to determine how many steps will be necessary to show the sun's arc over 120 degrees. This is then multiplied by the number of hours that have past since sunrise, and sets sunrise at -60 degrees (or the left horizon).


    The truly troubling one was setting the Moon's arc, specifically because it is more complicated. This is because the moon can rise and set at vastly different times, the most problematic being when the moon rises before midnight and sets after; this breaks the math I used for the sun, as sunset hour ends up being less than sunrise hour at these times.

    The advanced parameters I used for the moon are as follows:
    [ar]160[/ar]
    [as]$#AMSH#<#AMRH#&&#DH#>#AMRH#?(-60+((120/((24+#AMSH#+(#AMSmm#/60))-(#AMRH#+(#AMRmm#/60))))*(#DH#-#AMRH#)))$
    $#AMSH#<#AMRH#&&#DH#<#AMRH#?((120/((24+#AMSH#+(#AMSmm#/60))-(#AMRH#+(#AMRmm#/60))))*(#DH#))$
    $#AMSH#>#AMRH#?(-60+((120/((#AMSH#+(#AMSmm#/60))-(#AMRH#+(#AMRmm#/60))))*(#DH#-#AMRH#)))$[/as]

    This one is much more complicated, but essentially considers three conditions -

    1) Will the sunset be earlier than the sunrise, and is the current time greater than sunrise? If these are true, this tells me that the moon will cross the midnight threshold, but has not yet done so. What follows is a formula similar to the current conditions arc, but adds 24 to #AMSH# to accurately determine how many hours the moon will be in the sky.
    2) Will the sunset be earlier than the sunrise, and is the current time less than sunrise? If these are true, this tells me the moon has already crossed the midnight threshold. The previous formula is used, although arc origin is not moved -60 degrees, and the current hour is used to determine location on the arc (#AMRH# is not subtracted from it).
    3) Will sunset be later than sunrise? If true, the moon will not cross the midnight threshold and my formula is largely unchanged from that which governs the current weather condition arc.


    (hopefully someone finds all of this useful. If there is anything incorrect about this, please let me know)
    2
    This is a project I have been working on for the last couple weeks.

    Premise: I wanted to display the current weather conditions and moon phase as an icon, while also putting their position on an arc that represents their position between when they rise and set. I was also not satisfied with existing solutions which used a half circle, as I found the height of the 180 degree arc unpleasant, and wanted something a bit shallower.

    Result: This widget displays the time, date, sunrise/set time, current temp, the day's high/low, with current wind speed and direction. These are in a static position. The current moon phase and weather conditions each move along a 120 degree arc, and are shown for the periods at which they are visible. At night a field of stars is displayed with astrological constellations highlighted, roughly accurate to the day of the year (not pictured).

    Extension: Using popup widget 2, clicking on the current conditions or current moon phase icon pops up another widget, which displays the weather/moon forecast.

    Time & Weather Zooper widget: attached
    Weather Popup widet: attached
    Moon Phrase popup widget: attached
    Popup widget 2: Available on play store (I can't post links yet)