Skip to content

Commit

Permalink
Fixed alertState field name errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
riclolsen committed Jul 9, 2023
1 parent 9f6b042 commit d6555fe
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ Example document.
* _**_alarmed_**_ [Boolean] - When true means the point is alarmed. **Mandatory parameter**.
* _**_alarmRange_**_ [Double] - Current alarm range for analog tags. 0=normal, 1=hiLimit violated, -1=loLimit violated. **Mandatory parameter**.
* _**_alerted_**_ [Boolean] - When true means the point is alerted (Grafana alert). **Optional parameter**.
* _**_alertedState_**_ [Boolean] - Grafana alert state name. **Optional parameter**.
* _**_alertState_**_ [Boolean] - Grafana alert state name. **Optional parameter**.
* _**_historianLastValue_**_ [Double] - Last value sent to historian (for dead band processing). Only for analog tags. **Mandatory parameter**.
* _**_invalid_**_ [Boolean] - When true value is considered old or not trusted. **Mandatory parameter**.
* _**_overflow_**_ [Boolean] - Overflow detected for _type=analog_ value. **Mandatory parameter**.
Expand Down
4 changes: 2 additions & 2 deletions mongo_seed/realtime_data.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{"_id":-2,"alarmRange":0.0,"alarmDisabled":true,"alarmState":1,"alarmed":false,"annotation":"","commandBlocked":false,"commandOfSupervised":0,"description":"System~Status~Digital Updates Count","eventTextFalse":"","eventTextTrue":"","formula":null,"frozen":false,"frozenDetectTimeout":300,"group1":"_System","group2":"Status","group3":"","hiLimit":null,"hihiLimit":null,"hihihiLimit":null,"historianDeadBand":0,"historianPeriod":0,"hysteresis":0,"invalid":true,"invalidDetectTimeout":0,"isEvent":false,"kconv1":1,"kconv2":0,"loLimit":null,"location":null,"loloLimit":null,"lololoLimit":null,"notes":"","origin":"system","overflow":false,"parcels":null,"priority":3,"protocolSourceASDU":0,"protocolSourceCommandDuration":null,"protocolSourceCommandUseSBO":null,"protocolSourceCommonAddress":0,"protocolSourceConnectionNumber":0,"protocolSourceObjectAddress":0,"sourceDataUpdate":null,"stateTextFalse":"","stateTextTrue":"","substituted":false,"supervisedOfCommand":0,"tag":"_System.Status.DigitalUpdatesCnt","timeTag":{"$date":"2020-07-24T14:20:53.972Z"},"transient":false,"type":"analog","ungroupedDescription":"Digital Updates Count","unit":"Updates","updatesCnt":0,"value":289566.0,"valueDefault":0,"valueString":"289566 Updates","timeTagAtSource":null,"timeTagAtSourceOk":null}
{"_id":-1,"alarmRange":0.0,"alarmDisabled":true,"alarmState":1,"alarmed":false,"annotation":"","commandBlocked":false,"commandOfSupervised":0,"description":"System~Status~Alarm Beep","eventTextFalse":"Beep Deactivated","eventTextTrue":"Beep Activated","formula":null,"frozen":false,"frozenDetectTimeout":300,"group1":"_System","group2":"Status","group3":"","hiLimit":null,"hihiLimit":null,"hihihiLimit":null,"historianDeadBand":0,"historianPeriod":0,"hysteresis":0,"invalid":true,"invalidDetectTimeout":0,"isEvent":false,"kconv1":1,"kconv2":0,"loLimit":null,"location":null,"loloLimit":null,"lololoLimit":null,"notes":"","origin":"system","overflow":false,"parcels":null,"priority":3,"protocolSourceASDU":0,"protocolSourceCommandDuration":null,"protocolSourceCommandUseSBO":null,"protocolSourceCommonAddress":0,"protocolSourceConnectionNumber":0,"protocolSourceObjectAddress":0,"sourceDataUpdate":null,"stateTextFalse":"No Beep","stateTextTrue":"Active Beep","substituted":false,"supervisedOfCommand":0,"tag":"_System.Status.AlarmBeep","timeTag":{"$date":"2020-07-24T14:20:53.972Z"},"transient":false,"type":"analog","ungroupedDescription":"Alarm Beep","unit":"Enum","updatesCnt":0,"value":1.0,"valueDefault":0,"valueString":"Beep Active","timeTagAtSource":null,"timeTagAtSourceOk":null}
{"_id":-2.0,"alarmRange":0.0,"alarmDisabled":true,"alarmState":1.0,"alarmed":false,"annotation":"","commandBlocked":false,"commandOfSupervised":0.0,"description":"System~Status~Digital Updates Count","eventTextFalse":"","eventTextTrue":"","formula":null,"frozen":false,"frozenDetectTimeout":300.0,"group1":"_System","group2":"Status","group3":"","hiLimit":null,"hihiLimit":null,"hihihiLimit":null,"historianDeadBand":0.0,"historianPeriod":0.0,"hysteresis":0.0,"invalid":true,"invalidDetectTimeout":0.0,"isEvent":false,"kconv1":1.0,"kconv2":0.0,"loLimit":null,"location":null,"loloLimit":null,"lololoLimit":null,"notes":"","origin":"system","overflow":false,"parcels":null,"priority":3.0,"protocolSourceASDU":0.0,"protocolSourceCommandDuration":null,"protocolSourceCommandUseSBO":null,"protocolSourceCommonAddress":0.0,"protocolSourceConnectionNumber":0.0,"protocolSourceObjectAddress":0.0,"sourceDataUpdate":null,"stateTextFalse":"","stateTextTrue":"","substituted":false,"supervisedOfCommand":0.0,"tag":"_System.Status.DigitalUpdatesCnt","timeTag":{"$date":"2020-07-24T14:20:53.972Z"},"transient":false,"type":"analog","ungroupedDescription":"Digital Updates Count","unit":"Updates","updatesCnt":0.0,"value":289566.0,"valueDefault":0.0,"valueString":"289566 Updates","timeTagAtSource":null,"timeTagAtSourceOk":null}
{"_id":-1.0,"alarmRange":0.0,"alarmDisabled":true,"alarmState":1.0,"alarmed":false,"annotation":"","commandBlocked":false,"commandOfSupervised":0.0,"description":"System~Status~Alarm Beep","eventTextFalse":"Beep Deactivated","eventTextTrue":"Beep Activated","formula":null,"frozen":false,"frozenDetectTimeout":300.0,"group1":"_System","group2":"Status","group3":"","hiLimit":null,"hihiLimit":null,"hihihiLimit":null,"historianDeadBand":0.0,"historianPeriod":0.0,"hysteresis":0.0,"invalid":true,"invalidDetectTimeout":0.0,"isEvent":false,"kconv1":1.0,"kconv2":0.0,"loLimit":null,"location":null,"loloLimit":null,"lololoLimit":null,"notes":"","origin":"system","overflow":false,"parcels":null,"priority":3.0,"protocolSourceASDU":0.0,"protocolSourceCommandDuration":null,"protocolSourceCommandUseSBO":null,"protocolSourceCommonAddress":0.0,"protocolSourceConnectionNumber":0.0,"protocolSourceObjectAddress":0.0,"sourceDataUpdate":null,"stateTextFalse":"No Beep","stateTextTrue":"Active Beep","substituted":false,"supervisedOfCommand":0.0,"tag":"_System.Status.AlarmBeep","timeTag":{"$date":"2020-07-24T14:20:53.972Z"},"transient":false,"type":"analog","ungroupedDescription":"Alarm Beep","unit":"Enum","updatesCnt":0.0,"value":1.0,"valueDefault":0.0,"valueString":"Beep Active","timeTagAtSource":null,"timeTagAtSourceOk":null}
2 changes: 1 addition & 1 deletion src/mqtt-sparkplug/auto-tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function NewTag () {
alarmDisabled: false,
alerted: false,
alarmed: false,
alertedState: '',
alertState: '',
annotation: '',
commandBlocked: false,
commandOfSupervised: new Mongo.Double(0.0),
Expand Down
20 changes: 16 additions & 4 deletions src/server_realtime_auth/app/models/tag.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@ const Tag = mongoose.model(
new mongoose.Schema({
_id: {type: Double},
alarmDisabled: {type: Boolean, default: false},
alarmed: {type: Boolean, default: false},
alarmRange: {type: Double, default: 0.0},
alarmState: {type: Double, default: -1.0},
alarmed: {type: Boolean, default: false},
alerted: {type: Boolean, default: false},
alertState: {type: String, default: ""},
annotation: {type: String, default: ""},
commandBlocked: {type: Boolean, default: false},
commandOfSupervised: {type: Double, default: 0.0},
commissioningRemarks: {type: String, default: ""},
description: {type: String, default: ""},
eventTextFalse: {type: String, default: ""},
eventTextTrue: {type: String, default: ""},
formula: {type: Double, default: -1.0},
formula: {type: Double, default: 0.0},
frozen: {type: Boolean, default: false},
frozenDetectTimeout: {type: Double, default: 0.0},
group1: {type: String, default: ""},
Expand All @@ -27,12 +29,14 @@ const Tag = mongoose.model(
hiLimit: {type: Double, default: Number.MAX_VALUE},
historianDeadBand: {type: Double, default: 0.0},
historianPeriod: {type: Double, default: 0.0},
historianLastValue: {type: Double, default: null},
hysteresis: {type: Double, default: 0.0},
invalid: {type: Boolean, default: true},
invalidDetectTimeout: {type: Double, default: 300.0},
isEvent: {type: Boolean, default: false},
kconv1: {type: Double, default: 1.0},
kconv2: {type: Double, default: 0.0},
location: {type: Object, default: null},
loLimit: {type: Double, default: -Number.MAX_VALUE},
loloLimit: {type: Double, default: -Number.MAX_VALUE},
lololoLimit: {type: Double, default: -Number.MAX_VALUE},
Expand All @@ -43,20 +47,28 @@ const Tag = mongoose.model(
priority: {type: Double, default: 0.0},
protocolDestinations: {type: Array, default: []},
protocolSourceASDU: {type: mongoose.Mixed, default: ""},
protocolSourceCommandDuration: {type: String, default: ""},
protocolSourceCommandDuration: {type: Double, default: 0.0},
protocolSourceCommandUseSBO: {type: Boolean, default: false},
protocolSourceCommonAddress: {type: mongoose.Mixed, default: ""},
protocolSourceConnectionNumber: {type: Double, default: 0.0},
protocolSourceObjectAddress: {type: mongoose.Mixed, default: ""},
stateTextFalse: {type: String, default: ""},
stateTextTrue: {type: String, default: ""},
substituted: {type: Boolean, default: false},
supervisedOfCommand: {type: Double, default: 0.0},
tag: {type: String},
transient: {type: Boolean, default: true},
timeTag: {type: Object, default: null},
timeTagAlarm: {type: Object, default: null},
timeTagAlertState: {type: Object, default: null},
timeTagAtSource: {type: Object, default: null},
timeTagAtSourceOk: {type: Object, default: null},
transient: {type: Boolean, default: false},
type: {type: String, default: "digital"},
ungroupedDescription: {type: String, default: ""},
unit: {type: String, default: ""},
updatesCnt: {type: Double, default: 0.0},
value: {type: Double, default: 0.0},
valueDefault : {type: Double, default: 0.0},
valueJson: {type: Object, default: null},
valueString: {type: String, default: ""},
zeroDeadband: {type: Double, default: 0.0},
Expand Down
2 changes: 1 addition & 1 deletion src/telegraf-listener/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ const rtData = function (measurement) {
alarmDisabled: false,
alerted: false,
alarmed: false,
alertedState: '',
alertState: '',
annotation: '',
commandBlocked: false,
commandOfSupervised: new Double(0.0),
Expand Down

0 comments on commit d6555fe

Please sign in to comment.