Skip to content

Commit 8dcb350

Browse files
committed
Initial sourcing of derived models for LWM2M. Added directly due to
issues with oneIoTa.
1 parent 35cba32 commit 8dcb350

13 files changed

+726
-0
lines changed

lwm2m.o.actuation.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"id": "http://openinterconnect.org/asamapping/schemas/asa.environment.currentairquality.json#",
3+
"$schema": "http://json-schema.org/draft-04/schema#",
4+
"description" : "Copyright (c) 2017 Open Connectivity Foundation, Inc. All rights reserved.",
5+
"title": "Actuation",
6+
"definitions": {
7+
"lwm2m.o.actuation": {
8+
"type": "object",
9+
"properties": {
10+
"On/Off(5850)": {
11+
"type": "boolean",
12+
"description": "On/off control. Boolean value where True is On and False is Off.",
13+
"x-ocf-conversion": {
14+
"x-ocf-alias": "oic.r.audio",
15+
"x-to-ocf": [
16+
"oic.r.audio.mute = On/Off(5850)"
17+
],
18+
"x-from-ocf": [
19+
"On/Off(5850) = oic.r.audio.mute"
20+
]
21+
}
22+
},
23+
"Dimmer(5851)": {
24+
"type": "integer",
25+
"description": "This resource represents a dimmer setting, which has an Integer value between 0 and 100 as a percentage.",
26+
"x-ocf-conversion": {
27+
"x-ocf-alias": "oic.r.audio",
28+
"x-to-ocf": [
29+
"oic.r.audio.volume = Dimmer(5851)"
30+
],
31+
"x-from-ocf": [
32+
"Dimmer(5851) = oic.r.audio.volume"
33+
]
34+
}
35+
},
36+
"Application Type(5750)": {
37+
"type": "string",
38+
"description": "The application type of the sensor or actuator as a string depending on the use case.",
39+
"x-ocf-conversion": {
40+
"x-ocf-alias": "oic.r.audio",
41+
"x-to-ocf": [
42+
"oic.r.audio.n = Application Type(5750)"
43+
],
44+
"x-from-ocf": [
45+
"Application Type(5750) = oic.r.audio.n"
46+
]
47+
}
48+
}
49+
}
50+
}
51+
52+
},
53+
"type": "object",
54+
"allOf": [
55+
{"$ref": "#/definitions/lwm2m.o.actuation"}
56+
],
57+
"required": ["On/Off(5850)"]
58+
}

lwm2m.o.buzzer.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"id": "http://openinterconnect.org/asamapping/schemas/asa.environment.currentairquality.json#",
3+
"$schema": "http://json-schema.org/draft-04/schema#",
4+
"description" : "Copyright (c) 2017 Open Connectivity Foundation, Inc. All rights reserved.",
5+
"title": "Buzzer",
6+
"definitions": {
7+
"lwm2m.o.buzzer": {
8+
"type": "object",
9+
"properties": {
10+
"On/Off(5850)": {
11+
"type": "boolean",
12+
"description": "On/off control. Boolean value where True is On and False is Off.",
13+
"x-ocf-conversion": {
14+
"x-ocf-alias": "oic.r.door",
15+
"x-to-ocf": [
16+
"oic.r.door.openAlarm = On/Off(5850)"
17+
],
18+
"x-from-ocf": [
19+
"On/Off(5850) = oic.r.door.openAlarm"
20+
]
21+
}
22+
},
23+
"Application Type(5750)": {
24+
"type": "string",
25+
"description": "The application type of the sensor or actuator as a string depending on the use case.",
26+
"x-ocf-conversion": {
27+
"x-ocf-alias": "oic.r.door",
28+
"x-to-ocf": [""],
29+
"x-from-ocf": [
30+
"Application Type(5750) = \"Door Open Alarm\""
31+
]
32+
}
33+
}
34+
}
35+
}
36+
37+
},
38+
"type": "object",
39+
"allOf": [
40+
{"$ref": "#/definitions/lwm2m.o.buzzer"}
41+
],
42+
"required": ["On/Off(5850)"]
43+
}

