Hi all,
I’ve been having an issue lately with my watering sequence that I would love some help with.
I wrote a watering sequence for my garden (written in the end) that goes through each plant and retrieves its water curve, age and dispenses the appropriate amount of water, and another sequence that executes that on the group variable “all plants”. It works just fine most of the time yet every now in then it will get stuck on a random plant, toast an error and quit the sequence, giving up on watering the next crops.
The errors:
{:lua_error, {:illegal_index, nil, “day”}, {:luerl, {:tstruct, %{0 => {:table, {:array, 0, 10, nil, 10}, {{{{{{:empty, “_G”, {:tref, 0}, :empty}, “_VERSION”, "Lu
I made sure all plants have a planting date, and since it is working most days I’m confused about what the error could be. Any thoughts? Thank you!
plant = variable(“plant”) – has an externally defined variable named “plant”
move_absolute(plant.x - 50, plant.y, -300) – compensate for water nozzle size on x axis
if plant.water_curve_id and plant.age then
water_curve = get_curve(plant.water_curve_id)
water_ml = water_curve.day(plant.age)
dispense(water_ml)
else
toast(plant.name … " at location (" … plant.x … ", " … plant.y … “) has no assigned water curve/age. Watering 100ml”, “warn”)
dispense(100)
end
wait(2000)