I need to decide about the watering in the sequence and skip or use less water.
I start using classic tensiometer. The camera can take picture of the dial of the gauge and I can download the image (using token and python code) on an external computer.
Now I have python/opencv code reading the value from the dial. I wish to have the readout value available back in a sequence. Not using a pooling method would be great. Is there possibility to run the python script on self hosted farmbot-web-server which I have available ? Or trigger external server from the lua block in a sequence and read the results somehow?
Plus there is still issue with my camera (CSI camera - raspberry version 2) with auto exposition - it overexpose the dial in a sunny day. But I can water the garden in a morning/evening only.
Lua code can fetch objects from a web API and can store and read persistent key-value pairs with the env() function . . can you offer that tensiometer dial reading on a simple REST server ?
If you have an extra computer or Raspberry Pi with a camera on the same network as FarmBot you can try something similar to the Lua HTTP example in the sidecar hardware docs.
If instead you need to use FarmBot’s camera it would require writing code (perhaps using the FarmBot Python library) to fetch images from the FarmBot Web App and process them, and then save the value somewhere a Lua sequence step could pick it up, like value = tonumber(api{url="/api/sensor_readings"}[1].value). If you want to go that route, see listen(), api_post(), and sensor_readings for inspiration.