[Farmware] Loop-Plants-With-Filters

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

install link : 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’ …

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

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 :grinning:

thanks to @Gabriel and @Ascend for farmware script examples

5 Likes

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 :slight_smile:

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

1 Like

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-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-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-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 …

1 Like

Good news, environment variables are persistent after reboot…

But Bad news, not persistent after farmbot_os update

1 Like

Any news @renaud?

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

2 Likes

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-Restore/master/manifest.json

1 Like

This looks great!

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

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?

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)

1 Like

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! …

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

Install link : 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

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?

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

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

working for me this morning

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…

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

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.

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