lwm2m.o.device.json

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
{
2+
"id": "http://openinterconnect.org/asamapping/schemas/asa.environment.currentairquality.json#",
3+
"$schema": "http://json-schema.org/draft-04/schema#",
4+
"description" : "Copyright (c) 2017 Open Connectivity Foundation, Inc. All rights reserved.",
5+
"title": "Device",
6+
"definitions": {
7+
"lwm2m.o.device": {
8+
"type": "object",
9+
"properties": {
10+
"Battery Level (9)": {
11+
"type": "integer",
12+
"description": "Contains the current battery level as a percentage (with a range from 0 to 100). This value is only valid for the Device internal Battery if present (one Available Power Sources Resource Instance is 1).",
13+
"x-ocf-conversion": {
14+
"x-ocf-alias": "oic.r.energy.battery",
15+
"x-to-ocf": [
16+
"oic.r.energy.battery.charge = Battery Level(9)"
17+
],
18+
"x-from-ocf": [
19+
"Battery Level(9) = oic.r.energy.battery.charge"
20+
]
21+
}
22+
},
23+
"Device Type (17)": {
24+
"type": "string",
25+
"description": "Type of the device (manufacturer specified string: e.g. smart meters / dev Class…)",
26+
"x-ocf-conversion": {
27+
"x-ocf-alias": "oic.wk.d",
28+
"x-to-ocf": [
29+
"oic.wk.d.n = Device Type (17)"
30+
],
31+
"x-from-ocf": [
32+
"Device Type (17) = oic.wk.d.n"
33+
]
34+
}
35+
},
36+
"Battery Status (20)": {
37+
"type": "integer",
38+
"description": "This value is only valid for the Device Internal Battery if present",
39+
"x-ocf-conversion": {
40+
"x-ocf-alias": "oic.r.energy.battery",
41+
"x-to-ocf": [
42+
"switch (Battery Status (20)) {",
43+
"Case 0 : oic.r.energy.battery.charging = FALSE; oic.r.energy.battery.defect = FALSE; oic.r.energy.battery.lowbattery = FALSE; break;",
44+
"Case 1 : oic.r.energy.battery.charging = TRUE; oic.r.energy.battery.defect = FALSE; oic.r.energy.battery.lowbattery = FALSE; break;",
45+
"Case 2 : oic.r.energy.battery.charging = FALSE; oic.r.energy.battery.defect = FALSE; oic.r.energy.battery.lowbattery = FALSE; break;",
46+
"Case 3 : oic.r.energy.battery.charging = FALSE; oic.r.energy.battery.defect = TRUE; oic.r.energy.battery.lowbattery = FALSE; break;",
47+
"Case 4 : oic.r.energy.battery.charging = FALSE; oic.r.energy.battery.defect = FALSE; oic.r.energy.battery.lowbattery = TRUE; break;"
48+
],
49+
"x-from-ocf": [
50+
"If (oic.r.energy.battery.charing == TRUE) {Battery Status (20) = 1;} ",
51+
"alse { if (oic.r.energy.battery.defect == TRUE) {Battery Status (20) = 3;} ",
52+
"if (oic.r.energy.battery.lowbattery == TRUE) {Battery Status (20) = 4;} ",
53+
"if(oic.r.energy.battery.charge == 100) {Battery Status (20)",
54+
"= 2;} ",
55+
"else {Battery Status (20) = 0;} }"
56+
]
57+
}
58+
},
59+
"Manufacturer (0)": {
60+
"type": "string",
61+
"description": "Human readable manufacturer name",
62+
"x-ocf-conversion": {
63+
"x-ocf-alias": "oic.wk.p",
64+
"x-to-ocf": [
65+
"oic.wk.p.mnmn = Manufacturer (0)"
66+
],
67+
"x-from-ocf": [
68+
"Manufacturer (0) = oic.wk.p.mnmn"
69+
]
70+
}
71+
},
72+
"Model Number (1)": {
73+
"type": "string",
74+
"description": "A model identifier (manufacturer specified string)",
75+
"x-ocf-conversion": {
76+
"x-ocf-alias": "oic.wk.p",
77+
"x-to-ocf": [
78+
"oic.wk.p.mnmo = Model Number (1)"
79+
],
80+
"x-from-ocf": [
81+
"Model Number (1) = oic.wk.p.mnmo"
82+
]
83+
}
84+
},
85+
"Serial Number (2)": {
86+
"type": "string",
87+
"description": "Serial Number",
88+
"x-ocf-conversion": {
89+
"x-ocf-alias": "oic.wk.p",
90+
"x-to-ocf": [
91+
"oic.wk.p.mnsel = Serial Number (2)"
92+
],
93+
"x-from-ocf": [
94+
"Serial Number (2) = oic.wk.p.mnsel"
95+
]
96+
}
97+
},
98+
"Firmware Version (3)": {
99+
"type": "string",
100+
"description": "Current firmware version of the Device.",
101+
"x-ocf-conversion": {
102+
"x-ocf-alias": "oic.wk.p",
103+
"x-to-ocf": [
104+
"oic.wk.p.mnfv = Firmware Version (3)"
105+
],
106+
"x-from-ocf": [
107+
"Firmware Version (3) = oic.wk.p.mnfv"
108+
]
109+
}
110+
},
111+
"Hardware Version (18)": {
112+
"type": "string",
113+
"description": "Current hardware version of the device.",
114+
"x-ocf-conversion": {
115+
"x-ocf-alias": "oic.wk.p",
116+
"x-to-ocf": [
117+
"oic.wk.p.mnhw = Hardware Version (18)"
118+
],
119+
"x-from-ocf": [
120+
"Hardware Version (18) = oic.wk.p.mnhw"
121+
]
122+
}
123+
}
124+
}
125+
}
126+
},
127+
"type": "object",
128+
"allOf": [
129+
{"$ref": "#/definitions/lwm2m.o.device"}
130+
],
131+
"required": []
132+
}

