Grazing Plan Module Brainstorm

There is a local university to me that was looking for ag related projects they can have students work on for their capstone project this fall. I had proposed to them they build the farmOS grazing module similar to the v1 module. I got notice today that the school is looking to move forward with this project and will assemble a team of computer science and animal science students to complete this module in the Oct-April simester.

This is all very exciting! On that note what does the community want to see in a grazing module? If you have input on features let me know. I will start to compile a list as I sit down and work with the student team.


This is awesome @BOTLFarm! I know there are others interested in these features, so I would love to help in any way I can. I may be able to carve out some time during their semester to provide support/guidance and bring other stakeholders together.

1 Like

Some quick thoughts… based on the lessons I learned from the v1 grazing module:

  • The v1 module was built very strictly to mimic the Savory Holistic Management techniques, because that is what our sponsor wanted. If I were to approach this again, I would have made a simpler and more generalized Grazing module, and a separate Savory-specific module as a layer on top of that. There are a lot of things in the v1 Grazing module that could be omitted in a general grazing module IMO. It might be worth reviewing and outlining exactly what that module added, and take a pass at conceptually teasing them apart into two lists.
  • At the core, I think a grazing plan needs two types of entities:
    1. A plan entity of type grazing, which represents the plan as a whole, and:
    2. A set of plan_record entities of type grazing_event (or something like that), which represents a period of time that a set of assets (group or animal) are in a certain location (both a location asset reference and a unique geometry).
  • A grazing_event data structure would represent the planned grazing event and might look like this:
    • plan - references the plan that the event is a part of
    • log - references the activity log that will represent the actual movement of the assets, which includes:
      • timestamp - the actual movement timestamp
      • asset - references the animal / group asset(s) that are being moved
      • location - references the land asset that they will be in during the event
      • geometry - the specific geometry of the planned grazing event
    • start - a timestamp representing the planned start date/time
    • duration - how long the animals will be in this place
    • recovery - how long the grass will need to recover after the animals leave
  • A grazing plan could then be visualized in a Gantt style where each row is a grazing_event, showing the period of time that the animals are in a place, and the period of time after they leave that is needed for recovery.
  • It would be great to reuse the same Gantt chart code that we’ve started developing in the Crop Plan v3 module. @paul121 and I talked about splitting some of that out into a reusable library that we include with farmOS core, so that other module (including core modules) could make use of it in other contexts. If we are able to do that before these students get started, they would be able to leverage that to use the same Gantt visualization for paddock rotations.

Perhaps a good question to help spark more conversation is: what would folks like to have in terms of “planned” vs “actual” data? What is most useful to be able to look back on and learn from, assuming that things always change? :slight_smile:

1 Like

Thanks for the layout @mstenta!

My thought exactly V1 was usable but in some ways too complicated. One of my favorite functions in the v1 module was to plan my rotations then if I made a modification (moved the animals faster, or they were in a paddock longer) then it would adjust the entire schedule looking forward.

It has been a while since v1 but I remember it being messy with multiple groups of animals in different places, following different schedules, and different paddock rotation patterns. Hopefully we can figure out a cleaner way to manage different groups. Maybe they are just different sub plans for of a seasonal grazing plan.

I think recording the actual day in, day out and calculated length of time is critical data to display. Along with a stats on how long a particular paddock has been in recovery, especially if this can be represented by the different groups or species. IE. recovery from sheep group has been 20 days and recovery form chickens group it has been 15 days.

Pasture conditions when they were moved in and out would be nice also. This could be forage height, photo, or a notes section, etc.

It would be cool to see how the schedule changed over time as the season moved on. Maybe a slider on the gantt chart to view planned moves as the year progressed.


Good day @BOTLFarm & @mstenta,

It is great that this topic is back under discussion.

I have fall in the temptation of modifying on the fly the ‘grazing plan’ by editing the original ‘plan’ values with the ‘actual’ ones. The immediate reward was that the rest of the plan accommodated straight in behind of the last ‘actual’. However, the trap was set and at the end of the season I realized I couldn’t compare the planned with the actual, because the plan was swamped only with ‘actual’ data. Therefore, I think a good system has to run both in parallel: ‘plan’ and ‘actual’

