Create an alarm from a DC 09 alarm

🟢 Beginner

alarm

In this tutorial, you will learn how to create an OnSphere alarm from a DC 09 alarm.

  • Create an action of type CREATE_ALARM that will be called when a matching DC09 event arrives.

  • Configure an IP-RCT server to receive forwarded alarms from the DC09 gateway.

  • Define an IP-RCT device matching a specific transmitter identifier.

  • Create a FIRE_AND_FORGET textual value with an alarm owner that matches NFA alarm codes and links to the action.

git checkout origin/osp-alarms-configuration .
git checkout origin/osp-web-configuration .
git checkout origin/osp-ip-rct-configuration .
git checkout origin/example-alarms-created-from-dc09 .

Prerequisites

Logical schema

@startuml
skinparam backgroundColor transparent

node spt as "SP"
node rct as "RCT"
node osprct as "osp-ip-rct"
node ospalarms as "osp-alarms"

spt -[#black]> rct : <size:11><color:black>  **Send alarm**
rct -[#black]d-> osprct : <size:11><color:black>  **Forward alarm**
osprct -[#black]d-> ospalarms : <size:11><color:black>  **create alarm**
ospalarms -[#black]d-> alarms : <size:11><color:black>
@enduml

Configuration structure

{
@startuml
skinparam backgroundColor transparent
package "root/.../gateway" {
    [server.ip-rct] as server
}

package "root/.../device" {
    [device.ip-rct] as device
}

package "root/.../alarm" {
    [owner-alarm.ip-rct] as alarm
}

package "root/.../action" {
    [action.ospp] as action
}

node ospscripts as "osp-ip-rct"
node ospalarms as "osp-alarms"

ospscripts -[#black]> server : <size:11><color:black> **forwards**
server -[#black]d-> device : <size:11><color:black> **dispatches**
device -[#black]d-> alarm : <size:11><color:black> **dispatches**
alarm -[#dodgerblue]d-> action : <size:11><color:dodgerblue> **executes**
action -[#firebrick]r-> ospalarms : <size:11><color:firebrick> **Create alarm**
@enduml
}

Steps

1. Create an action that can create an alarm

root/alarms/dc09-alarm/action/action.ospp

 {
     "moduleId": ["modules.ip-rct.ip-rct-1"],
     "type": "CREATE_ALARM"
 }

2. Create a server that will communicate with the DC09 gateway dc09.gateway.local

root/alarms/dc09-alarm/gateway/value.ospp

{
    "name": "DC09 Gateway",
    "description": "",
    "type": "BOOLEAN"
}

root/alarms/dc09-alarm/gateway/server.ip-rct

{
    "moduleId": "modules.ip-rct.ip-rct-1",
    "hostname": "dc09.gateway.local",
    "port": 8080,
    "username": "ae-osp-user",
    "passwordProvider": {
        "type": "PLAINTEXT",
        "password": "ae-osp-password"
    },
    "aeIdentifier": "ae-osp"
}

3. Create a device that will match the transmitter D00001

root/alarms/dc09-alarm/device/value.ospp

{
    "name": "DC09 alarm transmitter",
    "description": "",
    "type": "BOOLEAN"
}

root/alarms/dc09-alarm/device/device.ip-rct

{
    "linkedServer": "root.alarms.dc09-alarm.gateway",
    "ipSptIdentifier": "D00001"
}

4. Create a textual value with FIRE_AND_FORGET retention so the value will be treated as an event instead of a state

root/alarms/dc09-alarm/alarm/value.ospp

{
    "name": "Fire alarm",
    "description": "",
    "type": "TEXT",
    "retention": "FIRE_AND_FORGET"
}