💾 Interfaces
Configuration

Configuration Files

How to configure the automation

The file at config/config.json is used to configure the whole automation. A template file at config/config.template.json can be used to create a new configuration file.

📁 config
├── 📄 config.json
└── 📄 config.template.json

This file can be loaded from anywhere in the codebase with the following code snippet. The only process that should change this file is the updater (or a human). The config file only has to be loaded once on startup because whenever the updater changes it, the whole automation will be restarted.

import src
 
config = src.types.Config.load()
print(config.version)  # prints "0.1.0"

Below, you can find an example file for the config.json. Whenever you try to start the automation with a config that does not comply with this schema, the automation will output a precise error message and shut down.

An exact schema reference of the config object is defined in the API Reference section.

Example File

{
  "general": {
    "config_revision": 1,
    "software_version": "1.1.0",
    "system_identifier": "my-system-1"
  },
  "logging_verbosity": {
    "file_archive": "DEBUG",
    "console_prints": "INFO",
    "message_sending": "WARNING"
  },
  "updater": {
    "repository": "tum-esm/ivy",
    "provider": "github",
    "provider_host": "github.com",
    "access_token": null,
    "source_conflict_behaviour": "reuse"
  },
  "backend": {
    "provider": "tenta",
    "mqtt_connection": {
      "host": "localhost",
      "port": 1883,
      "client_id": "test_client",
      "username": "test_username",
      "password": "test_password"
    },
    "max_parallel_messages": 50,
    "max_drain_time": 300
  },
  "dummy_procedure": {
    "seconds_between_datapoints": 10
  },
  "system_checks": {
    "seconds_between_checks": 120
  }
}