A standard attribute is an OAP-based property within an equipment or building.
A standard attribute is an OAP based property within an equipment or building.
An equipment/building can have none, one or multiple standard attributes and that depends on each customer the way the decide to manage them.
A. For Buildings
1) Sets standard attributes for a building. Updates all matching standard attributes with the provided input otherwise adds the provided standard attributes
mutation {
setBuildingStandardAttributes(
input: {
entityId: "1"
standardAttributes: [{key:"model", value:"Model A"}]
}
) {
id
name
standardAttributes{
key
value
unit {
type
name
description
}
kind
}
}
}
2) Replace standard attributes for a building. Removes any existing standard attributes and sets the provided standard attributes.
mutation {
replaceBuildingStandardAttributes(
input: {
entityId: "1"
standardAttributes: [{key:"model", value:"Model A"}]
}
) {
id
name
standardAttributes{
key
value
unit {
type
name
description
}
kind
}
}
}
3) Delete a standard attribute from a building
mutation {
deleteBuildingStandardAttribute(
input: {
entityId: "1"
standardAttributeKey: "model"
}
) {
id
name
standardAttributes{
key
value
unit {
type
name
description
}
kind
}
}
}
4) Retrieve standard attributes and available standard attributes on a building (for example building by id query)
query {
building(id: "1") {
id
name
standardAttributes{
key
value
unit{
type
name
description
}
kind
}
availableStandardAttributes{
key
label
kind
units{
type
name
description
}
allowableValues
}
}
}
B. For Equipment
1) Sets standard attributes for an equipment. Updates all matching standard attributes with the provided input otherwise adds the provided standard attributes
mutation {
setEquipmentStandardAttributes(
input: {
entityId: "1"
standardAttributes: [{key:"model", value:"Model A"}]
}
) {
id
name
standardAttributes{
key
value
unit {
type
name
description
}
kind
}
}
}
2) Replace standard attributes for an equipment. Removes any existing standard attributes and sets the provided standard attributes.
mutation {
replaceEquipmentStandardAttributes(
input: {
entityId: "1"
standardAttributes: [{key:"model", value:"Model A"}]
}
) {
id
name
standardAttributes{
key
value
unit {
type
name
description
}
kind
}
}
}
3) Delete a standard attribute from an equipment
mutation {
deleteEquipmentStandardAttribute(
input: {
entityId: "1"
standardAttributeKey: "model"
}
) {
id
name
standardAttributes{
key
value
unit {
type
name
description
}
kind
}
}
}
4) Retrieve standard attributes and available standard attributes on an equipment (for example equipment by id query)
query {
equipment(id: "1") {
id
name
standardAttributes{
key
value
unit{
type
name
description
}
kind
}
availableStandardAttributes{
key
label
kind
units{
type
name
description
}
allowableValues
}
}
}
C. Bulk upload
1) Upload standard attribute for building.
mutation {
bulkUploadStandardAttributes(
input: {
buildingId: "1"
filepath: "path/bulk_upload_attributes_template .xls"
mode: SET
entity: BUILDING
}
) {
buildingAttributes {
row
type
message
name
}
}
}
2) Upload standard attributes for equipment
mutation {
bulkUploadStandardAttributes(
input: {
buildingId: "1"
filepath: "path/bulk_upload_attributes_template (1).xls"
mode: SET
entity: EQUIPMENT
}
) {
equipmentAttributes{
row
type
message
name
}
}
}