# \[Farmware\] Loop-Plants-With-Filters

**URL:** <https://forum.farmbot.org/t/farmware-loop-plants-with-filters/3167>\
**Category:** Farmware\
**Created:** [February 8, 2018, 9:12pm UTC](https://forum.farmbot.org/t/farmware-loop-plants-with-filters/3167 "2018-02-08T21:12:03Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![renaud](https://forum.farmbot.org/letter_avatar_proxy/v4/letter/r/dc4da7/32.png) [@renaud](https://forum.farmbot.org/u/renaud)\
**Post date:** [February 8, 2018, 9:12pm UTC](https://forum.farmbot.org/t/farmware-loop-plants-with-filters/3167/1 "2018-02-08T21:12:03Z")

</div>

For my first planting next spring …  
I missed the loop feature …  
I made this first farmware and share it with you.

Loop plants with filters, execute sequences and save meta data (v 6 min)

see for details : [https://github.com/rdegosse/Loop-Plants-With-Filters/blob/master/README.md](https://github.com/rdegosse/Loop-Plants-With-Filters/blob/master/README.md)

install link : [https://raw.githubusercontent.com/rdegosse/Loop-Plants-With-Filters/master/manifest.json](https://raw.githubusercontent.com/rdegosse/Loop-Plants-With-Filters/master/manifest.json)

For example:  
Loop all carrots just added in farmdesigner (1 day) for planting it then save plant ‘status’ to ‘planted’ …

 ![image](https://forum.farmbot.org/uploads/default/original/2X/0/0e8adbfd73a2e06946063f8b855bb3371e17f4c1.png)

For example:  
Loop all plants with status ‘planted’ for watering

 ![image](https://forum.farmbot.org/uploads/default/original/2X/f/f9d2407972534b97e0d383ba2c033ff56b8bd598.png)

be careful with the meta data to save: this can interfere with other farmwares. I have to test if some builtin farmware does not delete the information.  
this farmware does not remove meta data but always adds to existing ones if you use unique keys (this should be the rule)

report issues in gitHub

I look forward to the input variables in command ‘run farmware’ into sequences 😀

thanks to @Gabriel and @Ascend for farmware script examples

---

<div class="post-metadata">

**Author:** ![Ascend](https://forum.farmbot.org/letter_avatar_proxy/v4/letter/a/a9adbd/32.png) [@Ascend](https://forum.farmbot.org/u/Ascend)\
**Post date:** [February 9, 2018, 7:30am UTC](https://forum.farmbot.org/t/farmware-loop-plants-with-filters/3167/2 "2018-02-09T07:30:23Z")

</div>

Oh lord, this one looks great!  
We can use this to plant seeds or water existing plants with such a low effort. Now that we can use the meta data, we could even group plants by adding the same meta data.

Code looks great and really clean. Keep up the work, can’t wait to see more ideas and farmwares 🙂

> [@renaud](#):
>
> I look forward to the input variables in command ‘run farmware’ into sequences 😀

This would help to run these tasks automatically. I think someone recently made a feature request about that.

---

<div class="post-metadata">

**Author:** ![renaud](https://forum.farmbot.org/letter_avatar_proxy/v4/letter/r/dc4da7/32.png) [@renaud](https://forum.farmbot.org/u/renaud)\
**Post date:** [February 9, 2018, 9:43pm UTC](https://forum.farmbot.org/t/farmware-loop-plants-with-filters/3167/3 "2018-02-09T21:43:41Z")

</div>

it appears that the ‘run farmware’ command in the sequences use the parameters created in the 'Farmwares tab page.  
at this point I do not know where the parameters are stored, but if my analysis is good it is stored in the environment variables of farmbot\_os and I do not know if it is persistent after reboot (if someone can validate ???)

I copied some farmware with a suffix 01, 02, 03 …  
and so now it’s possible to run this farmware with different parameters and use them in the sequences.  
this duplicates the farmware but it’s a workaround and it does the job …

[https://raw.githubusercontent.com/rdegosse/Loop-Plants-With-Filters-01/master/manifest.json](https://raw.githubusercontent.com/rdegosse/Loop-Plants-With-Filters-01/master/manifest.json)  
[https://raw.githubusercontent.com/rdegosse/Loop-Plants-With-Filters-02/master/manifest.json](https://raw.githubusercontent.com/rdegosse/Loop-Plants-With-Filters-02/master/manifest.json)  
[https://raw.githubusercontent.com/rdegosse/Loop-Plants-With-Filters-03/master/manifest.json](https://raw.githubusercontent.com/rdegosse/Loop-Plants-With-Filters-03/master/manifest.json)  
[https://raw.githubusercontent.com/rdegosse/Loop-Plants-With-Filters-04/master/manifest.json](https://raw.githubusercontent.com/rdegosse/Loop-Plants-With-Filters-04/master/manifest.json)  
[https://raw.githubusercontent.com/rdegosse/Loop-Plants-With-Filters-05/master/manifest.json](https://raw.githubusercontent.com/rdegosse/Loop-Plants-With-Filters-05/master/manifest.json)  
[https://raw.githubusercontent.com/rdegosse/Loop-Plants-With-Filters-06/master/manifest.json](https://raw.githubusercontent.com/rdegosse/Loop-Plants-With-Filters-06/master/manifest.json)

after reflecting for the ‘run farmware’ command in the sequences, i think the simplest and best way to implement is to create a farmware configuration manager with multiple configurations for a single farmware and in the sequences: have 2 drop-down menus in the ‘run farmware’ command: 1 with the farmware reference, 1 with the config reference  
And if everything is stored in the database it’s even better …

---

<div class="post-metadata">

**Author:** ![renaud](https://forum.farmbot.org/letter_avatar_proxy/v4/letter/r/dc4da7/32.png) [@renaud](https://forum.farmbot.org/u/renaud)\
**Post date:** [February 9, 2018, 9:53pm UTC](https://forum.farmbot.org/t/farmware-loop-plants-with-filters/3167/4 "2018-02-09T21:53:10Z")

</div>

Good news, environment variables are persistent after reboot…

But Bad news, not persistent after farmbot\_os update

---

<div class="post-metadata">

**Author:** ![Klimbim](https://forum.farmbot.org/user_avatar/forum.farmbot.org/klimbim/32/1240_2.png) [@Klimbim](https://forum.farmbot.org/u/Klimbim)\
**Post date:** [February 18, 2018, 6:23pm UTC](https://forum.farmbot.org/t/farmware-loop-plants-with-filters/3167/5 "2018-02-18T18:23:10Z")

</div>

Any news @renaud?

---

<div class="post-metadata">

**Author:** ![stevegraham](https://forum.farmbot.org/letter_avatar_proxy/v4/letter/s/b3f665/32.png) [@stevegraham](https://forum.farmbot.org/u/stevegraham)\
**Post date:** [February 25, 2018, 10:06am UTC](https://forum.farmbot.org/t/farmware-loop-plants-with-filters/3167/6 "2018-02-25T10:06:41Z")

</div>

Fantastic! Thanks very much for this. It’s working well and made the Farm Designer much more fun to use.

---

<div class="post-metadata">

**Author:** ![renaud](https://forum.farmbot.org/letter_avatar_proxy/v4/letter/r/dc4da7/32.png) [@renaud](https://forum.farmbot.org/u/renaud)\
**Post date:** [March 10, 2018, 1:14am UTC](https://forum.farmbot.org/t/farmware-loop-plants-with-filters/3167/7 "2018-03-10T01:14:20Z")

</div>

user\_env are used to store input value for farmware  
because user\_env are not persistent after farmbot\_os update or factory reset.

i writed theses 2 farmware for Backup And Restore user\_env :

variables are stored in an active tool named BACKUP\_USERENV by default.  
!!! you must to create this tool and add it to a slot prior to backup/restore !!!

it’s a workaround waiting user\_env stored in database…

[https://raw.githubusercontent.com/rdegosse/Userenv-Backup/master/manifest.json](https://raw.githubusercontent.com/rdegosse/Userenv-Backup/master/manifest.json)  
[https://raw.githubusercontent.com/rdegosse/Userenv-Restore/master/manifest.json](https://raw.githubusercontent.com/rdegosse/Userenv-Restore/master/manifest.json)

 ![image](https://forum.farmbot.org/uploads/default/original/2X/8/826ebf563edc529cfc4fa25905ef2f6a0d0a191a.png)

---

<div class="post-metadata">

**Author:** ![r.kadnem](https://forum.farmbot.org/letter_avatar_proxy/v4/letter/r/5fc32e/32.png) [@r.kadnem](https://forum.farmbot.org/u/r.kadnem)\
**Post date:** [March 13, 2018, 5:51pm UTC](https://forum.farmbot.org/t/farmware-loop-plants-with-filters/3167/8 "2018-03-13T17:51:50Z")

</div>

This looks great!

It will totally eliminate the “hard” way of creating a watering sequence! Great work!

---

<div class="post-metadata">

**Author:** ![stevegraham](https://forum.farmbot.org/letter_avatar_proxy/v4/letter/s/b3f665/32.png) [@stevegraham](https://forum.farmbot.org/u/stevegraham)\
**Post date:** [May 10, 2018, 7:36am UTC](https://forum.farmbot.org/t/farmware-loop-plants-with-filters/3167/9 "2018-05-10T07:36:06Z")

</div>

Hi R et al,

I’ve just completed a full planting using the Loop-Plants-With-Filters. I planted the entire bed: carrots, leeks, corriander, pak choy, lettuce.

Thanks again for creating this. Soooo easy!

I did notice it didn’t change the status of the plants to “planted” in the Farm Designer. I tried SAVE IN META DATA : KEY = “status” and SAVE IN META DATA : VALUE = “planted” but they still say “planned”. After looking at the debug json, I also tried SAVE IN META DATA : KEY = “plant\_stage” but it didn’t work either. Do you know the correct meta data key and values for the Status field (planned, planted, harvested) in the Farm Designer?

 ![Screenshot from 2018-05-10 17-20-43](https://forum.farmbot.org/uploads/default/original/2X/4/4304f7140b769a2bb1c607e3277a065a7bde61dc.png)

---

<div class="post-metadata">

**Author:** ![renaud](https://forum.farmbot.org/letter_avatar_proxy/v4/letter/r/dc4da7/32.png) [@renaud](https://forum.farmbot.org/u/renaud)\
**Post date:** [May 10, 2018, 8:03am UTC](https://forum.farmbot.org/t/farmware-loop-plants-with-filters/3167/10 "2018-05-10T08:03:22Z")

</div>

Hi steve,  
happy to read this  
it’s currently in test with more functionaly, i release a new version very soon.  
(it s not a meta data, it’s a plant property)

---

<div class="post-metadata">

**Author:** ![stevegraham](https://forum.farmbot.org/letter_avatar_proxy/v4/letter/s/b3f665/32.png) [@stevegraham](https://forum.farmbot.org/u/stevegraham)\
**Post date:** [May 13, 2018, 6:29am UTC](https://forum.farmbot.org/t/farmware-loop-plants-with-filters/3167/11 "2018-05-13T06:29:17Z")

</div>

Oh okay great. It’d be good to be able to set the plant status because then, if the routine is interrupted half way, it can restart by filtering only those that haven’t been planted.

I’ve set up the next Loop-Plants-With-Filters to do all the watering so I’ll kick that off now and see how it goes! …

---

<div class="post-metadata">

**Author:** ![renaud](https://forum.farmbot.org/letter_avatar_proxy/v4/letter/r/dc4da7/32.png) [@renaud](https://forum.farmbot.org/u/renaud)\
**Post date:** [July 13, 2018, 3:22pm UTC](https://forum.farmbot.org/t/farmware-loop-plants-with-filters/3167/12 "2018-07-13T15:22:18Z")

</div>

i just released a new version v1.0.2 of this farmware with new functionnalities :

filter by coordinates, filter by plant stage, metadata filters operators , list of sequences instead of unique sequence, set plant stage, add offset X,Y when moving

details are in : [https://raw.githubusercontent.com/rdegosse/Loop-Plants-With-Filters/master/README.md](https://raw.githubusercontent.com/rdegosse/Loop-Plants-With-Filters/master/README.md)

Install link : [https://raw.githubusercontent.com/rdegosse/Loop-Plants-With-Filters/master/manifest.json](https://raw.githubusercontent.com/rdegosse/Loop-Plants-With-Filters/master/manifest.json)

Loop-Plants-With-Filters-01,02,03… farmwares will be deleted since input values can be now multiple and set directly in a sequence

---

<div class="post-metadata">

**Author:** ![adimw](https://forum.farmbot.org/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@adimw](https://forum.farmbot.org/u/adimw)\
**Post date:** [April 11, 2019, 8:53pm UTC](https://forum.farmbot.org/t/farmware-loop-plants-with-filters/3167/14 "2019-04-11T20:53:39Z")

</div>

Has anyone else found that this farmware has stopped working in the past 7 days or so? My farmbot picks up the watering tool, then when it goes to run the LPWF farmware… it E-stops?

---

<div class="post-metadata">

**Author:** ![Ascend](https://forum.farmbot.org/letter_avatar_proxy/v4/letter/a/a9adbd/32.png) [@Ascend](https://forum.farmbot.org/u/Ascend)\
**Post date:** [April 12, 2019, 7:38am UTC](https://forum.farmbot.org/t/farmware-loop-plants-with-filters/3167/15 "2019-04-12T07:38:54Z")

</div>

Doesn’t work for me either, probably not compatible with python 3.

---

<div class="post-metadata">

**Author:** ![CoutancesNature](https://forum.farmbot.org/letter_avatar_proxy/v4/letter/c/3be4f8/32.png) [@CoutancesNature](https://forum.farmbot.org/u/CoutancesNature)\
**Post date:** [April 12, 2019, 12:43pm UTC](https://forum.farmbot.org/t/farmware-loop-plants-with-filters/3167/16 "2019-04-12T12:43:37Z")

</div>

Hello everyone !  
At home, it still works (Great job, Renaud ! Thank you !)  
But, like Steve said, I can not change the status to “planted”.

---

<div class="post-metadata">

**Author:** ![adimw](https://forum.farmbot.org/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@adimw](https://forum.farmbot.org/u/adimw)\
**Post date:** [April 14, 2019, 7:03pm UTC](https://forum.farmbot.org/t/farmware-loop-plants-with-filters/3167/17 "2019-04-14T19:03:59Z")

</div>

working for me this morning

---

<div class="post-metadata">

**Author:** ![Klimbim](https://forum.farmbot.org/user_avatar/forum.farmbot.org/klimbim/32/1240_2.png) [@Klimbim](https://forum.farmbot.org/u/Klimbim)\
**Post date:** [April 20, 2019, 12:03pm UTC](https://forum.farmbot.org/t/farmware-loop-plants-with-filters/3167/18 "2019-04-20T12:03:51Z")

</div>

Did you use a wildcard in the plant name? @ascend found that if you name the plant it works but if you just leave a wildcard it won’t work…

---

<div class="post-metadata">

**Author:** ![adimw](https://forum.farmbot.org/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@adimw](https://forum.farmbot.org/u/adimw)\
**Post date:** [April 20, 2019, 9:01pm UTC](https://forum.farmbot.org/t/farmware-loop-plants-with-filters/3167/19 "2019-04-20T21:01:40Z")

</div>

I’m using a wildcard and it’s been fine for the last few days

---

<div class="post-metadata">

**Author:** ![Klimbim](https://forum.farmbot.org/user_avatar/forum.farmbot.org/klimbim/32/1240_2.png) [@Klimbim](https://forum.farmbot.org/u/Klimbim)\
**Post date:** [April 21, 2019, 11:58am UTC](https://forum.farmbot.org/t/farmware-loop-plants-with-filters/3167/20 "2019-04-21T11:58:47Z")

</div>

Which version are you using of MLH? You can see it when you click on the MLH at the farmware page and then it should show up on the right side.

---

<div class="post-metadata">

**Author:** ![Ascend](https://forum.farmbot.org/letter_avatar_proxy/v4/letter/a/a9adbd/32.png) [@Ascend](https://forum.farmbot.org/u/Ascend)\
**Post date:** [April 21, 2019, 12:29pm UTC](https://forum.farmbot.org/t/farmware-loop-plants-with-filters/3167/21 "2019-04-21T12:29:48Z")

</div>

> [@Klimbim](#):
>
> Which version are you using of MLH?

This thread is about the Farmware “loop plants with filters”. You probably, mixed something up right? 😃

[Next page](https://forum.farmbot.org/t/farmware-loop-plants-with-filters/3167.md?page=2)
