When you have to deal with a lot of plants you might be puzzled that you have to create a dedicated sequence for each instance of a plant. For example: if you have 10 carrots - you probably need to create a watering sequence for every carrot individually.
The idea is to write a loop that executes needed sequences for each eligible plant.
Meta data fields require specially formatted input. In Python it is called "list of tupple pairs". Here is the example:
[ ( ‘key1’, ‘value1’ ) , ( ‘key2’, ‘value2’ ) ]
You can use whatever you want as a ‘key' and ‘value’ as long as they are strings. More than one element in the list allows you to filter by multiple criteria and update multiple meta data at once! Put "None" if you want to skip metadata feature.
There are special keys and values with special meaning:
Seed all "planned" Carrots and mark them "planted"
- FILTER BY PLANT NAME: Carrot
- FILTER BY META DATA: [('plant_stage','planned')]
- INIT SEQUENCE NAME: Pickup seeder (or whatever the name you have)
- SEQUENCE NAME BEFORE NEXT MOVE: Pickup a seed
- SEQUENCE NAME AFTER MOVE: Plant a seed
- END SEQUENCE NAME: Return seeder
- SAVE IN META DATA: [('plant_stage','planted')]
Please note that if you interrupt this sequence and restart it - it won't start seeding again from the beginning because already seeded plants are marked as "planted" and won't be selected again in the next run.
Water all "planted" Carrots that have not been watered today
- FILTER BY PLANT NAME: Carrot
- FILTER BY META DATA: [('plant_stage','planted'), ('last_watering','!today')]
- INIT SEQUENCE NAME: Pickup watering nozzle
- SEQUENCE NAME BEFORE NEXT MOVE: None
- SEQUENCE NAME AFTER MOVE: Water light
- END SEQUENCE NAME: Return watering nozzle
- SAVE IN META DATA: [('last_watering','today')]
Delete all meta data from all plants (does not affect plant_stage)
- FILTER BY PLANT NAME: *
- FILTER BY META DATA: None
- INIT SEQUENCE NAME: None
- SEQUENCE NAME BEFORE NEXT MOVE: None
- SEQUENCE NAME AFTER MOVE: None
- END SEQUENCE NAME: None
- SAVE IN META DATA: [('del','*')]
Delete watering tag from all plants that were watered today
- FILTER BY PLANT NAME: *
- FILTER BY META DATA: [('last_watering','today')]
- INIT SEQUENCE NAME: None
- SEQUENCE NAME BEFORE NEXT MOVE: None
- SEQUENCE NAME AFTER MOVE: None
- END SEQUENCE NAME: None
- SAVE IN META DATA: [('del','last_watering')]
Sets up the date when the plants were planted
- FILTER BY PLANT NAME: Carrots
- FILTER BY META DATA: [('plant_stage','planted')
- INIT SEQUENCE NAME: None
- SEQUENCE NAME BEFORE NEXT MOVE: None
- SEQUENCE NAME AFTER MOVE: None
- END SEQUENCE NAME: None
- SAVE IN META DATA: [('planted_at','2018-04-01') #YYYY-MM-DD
Intelligent watering tries to solve a problem that watering shall depend of:
To engage iWatering mode you need to provide AFTER sequence name that has 'water' and 'mlh' in it (For example: "Water [MLH]"). This sequence shall be doing the following
It can also do whatever you want, the only important part is "waiting" The idea is that Farmware will update the "waiting" duration basing on its understanding of how much water this particular plant needs. Note: My assumptions about this may be different from yours - if you are not happy with it - fork my project and help yourself.
Weather reading is taken from my other farmware "Netatmo". Please note that MLH doesn't call Netatmo explicitly. I recommend to create a sequence like "Water All" and call Netatmo and MLH from there one after another.
iWatering skips the watering today if:
IMPORTANT: The amount of watering is calculated basing on plant's age - make sure your planted_at date is set correctly. See above for example.
Algorithm to calculate the amount of watering:
If you want to provide custom sequence for watering of your particular plant name - call it so it has 'water', 'mlh' and