lwm2m.o.digitalinput.json

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"id": "http://openinterconnect.org/asamapping/schemas/asa.environment.currentairquality.json#",
3+
"$schema": "http://json-schema.org/draft-04/schema#",
4+
"description" : "Copyright (c) 2017 Open Connectivity Foundation, Inc. All rights reserved.",
5+
"title": "Digital Input",
6+
"definitions": {
7+
"lwm2m.o.digitalinput": {
8+
"type": "object",
9+
"properties": {
10+
"Digital Input state (5500)": {
11+
"type": "boolean",
12+
"description": "The current state of a digital input.",
13+
"x-ocf-conversion": {
14+
"x-ocf-alias": "oic.r.vehicle.connector",
15+
"x-to-ocf": [
16+
"oic.r.vehicle.connector.connected = Digital Input state (5500)"
17+
],
18+
"x-from-ocf": [
19+
"Digital Input state (5500) = oic.r.vehicle.connector.connected"
20+
]
21+
}
22+
},
23+
"Sensor Type (5751)": {
24+
"type": "string",
25+
"description": "The type of the sensor",
26+
"x-ocf-conversion": {
27+
"x-ocf-alias": "oic.r.vehicle.connector",
28+
"x-to-ocf": [
29+
""
30+
],
31+
"x-from-ocf": [
32+
"Sensor Type (5751) = \"Vehicle Connector\""
33+
]
34+
}
35+
},
36+
"Application Type (5750)": {
37+
"type": "string",
38+
"description": "The minimum value that can be measured by the sensor.",
39+
"x-ocf-conversion": {
40+
"x-ocf-alias": "oic.r.vehicle.connector",
41+
"x-to-ocf": [
42+
""
43+
],
44+
"x-from-ocf": [
45+
"Application Type (5750) = \"Vehicle Connector\""
46+
]
47+
}
48+
}
49+
}
50+
}
51+
},
52+
"type": "object",
53+
"allOf": [
54+
{"$ref": "#/definitions/lwm2m.o.digitalinput"}
55+
],
56+
"required": ["Digital Input state (5500)"]
57+
}

