App Parameters
Expose configurable parameters to users without building a full web UI. Define a form using env-template.yml and IronFlock renders it automatically.
When to Use Parameters
Use parameters for simple configuration that users need to adjust per device or per group:
- Sensor recording intervals
- Data endpoint URLs
- Alert thresholds
- Feature toggles
- API keys and credentials
For more complex configuration (robot training, camera AI setup, hardware configuration), build a custom Edge User Interface instead.
Defining Parameters
Create an env-template.yml file in the .ironflock/ directory:
RECORDING_INTERVAL:
label: "Recording Interval (seconds)"
defaultValue: 5
type: numeric
optional: true
ALERT_THRESHOLD:
label: "Temperature Alert Threshold (°C)"
defaultValue: 80
type: numeric
optional: true
API_ENDPOINT:
label: "Data API Endpoint"
defaultValue: "https://api.example.com/data"
type: text
optional: true
ENABLE_DEMO:
label: "Enable Demo Data"
defaultValue: true
type: boolean
optional: true
DATA_FORMAT:
label: "Output Format"
defaultValue: "json"
type: select
options:
- json
- csv
- xml
optional: true
SECRET_KEY:
label: "API Secret Key"
defaultValue: ""
type: text
secret: true
optional: trueParameter Types
| Type | Rendered As | Example |
|---|---|---|
text | Text input field | URLs, names, keys |
numeric | Number input | Intervals, thresholds |
boolean | Toggle switch | Feature flags |
select | Dropdown menu | Predefined options |
How Parameters Reach Your App
Parameters are injected as Linux environment variables in your container:
Python
import os
interval = int(os.environ.get("RECORDING_INTERVAL", 5))
threshold = float(os.environ.get("ALERT_THRESHOLD", 80))Large Parameters
Parameters exceeding 20 KB are not set as environment variables due to system limitations. Instead, all parameters (including large ones) are always available as files:
/data/env/PARAMETER_NAME.txtDevelopment Mode
The defaultValue specified in env-template.yml is used when running the app in development mode. This provides a consistent development experience without requiring manual parameter configuration.
Mass Parametrization
When parameters are set at the device group level, they apply to all devices in the group simultaneously. This is ideal for:
- Setting a common S3 bucket across all data collection devices
- Updating AI model parameters project-wide
- Changing sensor configurations for an entire production line
Parameters can be set even when devices are offline — they are applied when the device reconnects.