Dynamic Shading Value?

Is there any way to update the shading value by date?

For around 8-9 months of the year my shading is 0. However for about 6-7 weeks either side of the shortest day (22 June here in NZ) I get shading (From a single Totara tree in the paddock next to my panels) till around mid-day. e.g.

is there a handy script anywhere to dynamically update the shading value based on date?