lwm2m.o.door.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"id": "http://openinterconnect.org/asamapping/schemas/asa.environment.currentairquality.json#",
3+
"$schema": "http://json-schema.org/draft-04/schema#",
4+
"description" : "Copyright (c) 2017 Open Connectivity Foundation, Inc. All rights reserved.",
5+
"title": "Door",
6+
"definitions": {
7+
"lwm2m.o.door": {
8+
"type": "object",
9+
"properties": {
10+
"Door status(50)": {
11+
"type": "boolean",
12+
"description": "The status of the door, 1:Opened, 0:Closed.",
13+
"x-ocf-conversion": {
14+
"x-ocf-alias": "oic.r.door",
15+
"x-to-ocf": [
16+
"If (Door status(50) == 1) {oic.r.door.openState = “open”;} else {oic.r.door.openState = “closed”;}"
17+
],
18+
"x-from-ocf": [
19+
"if(oic.r.door.openState == “open”) {Door status(50) = 1; } else { Door statue(50) = 0;}"
20+
]
21+
}
22+
},
23+
"Door Name(1)": {
24+
"type": "float",
25+
"description": "The name of the door.",
26+
"x-ocf-conversion": {
27+
"x-ocf-alias": "oic.r.door",
28+
"x-to-ocf": [
29+
"oic.r.door.n = Door Name(1)"
30+
],
31+
"x-from-ocf": [
32+
"Door Name(1) = oic.r.door.n"
33+
]
34+
}
35+
}
36+
}
37+
}
38+
},
39+
"type": "object",
40+
"allOf": [
41+
{"$ref": "#/definitions/lwm2m.o.door"}
42+
],
43+
"required": ["Door status(50)", "Door Name(1)"]
44+
}

lwm2m.o.energy.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"id": "http://openinterconnect.org/asamapping/schemas/asa.environment.currentairquality.json#",
3+
"$schema": "http://json-schema.org/draft-04/schema#",
4+
"description" : "Copyright (c) 2017 Open Connectivity Foundation, Inc. All rights reserved.",
5+
"title": "Energy",
6+
"definitions": {
7+
"lwm2m.o.energy": {
8+
"type": "object",
9+
"properties": {
10+
"Sensor Value (5700)": {
11+
"type": "float",
12+
"description": "Last or Current Measured Value from the Sensor. (energy consumption (Cumulative Power) of an electrical load)",
13+
"x-ocf-conversion": {
14+
"x-ocf-alias": "oic.r.energy.consumption",
15+
"x-to-ocf": [
16+
"oic.r.energy.consumption.energy = Sensor Value(5700)"
17+
],
18+
"x-from-ocf": [
19+
"Sensor Value(5700) = oic.r.energy.consumption.energy"
20+
]
21+
}
22+
},
23+
"Application Type (5750)": {
24+
"type": "float",
25+
"description": "The application type of the sensor or actuator as a string depending on the use case.",
26+
"x-ocf-conversion": {
27+
"x-ocf-alias": "oic.r.energy.consumption",
28+
"x-to-ocf": [""],
29+
"x-from-ocf": [
30+
"Application Type (5750) = “Energy consumption”"
31+
]
32+
}
33+
}
34+
}
35+
}
36+
},
37+
38+
"type": "object",
39+
"allOf": [
40+
{"$ref": "#/definitions/lwm2m.o.energy"}
41+
],
42+
"required": ["Sensor Value (5700)"]
43+
}

0 commit comments

Comments
 (0)