Sensor Data: Storage & Query

Great questions @walt!

The short answer is: sensor data is stored in an SQL database(* by default), so you are only limited by what an SQL database can store/manage - which is a lot. The amount of data you described shouldn’t be a problem at all.

You can find more information about using the farmOS Sensor module and API here: https://farmos.org/guide/assets/sensors/

Now for a more nuanced answer: farmOS takes the same modular approach with sensors as it does with everything else. It comes with two module: Farm Sensor (which provides the basic “Sensor” asset type), and Farm Sensor: Listener (which defines a “Listener” sensor type). Sensor assets can have a “type”, which extends how they work, and what they can do. The Listener type provides a very simple API endpoint for each sensor asset that accepts data points posted to it via HTTP requests (see docs linked above). It stores these in a database table that the Listener module provides: https://github.com/farmOS/farmOS/blob/7.x-1.x/modules/farm/farm_sensor/farm_sensor_listener/farm_sensor_listener.install#L12

With regard to querying the data that a Listener sensor stores in the SQL database, there are a few options. If you are self-hosting farmOS, and you have direct access to the database, you can perform raw SQL queries on it. Alternatively, you can query the sensor data via API requests as well (see docs linked above). You can also download the data from a sensor as a CSV (with optional date range filtering) through the farmOS UI (this is essentially what you described as a read-only view, except that it is through the UI, not SQL directly).

For most use cases, this listener will work fine. If you have a use-case where this simple approach won’t meet your needs, the next option is to create your own sensor type. When you do this, you can take whatever approach you want to data storage, API surface, and presentation. You don’t have to use the default farmOS SQL database if you don’t want to. You could push into a different system entirely. See these two threads for some more info/ideas: