Gauge for Length of Day (showing Solstices & Equinoxes)


#42

15.7% here in TX right now.

I’m from the UK and I remember the very short winter days (dark on the way to work and on the way home, even at 4pm) and very long summer days (not dark until 10:00pm or later if the weather is good). It was an adjustment living much nearer to the Equator. Our day lengths don’t swing anywhere near as much here in TX.


#43

Just curious, was that 15.7% from earlier today? (once a day piston?)

I would have thought that no matter our location, our numbers would be dead on a match. Although, maybe it only matches on the actual day of the equinox and solstice… Or maybe it is the 0.4% difference because webCoRE only records sunrise and sunset rounded to the nearest minute.


#44

That’s what it’s showing right now. My piston executes at 15s after midnight.


#45

Same as mine, since the sunset and sunrise only changes once a day…

I wonder which of my other two guesses is the reason we don’t match exactly. (I am 15.3%)
I guess it could also be a slight difference in our math…


#46

Yes because I agree, our %ages should be the same.

It’s quite possible that the source data we are using is off slightly too.


#47

I think sunset will differ from location to location because of tilt of the earth. And where you are on the latitude scale. Have a cabin 300 miles to the north of me and sunset is approximately minutes difference. And sunrise is off by 15 minutes.


#48

You are definitely correct, @Gopack2, but the number we were comparing is not comparing sunset or sunrise times. It is (basically) a number from 0-100 where 0 is the shortest day of the year, and 100 is the longest day of the year. So even though the sunrise/sunset happens at different times for all of us, we all hit 0, 50 and 100 on the same day. (winter solstice, equinoxes and summer solstice respectively)


#49

At this moment mine says 15.6% of max, with 10h 00mins of sunlight.


#50

14.9% / 10h 37m


#51

Mine shows 14.9% now too. :sunglasses:

temp


@Alwas, how many decimals are you using in your multiplier?
(I have 17, but I think webCoRE defaults to 6)

If you use too few decimal places, I would expect the percentage would be slightly off…

I guess one other possibility for the slight variation is I scanned thru the next ten years and found the absolute shortest day in December and absolute longest day in June. There wasn’t much difference, but I based my math on the very extreme data points.


#52

On an unrelated note:

For those mathematically challenged, who may have resisted this piston because of it’s complexity, I have good news… I somehow got all that ‘mumbo-jumbo’ into a piston that I can finally share with the public!

For this piston to work for your location, you must change the variables on line 23 & 25.
(instructions are at the very top of the piston)

It runs once a day, and updates the piston state as well as leaves a nice data trail in the logs.
(Also, this piston uses webCoRE’s maximum of 21 decimals for accuracy)

Example output:
temp
(The percentage changes color throughout the year to reflect the amount of sunlight)


If you want one of the gauges as seen above, it should be easy to add the code from one of my earlier posts to the bottom of this piston.

I actually use a different piston to draw my gauges, and simply refer to the percentage created by this piston. If you go this route, you will want to enable the global variable currently disabled & hidden in this picture.
(you will see it if you import vz08)


For those curious, I chose 3:04 am because:

  • It has to run after midnight
  • It has to run before sunrise
  • I wanted it after 3am in case the time changed
  • I added 4 minutes to give ST time to sync with the new time

#53

Placeholder


#54

Why kind of variable should @@dayLengthPercent be? Dynamic? Integer?


#55

Decimal. It is currently set at one decimal in the code

Also, you can reduce to a single @ if you want. I use double because I am spanning across instances


#56

14%20PM

Ok i got the piston working, I just can’t get the tile to display…

AM i missing sometinhg>?

I have the category set to this:

43%20PM


#57

The Title is written a bit differently if you use an expression…

I use Value for Title:
[chart-gauge min=0 max=100 greenFrom=0 greenTo=16 greenColor={colorWinterBegin} yellowFrom=16 yellowTo=84 yellowColor={colorFall} redFrom=84 redTo=100 redColor={colorSummerEnd} minorTicks=6 majorTicks=W..E..S|Daylight]

Everything in curly brackets are variables that I set at the top of the piston, like this:
temp


Part of the Value is cut off in this screenshot:

Also note there is no brackets or quotes in the Text or Footer expression


#58

Alright, I changed the “title” field to “value”…and entered this into that field.

[chart-gauge min=0 max=100 greenFrom=0 greenTo=25 greenColor=DeepSkyBlue yellowFrom=25 yellowTo=75 yellowColor=Green redFrom=75 redTo=100 redColor=DarkOrange minorTicks=6 majorTicks=W.E.S|Seasons]

I still can’t get the tile to display…any suggestions?


#59

Well, is the piston set to only run once a day?
You could temporarily change the time during testing.

Also, I added a bunch of info to my last post might be worth re-reading


#60

Yes, I have been changing the time to run in a minute after I edit it to see if it’s working. I’ll read what you posted.


#61

My piston that draws my gauge has a bunch of code in there that is not ready for the public, so I cannot share the import code, but here is the important code that draws my gauge.

Which returns this tile:

temp

The extra code is there because I wanted brown to be shown in the fall, and green in the spring.
(since half the year the dial moves to the right, and half the year it moves towards the left)