Adjusting Z as plant grows

I have a pressure reducer but the watering nozzle seems to dump a lot of water in large dropplets. To avoid too much unwanted damage and washing away, I lower the Z height. But as the plant grows I need to raise the Z height. What is the best way to set this in the sequencer for plants as they grow at different rates

@chrisb Generally speaking, I just change the offset of the plant away from the base as it grows (since roots will be more established and able to absorb water without being directly over the plant). Have you tried using the OFFSET option yet?

What sort of plant are you growing right now? There might be other options available, although I’ve not encountered this issue before in my own garden (water pressure is not too high in my locality).

@chrisb every Plant has X, Y and Z coordinate attributes. You could edit relevant plants in the Plant Editor as they grow. (caveat : I haven’t tested this yet in any sequence to make sure that a MOVE to a plant point uses all three axes)

I have v1.2 farmbot, maybe that water head design is not ideal for the pressure being provided. I have purchased a different pressure reducer to see what happens with water flow.

I currently have a watering sequence execute by a group with a manually overridden Z axis value for the height offset.

How do I use external variables as values in a sequence to adjust individual values. I’d like to be able to call a common watering sequence or method but with different watering times heights, distances etc

@chrisb I think the “OFFSET” attribute will do what you want:


It is possible to set “plant height” as a NUMERIC value, but the only way to access the value is via Lua.

You could then use the variable by typing =variable("MY_VARIABLE_NAME") into the “Z” field of the MOVE block. Please let me know if you hit any issues and we can help you find alternatives.

Thanks, that is what I needed.
Do the variables in a sequence have a different scope to the parent/child sequence

@chrisb Variables in sequences follow lexical scoping rules. A variable is only visible if it was declared at the top of a sequence and is not passed down to child sequences. If you need global variables or a variable that is shared with many sequences, you should consider using environment variables:


You can then access the variable via:

tonumber(env("PLANT_HEIGHT") or "0")

Things to keep in mind:

  • All ENV values are strings. If you want to store numeric values, you will need to convert the string to a number type using Lua’s tonumber() function.
  • ENV vars might return a null value, so it’s important to write code in a way that can handle missing values.
  • Documentation for the env() helper can be found here.