Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: BACnet support for events #379

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions bindings/protocols/bacnet/bacnet-model.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,27 @@ Additional parameters can be specified via URI variable syntax, e.g. ?commandPri

bacv:usesService rdf:type owl:DatatypeProperty ;
rdfs:domain hctl:Form ;
rdfs:range [owl:oneOf ("ReadProperty"^^xsd:string "WriteProperty"^^xsd:string "SubscribeCOV"^^xsd:string)] ;
rdfs:range [owl:oneOf (
"ReadProperty"^^xsd:string
"WriteProperty"^^xsd:string
"SubscribeCOV"^^xsd:string
"GetEventInfo"^^xsd:string
"AcknowledgeAlarm"^^xsd:string
"AddListElement"^^xsd:string
"RemoveListElement"^^xsd:string
)] ;
rdfs:comment """
Default BACnet service by td:OperationType:
- td:readProperty -> ReadProperty
- td:writeProperty -> WriteProperty
- td:observeProperty -> SubscribeCOV, subscribe to object if no property ID is present in target, otherwise subscribe to property
- td:unobserveProperty -> SubscribeCOV (will do an unsubscribe instead)

- td:subscribeEvent -> AddListElement (will always be to the Recipient-List property of the Notification-Class object)
- td:unsubscribeEvent -> RemoveListElement (will always be to the Recipient-List property of the Notification-Class object)
TODO: Can we specify the defaults in a machine-readable, RDF-standard way?

Not mapped yet:
No defaults are specified for the following, TD must specify the service explicitly for them:
- td:invokeAction, td:queryAction, td:cancelAction
- td:subscribeEvent, td:unsubscribeEvent
- td:readAllProperties, td:writeAllProperties, td:readMultipleProperties, td:writeMultipleProperties, td:observeAllProperties, td:unobserveAllProperties
- td:queryAllActions
- td:subscribeAllEvents, td:unsubscribeAllEvents
Expand Down
128 changes: 125 additions & 3 deletions bindings/protocols/bacnet/bacnet.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@
"enum": [
"ReadProperty",
"WriteProperty",
"SubscribeCOV"
"SubscribeCOV",
"GetEventInfo",
"AcknowledgeAlarm",
"AddListElement",
"RemoveListElement"
]
},
"bacv:hasDataType": {
"$ref": "#/definitions/bacnetDataType"
}
},
"required": ["bacv:hasDataType"]
}
},
"bacnetDataType": {
"oneOf": [
Expand Down Expand Up @@ -245,6 +248,121 @@
"enum": [1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
"default": 16
},
"eventPayload": {
"type": "object",
"properties": {
"source": {
"type": "string",
"format": "iri-reference"
},
"time": {
"type": "string",
"format": "date-time"
},
"prio": {
"type": "integer"
},
"message": {
"type": "string"
},
"ackReq": {
"type": "integer",
"enum": [0, 1],
"default": 0
},
"toState": {
"type": "string",
"enum": [
"fault",
"offnormal",
"normal"
]
},
"eventType": {
"type": "string",
"enum": ["regular", "ack", "syncrequired"],
"default": "regular"
},
"origSource": {
"type": "string",
"format": "iri-reference"
},
"values": {
"type": "object"
},
"inactive": {
"type": "integer",
"enum": [0, 1],
"default": 0
}
},
"required": [
"source",
"time",
"prio",
"toState"
]
},
"action_input_getCurrentEvents": {
"$comment": "This is not part of the form, but should be used in ActionAffordance.input BACnet GetEventInfo",
"type": "object",
"properties": {
"lastReceivedSource": {
"type": "string",
"fomat": "iri-reference"
}
}
},
"action_output_getCurrentEvents": {
"$comment": "This is not part of the form, but should be used in ActionAffordance.output BACnet GetEventInfo",
"type": "object",
"properties": {
"currentEvents": {
"type": "array",
"items": {
"$ref": "#/definitions/eventPayload"
}
}
},
"moreEvents": {
"type": "boolean"
},
"required": [
"currentEvents",
"moreEvents"
]
},
"action_input_acknowledgeEvent": {
"$comment": "This is not part of the form, but should be used in ActionAffordance.input BACnet AcknowledgeAlarm",
"type": "object",
"properties": {
"source": {
"type": "string",
"format": "iri-reference"
},
"toState": {
"$comment": "The state being acknowledged",
"type": "string",
"enum": [
"fault",
"offnormal",
"normal"
]
},
"eventTime": {
"type": "string",
"format": "date-time"
},
"ackSource": {
"type": "string"
},
"ackTime": {
"type": "string",
"format": "date-time"
},
"required": ["source", "ackState", "eventTime", "ackSource", "ackTime"]
}
},
"affordance": {
"type": "object",
"additionalProperties": {
Expand All @@ -258,6 +376,10 @@
}
}
}
},
"event_data": {
"$comment": "This is not part of the form, but should be used in EventAffordance.data for BACnet events",
"$ref": "#/definitions/eventPayload"
}
},
"type": "object",
Expand Down
Loading