SCADA Final Aggregator configuration

So, let us proceed with our configuration. Universal Controller has already been set up and Logic Manager as well. Therefore, let us move on to SCADA Final Aggregator configuration.

Since the logic has already been implemented, we have only two tasks: to interconnect all the controllers and connect the system cron that will control the ventilation schedule.

Notification system configuration

Note

If you’ve used “easy setup” for the EVA installation, you may skip this step because all controllers are already connected.

The first step is to connect the server to the local MQTT to allow SCADA Final Aggregator to get the state of UC and LM PLC items in real time:

eva ns sfa create eva_1 mqtt:eva:secret@localhost -s plant1 -y

We won’t subscribe the notifier to anything, because all the data are received from it, and there is nothing to send instead.

eva ns sfa config eva_1
{
    "enabled": true,
    "host": "localhost",
     "id": "eva_1",
    "password": "secret",
    "space": "plant1",
    "type": "mqtt",
    "username": "eva"
}

Restart SFA:

eva sfa server restart

Connecting controllers

Note

If you’ve used “easy setup” for the EVA installation, you may skip this step because all controllers are already connected.

The next step is to connect the local UC and LM PLC to SCADA Final Aggregator with the keys created specifically for SFA:

eva sfa controller append http://localhost:8812 -a secret_for_sfa -m eva_1 -y
eva sfa controller append http://localhost:8817 -a secret_for_sfa2 -m eva_1 -y
eva sfa -J remote -p S
[
    {
        "controller_id": "uc/uc1",
        "group": "security",
        "id": "motion1",
        "oid": "sensor:security/motion1",
        "status": 1,
        "type": "sensor",
        "value": "0"
    },
    {
        "controller_id": "uc/uc1",
        "group": "env",
        "id": "temp1",
        "oid": "sensor:env/temp1",
        "status": 1,
        "type": "sensor",
        "value": "25.4"
    }
]

Looks fine, sensors are loaded, let’s check units and logic variables:

eva sfa -J remote -p U
eva sfa -J remote -p LV

Let SFA reload the items from the connected controllers every 60 seconds, if new ones are added in future:

eva sfa controller set uc/uc1 reload_interval 60 -y
eva sfa controller set lm/lm1 reload_interval 60 -y

Connecting external applications

There is only one external application - system cron. We won’t connect it via SFA API, but simply by running eva sfa (sfa-cmd) console application.

We provide this example for one reason: you should always connect your external applications to SFA only. Controllers may be changed and, therefore, the setup may be extended: for example, one Logic Manager may be replaced by the three ones installed on the different servers. However, the local SFA will never be changed. All you need is to connect new controllers to it, and EVA item infrastructure will be available again by its usual ID.

The next step it to connect cron for it to run ventilation control macro (edit /etc/crontab or user’s crontab):

0 7 * * *    root   /path/to/eva sfa macro run control/vi_control -a "0 cron"
0 21 * * *    root   /path/to/eva sfa macro run control/vi_control -a "1 cron"

As you can see, there is no rocket science here. SCADA Final Aggregator is configured by a few commands and immediately starts collecting the data and events. In turn, it will save you a lot of time by structuring your setup. Now let’s create User interface that will be served by SFA.