<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Greenly Garden</title>
    <description>The latest articles on DEV Community by Greenly Garden (@greenly_garden).</description>
    <link>https://dev.to/greenly_garden</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4261351%2Fc868380a-7d7e-4b33-b9d6-248946062445.png</url>
      <title>DEV Community: Greenly Garden</title>
      <link>https://dev.to/greenly_garden</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/greenly_garden"/>
    <language>en</language>
    <item>
      <title>How we turn 10 years of weather into a planting calendar</title>
      <dc:creator>Greenly Garden</dc:creator>
      <pubDate>Mon, 23 Nov 2026 20:35:16 +0000</pubDate>
      <link>https://dev.to/greenly_garden/how-we-turn-10-years-of-weather-into-a-planting-calendar-57h6</link>
      <guid>https://dev.to/greenly_garden/how-we-turn-10-years-of-weather-into-a-planting-calendar-57h6</guid>
      <description>&lt;p&gt;Seed packets usually say something like "sow indoors 6-8 weeks before the last frost". That's good advice, but it assumes you know when your last frost is. Most gardeners don't. A national chart gives a single date for a whole country, and a backyard in the hills can be weeks behind a city garden on the coast.&lt;/p&gt;

&lt;p&gt;For our Android app, Greenly Garden, we wanted every date to come from the weather where the user actually gardens. This post walks through how that works.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Ten years of daily minimum temperatures
&lt;/h2&gt;

&lt;p&gt;For the user's coordinates we request &lt;code&gt;temperature_2m_min&lt;/code&gt; for the last 10 years from the Open-Meteo Archive API, which serves ERA5 reanalysis data. It's free and needs no key.&lt;/p&gt;

&lt;p&gt;ERA5 comes on a grid, so the value is for the centre of a grid cell, not for your exact backyard. In our checks the cells ran a little warmer than city weather stations. Even so, that's far closer than a national average.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Last spring frost and first autumn frost
&lt;/h2&gt;

&lt;p&gt;For each year we find:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the &lt;strong&gt;last spring day&lt;/strong&gt; with a minimum below 0 °C (we use January-June)&lt;/li&gt;
&lt;li&gt;the &lt;strong&gt;first autumn day&lt;/strong&gt; with a minimum below 0 °C (July-December)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the southern hemisphere the halves are swapped. Exactly 0 °C doesn't count as a frost.&lt;/p&gt;

&lt;p&gt;Then we take the &lt;strong&gt;median across the years that had a frost&lt;/strong&gt;. The median matters: one freak cold snap in May shouldn't shift every tomato in the plan by three weeks. If a location had no frost in any year, the date is simply &lt;code&gt;null&lt;/code&gt;, and the calendar treats it as frost-free.&lt;/p&gt;

&lt;p&gt;Some example results:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Kyiv: last frost around April 5, first frost around November 9&lt;/li&gt;
&lt;li&gt;Valencia: last frost around January 15, no autumn frost&lt;/li&gt;
&lt;li&gt;Singapore: frost-free&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. When does the soil warm up?
&lt;/h2&gt;

&lt;p&gt;Frost isn't the only limit. Beans, cucumbers and squash sit in cold soil and rot. So we also pull &lt;code&gt;soil_temperature_0_to_7cm_mean&lt;/code&gt; for the same years.&lt;/p&gt;

&lt;p&gt;For every whole-degree threshold from 0 to 20 °C we find the first day of the warm half-year when the 7-day average reached it. Again we take the median across the years. A crop card can then say "needs 12 °C soil", and the engine looks up that day.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. From climate to tasks
&lt;/h2&gt;

&lt;p&gt;The calendar engine is plain Kotlin with no Android dependencies, which makes it easy to unit-test. The core rules:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Planting out in open ground:&lt;/strong&gt; the later of &lt;em&gt;last frost + 7 days&lt;/em&gt; and &lt;em&gt;the day the soil reaches the crop's minimum temperature&lt;/em&gt;. Frost-tolerant crops go out 21 days &lt;em&gt;before&lt;/em&gt; the last frost.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unheated greenhouse:&lt;/strong&gt; 21 days earlier than open ground.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Indoors (windowsill):&lt;/strong&gt; no seasonal limit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sowing seedlings:&lt;/strong&gt; planting-out date minus days to transplant minus days to germination.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pricking out:&lt;/strong&gt; emergence plus days to pricking.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Expected harvest:&lt;/strong&gt; emergence plus days to harvest (10% shorter in a greenhouse).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the harvest on open ground would land after the first autumn frost, the plan shows a warning instead of quietly promising tomatoes in November.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Small details that turned out to matter
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Caching:&lt;/strong&gt; the profile is stored on the device, keyed by coordinates rounded to 0.25°, so the calendar and reminders work offline.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real life is late:&lt;/strong&gt; if you mark a task done later than planned, the following tasks are recalculated from the date you actually did it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rain counts as watering:&lt;/strong&gt; an outdoor watering reminder is skipped if at least 5 mm of rain fell in the last 24 hours.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Users know best:&lt;/strong&gt; frost dates can be overridden by hand.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What we'd tell anyone building something similar
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Use the median, not the mean or the extreme.&lt;/li&gt;
&lt;li&gt;Treat "no frost" as a real answer (&lt;code&gt;null&lt;/code&gt;), not as a missing value.&lt;/li&gt;
&lt;li&gt;Make the hemisphere a first-class input from day one.&lt;/li&gt;
&lt;li&gt;Keep the date logic pure and unit-tested; it's the part users trust or don't.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Greenly Garden is on Google Play: &lt;a href="https://play.google.com/store/apps/details?id=com.greenly.app" rel="noopener noreferrer"&gt;https://play.google.com/store/apps/details?id=com.greenly.app&lt;/a&gt;. The website is &lt;a href="https://greenly.garden/" rel="noopener noreferrer"&gt;https://greenly.garden/&lt;/a&gt;. The calendar and reminders are free.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Weather data by Open-Meteo.com (CC BY 4.0).&lt;/em&gt;&lt;/p&gt;

</description>
      <category>android</category>
      <category>kotlin</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