A digital set of recent ‘actual’ data is good for answering current important questions, such as in the case of an on-farm audit: the auditor requiring further detail on a matter and the farmer providing a fast answer showing that he is in control of his records, which is something the certification body needs to see happening to know there is a paper trail in case a complain or an outbreak arises. That’s all very obvious.

However, when it comes to using the data that has been gathered for years for improving the business, what questions one has that, if answered with all the keyed-in data, will lead to doing so? I find this is the difficult bit.

Sometimes I find myself with lots of accurate records great for ‘data mining’ and still waiting for a genius to appear with the a posteriori golden question that will revolutionize the business :slight_smile:

Then, I think it would be great if first professor/students attempt to define questions they wish answered with the data they will collect, before they set themselves to modeling and coding a grazing plan module.

I am keen to help in doing so.


Yes! That was handy. :slight_smile:

Yea I think we should keep each plan relatively simple, and just encourage the use of multiple plans. So if you need to manage multiple herds, you just need to use multiple plans. Rather than making individual plans complicated.

The main consideration, I think, is that the recovery time of a paddock needs to take into account planned grazing events across plans. Not just the events in the plan you’re currently looking at. That wouldn’t be too hard to query. The only question it might raise is: what happens if you want to “experiment” with some different options by creating multiple “potential” plans side-by-side, before ultimately choosing which one to go with. In that case you wouldn’t want them all interacting or adding to the recovery time calculations. But maybe that can be solved simply with a new plan status. In addition to active and archived, maybe we have another status called planning or something like that. And then we only use active plans in the cumulative recovery time calculation? :thinking:

Oh yes that would be great. This was something that the v1 Grazing module provided, IIRC: a hard-coded list of animal types, with some stats about dry matter intake requirements on each that contributed to the calculations.

Agreed! I think this could be a new quick form, which creates observation logs. It could even be useful outside of the Grazing plans… and make it available from within the plans.

1 Like

Great point @Guillermo. I do think it’s important to keep that distinction.

And the approach we’ve taken with the Crop Plan v3 module is a good example of how we can accomplish that, I think! In a Crop plan, the “planned” seeding date, days to transplant, days to maturity, and days of harvest are stored on the plan itself. But the asset’s logs are used to record the “actual” information, and both are displayed in the same Gantt chart.

I think we could accomplish the same thing with grazing events, by showing both the “planned” periods and the “actual” locations of the animals. I can already imagine how that might look. Maybe we can do some whiteboard sketches on a future dev call and take some screenshots for this thread. :slight_smile:

1 Like

I believe it did this and based calculations on herd weight (or individual animal weight), which was not always practical to have.

I think this is useful in some situations but in many of my situations it starts to look like the overly complex v1 plan. For example when I graze pigs and chickens I don’t particularly care about the dry matter intake they are getting form pasture, I just want a certain amount of time on a particular pasture. But with my sheep and goats dry matter intake is useful, but can be really hard to calculate in a silvopasture paddock, so if this is a requirement it may not be flexible enough for every days use.

Multi species grazing this becomes complicated very fast on seperate plans if you can’t see what the other species are doing. I want recovery periods not only for plant/soil health but also for parasite reasons. For example I want my small ruminants to graze a paddock first for 12-32 hours (depending on the paddocks size and condition) followed by a minimum of 5 day rest, followed by chickens for 1 day. I want total rest period after my small ruminants to be 45 days for parasites before the small ruminants return, but it only needs a minimum of 30 plant recovery after my chickens, or whichever is longer. If I happen to move pigs thought that paddock in the meantime then I would want a 40 days recovery for plants as they do more damage before ruminants move back.

For me a lot of planning is manual as i think it may be to complex and too many moving parts to automate it all based on recovery times. But if recovery times of all species were displayed together then manual planning becomes easier. Maybe this means when in the sheep plan I can see an overlay of the other species. Hmm… but if i need to make an adjustment to the other species then im jumping between plans. Maybe each season is a plan and you can add “tabs” to jump between each species. Switching tabs just activates the species you want to work on. Just some ideas.

Gantt is nice, maybe overlay on maps also? I don’t necessarily follow the same pattern each time around the farm.


Yea, and I’m not a fan of hard-coding the list of animal types.

This also raises the bigger question: how do you calculate recovery time? That was the main output of all the pre-data that needed to be entered in v1… which is why the actual “Roations” tab was the last thing you saw in v1. It makes sense from a planning perspective… but I wanted that to be up front and center. :slight_smile:

But if we started with an MVP (minimum viable product) of manually entering a recovery time (based on all the knowledge you already have in your head @BOTLFarm), then that gets the bare minimum job done… and that could then be automatically filled by one (or more) “recovery time recommendation” algorithms in the future as a next step (but also always allowing manual entry/override).

Start simple and trust that the farmer knows best. :slight_smile:


FYI I’ve started a module!

Barely begun… definitely not ready for use. But I’m starting to make decisions, so I want to share with this thread and ask for input…

I’m sketching up the initial data architecture based on my comment above, and have a question for the group…

How should we model the data types for start, duration, and recovery?

Based on what I’ve heard (from @BOTLFarm in this thread, and when I was working on the old Grazing module), we will want to allow rotations that are less than 1 day in duration. In other words, some operations move a herd multiple times in one day.

With that in mind, I think start needs to be a timestamp, so that it can capture time as well as date. Maybe we can hide time via UI/UX magic for folks who don’t need that granularity, but it needs to be there in the data model for those who do.

What about duration? Should that be an integer? What granularity should we capture? Is “hours” granular enough? Again, we can handle things on the UI/UX side for folks who only deal in days/weeks, but from a data model perspective we need to decide the minimum granularity right now.

Same question for recovery. Grass only grows so fast, so I imagine “days” is granular enough for this one?

Does that all make sense? Am I overlooking possibilities or excluding anyone’s use cases with those assumptions?


Farms running an ABC robotic milking platform will change paddocks 3 times per day.

Block Recommended gate times Setup new wire Last cow leaving paddock @ % Breakdown of daily allocation
A 2am-10am 5-6pm 5-6pm 40
B 10am-6pm 7-9am 12-2am 40
c 6pm-2am 7-9am 8-9am 20

Paddock system would look something like this.

Info borrowed from here:

Recovery times for a paddock I’d imagine should be in days, usually about 15-20 days here.

Are you including grass measurements for all paddocks in your module?

  • Current Cover
  • Pre Grazing yield
  • Residule cover

I’m on board with hou you defined start and duration @mstenta. There are occasions when I do a super dense mob grazing for 30 minutes in a spot but as far as my records go this is overkill on data and grazing to the hour is enough for.

Depending on how recovery gets used in application I can see the possibility of wanting to define it in hours. This may be me thinking how to force a system that is not built yet to do something different then it is designed, but hours may be useful in a multi species grazing situation where you want to graze species one then species two 12 hours behind. Not a good use of the term recovery but just thinking of ways people may want to use it and keeping things flexible.

+1 to the grass measurements @Farmer-Ed!


I’m not sure I’d define that as a recovery though?

Maybe you need a different min pre-grazing yield per livestock type?

Should recovery be measured in time at all or rather actual grass measurements? As recovery time can vary hugely but a target pre-grazing yield is more definite.


Agreed! I’m just thinking back to the V1 module and the types of things I had to do to make it work for my situation.

As far as recovery time vs pre-graze height, I typically graze tall and leave lots of residue behind. I look at recovery time from a parasite load lense more than a grass height lense, so for me time is more important most of the year. But of course have to take into consideration pre-graze height.

Intensive grazing is a hard thing to predict and plan for in a lot of situations.


I never used the V1 module, but I don’t think we should be limited to what it had either. But I guess it makes sense as a starting point.

Producing a graph showing available grass versus demand would also be a nice to have but maybe that could be provided by a separate module either.

1 Like

I don’t have a horse in this race (or pasture as it were), but I think I’d argue for not choosing aggressively coarse time units at the data-model level.

Simplifying the input and display so users generally don’t have to type/see the minutes and seconds should be a separate concern IMHO.

It’s not hard to imagine scenarios where folks want to know the difference between planned and actual timing. At scale, I’m imagining that the cumulative effect of moving grazing animals 15 minutes early every day could be non-negligible over a season. Presumably, you’d miss that detail if you were forced to round the number of hours up or down at data input time.


In practical grazing terms, I’m honestly finding it hard to think of too many scenarios where finer granularity then an hour for grazing or day for recovery would be useful, but not opposed to finer granularity either if it’s likely to suit others.

Could just be my Irish timekeeping showing though.


Thanks for all the input @Farmer-Ed @BOTLFarm @Symbioquine!

