thresholddetection.agent module

class thresholddetection.agent.ThresholdDetectionAgent(config, **kwargs)[source]

Bases: volttron.platform.vip.agent.Agent

Listen to topics and publish alerts when thresholds are passed.

The agent’s configuration specifies which topics to watch, the topic’s threshold, and the message to send in an alert. Topics can specify a maximum and minimum threshold. Non-numberic data will be ignored.

Example configuration:

{
    "datalogger/log/platfor/cpu_percent": {
        "threshold_max": 99,
    },
    "some/temperature/topic": {
        "threshold_min": 0,
    },
    "devices/some/device/topic/all": {
        "some_point": {
            "threshold_max": 42,
            "threshold_min": 0
        }
    }
}
thresholddetection.agent.main(argv=['/home/docs/checkouts/readthedocs.org/user_builds/volttron/envs/releases-8.2/lib/python3.6/site-packages/sphinx/__main__.py', '-T', '-E', '-b', 'html', '-d', '_build/doctrees', '-D', 'language=en', '.', '_build/html'])[source]

Main method called by the platform.

thresholddetection.agent.thresholddetection_agent(config_path, **kwargs)[source]

Load configuration for ThresholdDetectionAgent

Parameters

config_path (str) – Path to a configuration file.

Returns

ThresholdDetectionAgent instance

Return type

ThresholdDetectionAgent