From 31f746946a932f3bad9059d1668700c126b5a06d Mon Sep 17 00:00:00 2001 From: Haoyu laptop Date: Thu, 13 Aug 2026 18:27:17 +0200 Subject: [PATCH] Update the example TD to comply with the new vocab --- TTC26/examples/adeunis-comfort2.td.json | 68 ++++++------ TTC26/examples/dragino-lht65n.td.json | 105 +++++++++++-------- TTC26/examples/em300-zld.td.json | 80 ++++++++------- TTC26/examples/generic-lorawan11.td.json | 60 ++++++----- TTC26/examples/milesight-am102.td.json | 91 +++++++++++------ TTC26/examples/netvox-r718a.td.json | 125 ++++++++++++++--------- 6 files changed, 310 insertions(+), 219 deletions(-) diff --git a/TTC26/examples/adeunis-comfort2.td.json b/TTC26/examples/adeunis-comfort2.td.json index 3beb3da..ece4d52 100644 --- a/TTC26/examples/adeunis-comfort2.td.json +++ b/TTC26/examples/adeunis-comfort2.td.json @@ -2,7 +2,8 @@ "@context": [ "https://www.w3.org/2022/wot/td/v1.1", { - "lorav": "https://www.w3.org/2024/wot/lorawan#" + "lorav": "https://www.w3.org/2024/wot/lorawan#", + "schema": "https://schema.org/" } ], "@type": "Thing", @@ -19,84 +20,85 @@ }, "security": "otaa_sc", "base": "lorawan://0000000000000000/{appKey}/device", - "lorav:endDeviceId": "adeunis-comfort2-01", "lorav:devEUI": "0000000000000000", "lorav:joinEUI": "0000000000000000", "lorav:macVersion": "1.0.2", - "lorav:brand": "Adeunis", - "lorav:model": "Comfort 2", - "lorav:hardwareVersion": "1", - "lorav:softwareVersion": "1", + "schema:brand": "Adeunis", + "schema:model": "Comfort 2", "lorav:region": "EU868", "lorav:frequencyPlan": "EU_863_870_TTN", "lorav:payloadLayout": "fixed", - "properties": { + "events": { "frameCode": { - "type": "integer", - "readOnly": true, - "observable": true, + "data": { + "type": "integer" + }, "forms": [ { "href": "uplink", "op": [ - "readproperty", - "observeproperty" + "subscribeevent", + "unsubscribeevent" ], "lorav:byteOffset": 0, - "lorav:type": "u8" + "lorav:wireType": "u8" } ] }, "statusByte": { - "type": "integer", - "readOnly": true, - "observable": true, + "data": { + "type": "integer" + }, "forms": [ { "href": "uplink", "op": [ - "readproperty", - "observeproperty" + "subscribeevent", + "unsubscribeevent" ], "lorav:byteOffset": 1, - "lorav:type": "u8" + "lorav:wireType": "u8" } ] }, "temperature": { - "type": "number", - "unit": "°C", - "readOnly": true, - "observable": true, + "data": { + "type": "number", + "unit": "°C" + }, "forms": [ { "href": "uplink", "op": [ - "readproperty", - "observeproperty" + "subscribeevent", + "unsubscribeevent" ], "lorav:byteOffset": 2, - "lorav:type": "s16", + "lorav:wireType": "s16", "lorav:divisor": 10 } ] }, "humidity": { - "type": "integer", - "unit": "%", - "readOnly": true, - "observable": true, + "data": { + "type": "integer", + "unit": "%" + }, "forms": [ { "href": "uplink", "op": [ - "readproperty", - "observeproperty" + "subscribeevent", + "unsubscribeevent" ], "lorav:byteOffset": 4, - "lorav:type": "u8" + "lorav:wireType": "u8" } ] } + }, + "version": { + "model": "1", + "instance": "1" } } diff --git a/TTC26/examples/dragino-lht65n.td.json b/TTC26/examples/dragino-lht65n.td.json index ab76b3d..b063c5f 100644 --- a/TTC26/examples/dragino-lht65n.td.json +++ b/TTC26/examples/dragino-lht65n.td.json @@ -1,7 +1,10 @@ { "@context": [ "https://www.w3.org/2022/wot/td/v1.1", - { "lorav": "https://www.w3.org/2024/wot/lorawan#" } + { + "lorav": "https://www.w3.org/2024/wot/lorawan#", + "schema": "https://schema.org/" + } ], "@type": "Thing", "id": "urn:dev:dragino:lht65n", @@ -17,119 +20,135 @@ }, "security": "otaa_sc", "base": "lorawan://A84041B98D5CB233/{appKey}/device", - - "lorav:endDeviceId": "dragino-lht65n-01", "lorav:devEUI": "A84041B98D5CB233", "lorav:joinEUI": "0000000000000000", "lorav:macVersion": "1.0.3", - "lorav:brand": "Dragino", - "lorav:model": "LHT65N", - "lorav:hardwareVersion": "1.0", - "lorav:softwareVersion": "1.4", + "schema:brand": "Dragino", + "schema:model": "LHT65N", "lorav:region": "EU868", "lorav:frequencyPlan": "EU_863_870", - "lorav:payloadLayout": "ports", - - "properties": { + "events": { "retransmissionStatus": { - "type": "integer", - "readOnly": true, - "observable": true, "description": "fPort 2 retransmission status bit (byte 6, bit 7). Official branch of interest decodes sensor values when this is 0.", + "data": { + "type": "integer" + }, "forms": [ { "href": "uplink", - "op": ["readproperty", "observeproperty"], + "op": [ + "subscribeevent", + "unsubscribeevent" + ], "lorav:fPort": 2, "lorav:byteOffset": 6, - "lorav:type": "xsd:unsignedByte", + "lorav:wireType": "xsd:unsignedByte", "lorav:bitmask": "0x80" } ] }, "pollMessageStatus": { - "type": "integer", - "readOnly": true, - "observable": true, "description": "fPort 2 poll-message status bit (byte 6, bit 6). Official branch of interest decodes sensor values when this is 0.", + "data": { + "type": "integer" + }, "forms": [ { "href": "uplink", - "op": ["readproperty", "observeproperty"], + "op": [ + "subscribeevent", + "unsubscribeevent" + ], "lorav:fPort": 2, "lorav:byteOffset": 6, - "lorav:type": "xsd:unsignedByte", + "lorav:wireType": "xsd:unsignedByte", "lorav:bitmask": "0x40" } ] }, "extensionCode": { - "type": "integer", - "readOnly": true, - "observable": true, "description": "fPort 2 extension discriminator (byte 6, low nibble). Used to select the temperature/battery decoding path.", + "data": { + "type": "integer" + }, "forms": [ { "href": "uplink", - "op": ["readproperty", "observeproperty"], + "op": [ + "subscribeevent", + "unsubscribeevent" + ], "lorav:fPort": 2, "lorav:byteOffset": 6, - "lorav:type": "xsd:unsignedByte", + "lorav:wireType": "xsd:unsignedByte", "lorav:bitmask": "0x0F" } ] }, "batteryVoltage": { - "type": "number", - "unit": "V", - "readOnly": true, - "observable": true, "description": "fPort 2 battery voltage (`BatV`) from bytes 0..1 (basic extraction path).", + "data": { + "type": "number", + "unit": "V" + }, "forms": [ { "href": "uplink", - "op": ["readproperty", "observeproperty"], + "op": [ + "subscribeevent", + "unsubscribeevent" + ], "lorav:fPort": 2, "lorav:byteOffset": 0, - "lorav:type": "xsd:unsignedShort", + "lorav:wireType": "xsd:unsignedShort", "lorav:multiplier": 0.001 } ] }, "temperature": { - "type": "number", - "unit": "Cel", - "readOnly": true, - "observable": true, "description": "fPort 2 SHT temperature (`TempC_SHT`) from bytes 2..3.", + "data": { + "type": "number", + "unit": "Cel" + }, "forms": [ { "href": "uplink", - "op": ["readproperty", "observeproperty"], + "op": [ + "subscribeevent", + "unsubscribeevent" + ], "lorav:fPort": 2, "lorav:byteOffset": 2, - "lorav:type": "xsd:short", + "lorav:wireType": "xsd:short", "lorav:multiplier": 0.01 } ] }, "humidity": { - "type": "number", - "unit": "%RH", - "readOnly": true, - "observable": true, "description": "fPort 2 humidity from bytes 4..5 (basic extraction path).", + "data": { + "type": "number", + "unit": "%RH" + }, "forms": [ { "href": "uplink", - "op": ["readproperty", "observeproperty"], + "op": [ + "subscribeevent", + "unsubscribeevent" + ], "lorav:fPort": 2, "lorav:byteOffset": 4, - "lorav:type": "xsd:unsignedShort", + "lorav:wireType": "xsd:unsignedShort", "lorav:multiplier": 0.1 } ] } + }, + "version": { + "model": "1.0", + "instance": "1.4" } } diff --git a/TTC26/examples/em300-zld.td.json b/TTC26/examples/em300-zld.td.json index 8bd5729..ca41a11 100644 --- a/TTC26/examples/em300-zld.td.json +++ b/TTC26/examples/em300-zld.td.json @@ -2,7 +2,8 @@ "@context": [ "https://www.w3.org/2022/wot/td/v1.1", { - "lorav": "https://www.w3.org/2024/wot/lorawan#" + "lorav": "https://www.w3.org/2024/wot/lorawan#", + "schema": "https://schema.org/" } ], "@type": "Thing", @@ -18,98 +19,101 @@ }, "security": "otaa_sc", "base": "lorawan://0000000000000000/{appKey}/device", - "lorav:endDeviceId": "milesight-em300-zld-01", "lorav:devEUI": "0000000000000000", "lorav:joinEUI": "0000000000000000", "lorav:macVersion": "1.0.2", - "lorav:brand": "Milesight", - "lorav:model": "EM300-ZLD", - "lorav:hardwareVersion": "1", - "lorav:softwareVersion": "1", + "schema:brand": "Milesight", + "schema:model": "EM300-ZLD", "lorav:region": "EU868", "lorav:frequencyPlan": "EU_863_870_TTN", "lorav:payloadLayout": "tlv", - "properties": { + "events": { "battery": { - "type": "integer", - "readOnly": true, - "observable": true, + "data": { + "type": "integer" + }, "forms": [ { "href": "uplink", "op": [ - "readproperty", - "observeproperty" + "subscribeevent", + "unsubscribeevent" ], "lorav:tag": [ 1, 117 ], - "lorav:type": "u8" + "lorav:wireType": "u8" } ] }, "temperature": { - "type": "number", - "readOnly": true, - "observable": true, + "data": { + "type": "number" + }, "forms": [ { "href": "uplink", "op": [ - "readproperty", - "observeproperty" + "subscribeevent", + "unsubscribeevent" ], "lorav:tag": [ 3, 103 ], - "lorav:type": "s16", + "lorav:wireType": "s16", "lorav:endian": "little", "lorav:divisor": 10 } ] }, "humidity": { - "type": "number", - "readOnly": true, - "observable": true, + "data": { + "type": "number" + }, "forms": [ { "href": "uplink", "op": [ - "readproperty", - "observeproperty" + "subscribeevent", + "unsubscribeevent" ], "lorav:tag": [ 4, 104 ], - "lorav:type": "u8", + "lorav:wireType": "u8", "lorav:divisor": 2 } ] }, "leakage_status": { - "type": "string", - "readOnly": true, - "observable": true, + "data": { + "type": "string", + "oneOf": [ + { + "const": 0, + "title": "normal" + }, + { + "const": 1, + "title": "leak" + } + ] + }, "forms": [ { "href": "uplink", "op": [ - "readproperty", - "observeproperty" + "subscribeevent", + "unsubscribeevent" ], "lorav:tag": [ 5, 0 ], - "lorav:type": "u8", - "lorav:enum": { - "0": "normal", - "1": "leak" - } + "lorav:wireType": "u8" } ] } @@ -123,5 +127,9 @@ "name": "channel_type", "type": "u8" } - ] + ], + "version": { + "model": "1", + "instance": "1" + } } diff --git a/TTC26/examples/generic-lorawan11.td.json b/TTC26/examples/generic-lorawan11.td.json index e3b8b3e..a813203 100644 --- a/TTC26/examples/generic-lorawan11.td.json +++ b/TTC26/examples/generic-lorawan11.td.json @@ -1,7 +1,10 @@ { "@context": [ "https://www.w3.org/2022/wot/td/v1.1", - { "lorav": "https://www.w3.org/2024/wot/lorawan#" } + { + "lorav": "https://www.w3.org/2024/wot/lorawan#", + "schema": "https://schema.org/" + } ], "@type": "Thing", "id": "urn:dev:example:generic-lorawan11", @@ -21,54 +24,61 @@ "description": "LoRaWAN 1.1 OTAA NwkKey (network root key, required for MAC version 1.1.x). Injected at runtime; never stored in this TD." } }, - "security": ["appkey_sc", "nwkkey_sc"], + "security": [ + "appkey_sc", + "nwkkey_sc" + ], "base": "lorawan://70B3D57ED0050001/{appKey}/{nwkKey}/device", - - "lorav:endDeviceId": "generic-lorawan11-01", "lorav:devEUI": "70B3D57ED0050001", "lorav:joinEUI": "0000000000000001", "lorav:macVersion": "1.1.0", - "lorav:brand": "Example", - "lorav:model": "GLW11", - "lorav:hardwareVersion": "1.0", - "lorav:softwareVersion": "1.0", + "schema:brand": "Example", + "schema:model": "GLW11", "lorav:region": "EU868", "lorav:frequencyPlan": "EU_863_870", - "lorav:payloadLayout": "fixed", - - "properties": { + "events": { "battery": { - "type": "integer", - "unit": "%", - "minimum": 0, - "maximum": 100, - "readOnly": true, - "observable": true, "description": "Battery level as a percentage.", + "data": { + "type": "integer", + "unit": "%", + "minimum": 0, + "maximum": 100 + }, "forms": [ { "href": "uplink", - "op": ["readproperty", "observeproperty"], + "op": [ + "subscribeevent", + "unsubscribeevent" + ], "lorav:byteOffset": 0, - "lorav:type": "xsd:unsignedByte" + "lorav:wireType": "xsd:unsignedByte" } ] }, "temperature": { - "type": "number", - "unit": "Cel", - "readOnly": true, - "observable": true, + "data": { + "type": "number", + "unit": "Cel" + }, "forms": [ { "href": "uplink", - "op": ["readproperty", "observeproperty"], + "op": [ + "subscribeevent", + "unsubscribeevent" + ], "lorav:byteOffset": 1, - "lorav:type": "xsd:short", + "lorav:wireType": "xsd:short", "lorav:multiplier": 0.1 } ] } + }, + "version": { + "model": "1.0", + "instance": "1.0" } } diff --git a/TTC26/examples/milesight-am102.td.json b/TTC26/examples/milesight-am102.td.json index 04e2322..e809799 100644 --- a/TTC26/examples/milesight-am102.td.json +++ b/TTC26/examples/milesight-am102.td.json @@ -1,7 +1,10 @@ { "@context": [ "https://www.w3.org/2022/wot/td/v1.1", - { "lorav": "https://www.w3.org/2024/wot/lorawan#" } + { + "lorav": "https://www.w3.org/2024/wot/lorawan#", + "schema": "https://schema.org/" + } ], "@type": "Thing", "id": "urn:dev:milesight:am102", @@ -17,69 +20,91 @@ }, "security": "otaa_sc", "base": "lorawan://A84041B98D5CB233/{appKey}/device", - - "lorav:endDeviceId": "milesight-am102-01", "lorav:devEUI": "A84041B98D5CB233", "lorav:joinEUI": "0000000000000001", "lorav:macVersion": "1.0.3", - "lorav:brand": "Milesight", - "lorav:model": "AM102", - "lorav:hardwareVersion": "1.0", - "lorav:softwareVersion": "1.7", + "schema:brand": "Milesight", + "schema:model": "AM102", "lorav:region": "EU868", "lorav:frequencyPlan": "EU_863_870", - "lorav:payloadLayout": "ctv", "lorav:tagFields": [ - { "name": "channel_id", "type": "u8" }, - { "name": "channel_type", "type": "u8" } + { + "name": "channel_id", + "type": "u8" + }, + { + "name": "channel_type", + "type": "u8" + } ], - - "properties": { + "events": { "battery": { - "type": "integer", - "unit": "%", - "readOnly": true, - "observable": true, + "data": { + "type": "integer", + "unit": "%" + }, "forms": [ { "href": "ctv", - "op": ["readproperty", "observeproperty"], - "lorav:tag": [1, 117], - "lorav:type": "xsd:unsignedByte" + "op": [ + "subscribeevent", + "unsubscribeevent" + ], + "lorav:tag": [ + 1, + 117 + ], + "lorav:wireType": "xsd:unsignedByte" } ] }, "temperature": { - "type": "number", - "unit": "Cel", - "readOnly": true, - "observable": true, + "data": { + "type": "number", + "unit": "Cel" + }, "forms": [ { "href": "ctv", - "op": ["readproperty", "observeproperty"], - "lorav:tag": [3, 103], - "lorav:type": "xsd:short", + "op": [ + "subscribeevent", + "unsubscribeevent" + ], + "lorav:tag": [ + 3, + 103 + ], + "lorav:wireType": "xsd:short", "lorav:endian": "little", "lorav:divisor": 10 } ] }, "humidity": { - "type": "number", - "unit": "%RH", - "readOnly": true, - "observable": true, + "data": { + "type": "number", + "unit": "%RH" + }, "forms": [ { "href": "ctv", - "op": ["readproperty", "observeproperty"], - "lorav:tag": [4, 104], - "lorav:type": "xsd:unsignedByte", + "op": [ + "subscribeevent", + "unsubscribeevent" + ], + "lorav:tag": [ + 4, + 104 + ], + "lorav:wireType": "xsd:unsignedByte", "lorav:divisor": 2 } ] } + }, + "version": { + "model": "1.0", + "instance": "1.7" } } diff --git a/TTC26/examples/netvox-r718a.td.json b/TTC26/examples/netvox-r718a.td.json index b991380..0517cf1 100644 --- a/TTC26/examples/netvox-r718a.td.json +++ b/TTC26/examples/netvox-r718a.td.json @@ -1,7 +1,10 @@ { "@context": [ "https://www.w3.org/2022/wot/td/v1.1", - { "lorav": "https://www.w3.org/2024/wot/lorawan#" } + { + "lorav": "https://www.w3.org/2024/wot/lorawan#", + "schema": "https://schema.org/" + } ], "@type": "Thing", "id": "urn:dev:netvox:r718a", @@ -17,119 +20,143 @@ }, "security": "otaa_sc", "base": "lorawan://0000000000000000/{appKey}/device", - "lorav:endDeviceId": "netvox-r718a-01", "lorav:devEUI": "0000000000000000", "lorav:joinEUI": "0000000000000000", "lorav:macVersion": "1.0.2", - "lorav:brand": "Netvox", - "lorav:model": "R718A", - "lorav:hardwareVersion": "2", - "lorav:softwareVersion": "10", + "schema:brand": "Netvox", + "schema:model": "R718A", "lorav:region": "EU868", "lorav:frequencyPlan": "EU_863_870_TTN", "lorav:payloadLayout": "ports", - "properties": { + "events": { "reportType": { - "type": "integer", "title": "fPort 6 report type", - "readOnly": true, - "observable": true, "description": "Discriminator byte for fPort 6 uplinks. 0 = startup version report, 1 = periodic status report.", + "data": { + "type": "integer" + }, "forms": [ { "href": "uplink", - "op": ["readproperty", "observeproperty"], + "op": [ + "subscribeevent", + "unsubscribeevent" + ], "lorav:fPort": 6, "lorav:byteOffset": 2, - "lorav:type": "xsd:unsignedByte" + "lorav:wireType": "xsd:unsignedByte" } ] }, "batteryVoltage": { - "type": "number", "title": "Battery voltage", - "unit": "V", - "readOnly": true, - "observable": true, "description": "Battery voltage in volts (fPort 6, reportType 1). Carried in bits 0-6 of byte 3 as deci-volts; bit 7 is the low-battery flag (see lowBattery). The official codec appends a '(low battery)' string suffix when that flag is set -- not representable in this vocabulary, so it is exposed only as the separate lowBattery property.", + "data": { + "type": "number", + "unit": "V" + }, "forms": [ { "href": "uplink", - "op": ["readproperty", "observeproperty"], + "op": [ + "subscribeevent", + "unsubscribeevent" + ], "lorav:fPort": 6, - "lorav:switchField": "reportType", - "lorav:switchValue": 1, "lorav:slot": 0, "lorav:byteOffset": 3, - "lorav:type": "xsd:unsignedByte", + "lorav:wireType": "xsd:unsignedByte", "lorav:bitmask": "0x7F", - "lorav:divisor": 10 + "lorav:divisor": 10, + "lorav:presentWhen": { + "field": "reportType", + "value": 1 + } } ] }, "lowBattery": { - "type": "integer", "title": "Low battery flag", - "readOnly": true, - "observable": true, - "minimum": 0, - "maximum": 1, "description": "Low-battery indicator carried in bit 7 of byte 3 (fPort 6, reportType 1); 1 = low battery.", + "data": { + "type": "integer", + "minimum": 0, + "maximum": 1 + }, "forms": [ { "href": "uplink", - "op": ["readproperty", "observeproperty"], + "op": [ + "subscribeevent", + "unsubscribeevent" + ], "lorav:fPort": 6, - "lorav:switchField": "reportType", - "lorav:switchValue": 1, "lorav:slot": 1, "lorav:byteOffset": 3, - "lorav:type": "xsd:unsignedByte", - "lorav:bitmask": "0x80" + "lorav:wireType": "xsd:unsignedByte", + "lorav:bitmask": "0x80", + "lorav:presentWhen": { + "field": "reportType", + "value": 1 + } } ] }, "temperature": { - "type": "number", "title": "Temperature", - "unit": "Cel", - "readOnly": true, - "observable": true, "description": "Measured temperature (fPort 6, reportType 1), signed big-endian hundredths of a degree Celsius.", + "data": { + "type": "number", + "unit": "Cel" + }, "forms": [ { "href": "uplink", - "op": ["readproperty", "observeproperty"], + "op": [ + "subscribeevent", + "unsubscribeevent" + ], "lorav:fPort": 6, - "lorav:switchField": "reportType", - "lorav:switchValue": 1, "lorav:slot": 2, "lorav:byteOffset": 4, - "lorav:type": "xsd:short", - "lorav:divisor": 100 + "lorav:wireType": "xsd:short", + "lorav:divisor": 100, + "lorav:presentWhen": { + "field": "reportType", + "value": 1 + } } ] }, "humidity": { - "type": "number", "title": "Relative humidity", - "unit": "%RH", - "readOnly": true, - "observable": true, "description": "Relative humidity (fPort 6, reportType 1), unsigned big-endian hundredths of a percent.", + "data": { + "type": "number", + "unit": "%RH" + }, "forms": [ { "href": "uplink", - "op": ["readproperty", "observeproperty"], + "op": [ + "subscribeevent", + "unsubscribeevent" + ], "lorav:fPort": 6, - "lorav:switchField": "reportType", - "lorav:switchValue": 1, "lorav:slot": 3, "lorav:byteOffset": 6, - "lorav:type": "xsd:unsignedShort", - "lorav:divisor": 100 + "lorav:wireType": "xsd:unsignedShort", + "lorav:divisor": 100, + "lorav:presentWhen": { + "field": "reportType", + "value": 1 + } } ] } + }, + "version": { + "model": "2", + "instance": "10" } }