Great thoughts regarding recovery, and the different ways of calculating it. On that note, I want to emphasize that right now (early data model design), I’m only concerned with what needs to be stored in the database. How that gets calculated (manually, based on other data like grass height, etc) can be figured out later. That can be a UI/UX concern, I think.

As stated earlier in this thread:

Regarding grass measurements…

In farmOS v1, the “Animal Movement” quick form included options for recording grass height before/after movements. We generalized that quick form to be applicable to any asset type in v3, and removed those options. But I’m imagining a new quick form specifically for pasture condition observations, which could potentially be used in tandem with this Grazing Plan module in the future, perhaps as an input to some kind of “suggested recovery time” calculation.

The v1 module was based very strictly around the Savory Holistic Grazing method, which is one way of calculating recovery time. I think that method could be provided as an add-on option on top of all this, potentially. But for now we just want to lay some groundwork that is unopinionated in that regard.

I’m redesigning this new module from scratch, and trying to be as simple as possible with it. The primary goal right now is to define the data model, with maybe some minimal UI/UX work. @BOTLFarm might be working with some students this coming fall to pick up from there and focus more on the UI/UX.

In my mind, the minimum data model just needs to represent a “grazing plan” with a set of “grazing events”, that define the grazing duration and recovery of each geometry. With this, we can then render a timeline visualization similar to the one that we built in the crop plan recently. And notably, each “grazing event” will link to a movement log that represents the actual movement. So we can use logs for the actual and these grazing events (aka plan_record entities) to store planned info like planned start date, duration, and recovery).

From there, the sky is the limit for next steps! This first pass just lays the initial data architecture, but then everything else can be about additional UI/UX for data entry, recovery calculation, pasture observations, etc etc etc. This module will primarly be concerned with grouping and visualizing the events.

From what I’m hearing, “days” seems to be an appropriate granularity for recovery time. However, I also see @Symbioquine’s point that from a data model perspective it doesn’t really need to be limited, and could potentially be stored in “hours” or “seconds” in the database. This might be overkill most of the time. There is also something nice about consistency between all of the values (start, duration, and recovery), though, if we were to just store them all in seconds (start is a timestamp so it’s always in seconds anyway). But seconds does feel like extreme overkill, so maybe a good balance is to just model both duration and recovery in hours, so at least those two are consistent? The more I think about it, it feels weird for duration and recovery to have different units. Especially if you consider a third-party application that wants to modify these via the API. Consistency at the data model level is better for DX.

1 Like

We had a great discussion on the monthly call today about this. I showed a rough sketch of a timeline visualization of grazing events that I’m working on and we talked about the current data model and potential scenarios and use-cases. I didn’t take notes but I’ll add comments here as I remember things… :slight_smile:

One interesting thought that came up at the very end (actually after most people left): do we even need to store duration? Or can we just visualize it based on when the “next” movement log out of the paddock is?

One benefit of omitting duration from the data model is that it’s one less thing to manage and keep updated. You could, for example, simply drop a log in between two other events and it would automatically adjust the visualization of durations.

The benefit of storing duration is that it captures the “planned” duration of the event. Without it we only have the “actual.” So I don’t think I’ll remove it for now, but wanted to make note of these ideas…


I just finished up the “quick sketch” that I showed on the call earlier, and wanted to share some screenshots to keep the conversation going.

These show two ways of visualizing the same grazing events: by the asset being moved, and by the location they are moving to.

I want to emphasize that this is a very simple sketch, primarily to validate the data model, and to see if it can accommodate everything we want. This is far from usable, and a lot of it was able to be sketched up quickly by copying and modifying code from the Crop Plan module. But all of the “next steps” will require more development work. Hopefully we can get this to a place where students can pick it up and run with it to work more on the UI/UX next…

There are a few things missing that I might try to knock off quick (and then this might be ready for others to start testing):

  • Allow editing grazing events by clicking on them in the timeline (similar to Crop Plan).
  • Show the movement log as a dot, to differentiate the “planned” from “actual” event.

We also discussed an idea on the monthly call that would be really useful for a number of reasons: show all logs associated with the Asset/Location on its row (above the grazing event rows). For example, if you have other logs associated with the “Sheep Herd 1” asset, they would show as dots for quick reference in the timeline.

1 Like