Skip to content

Commit 4a1168e

Browse files
committed
added additional gateway models / adapters / entities
1 parent 1d5f769 commit 4a1168e

47 files changed

Lines changed: 503 additions & 4 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

IoTSonnenUploader/DigitalTwin/Sample_SQL

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,8 @@ This will get the rejected data info in human readable form
1717
select ENDPOINT, TIME_RECEIVED, REASON_MESSAGE, UTL_RAW.CAST_TO_VARCHAR2(DBMS_LOB.SUBSTR(content, 4000, 1)) AS content_text from rejected_data order by TIME_RECEIVED DESC fetch first 10 rows only;
1818

1919
this gets the most recent normalized data
20-
select * from SNAPSHOT_DATA order by TIME_OBSERVED desc fetch first 10 rows only ;
20+
select * from SNAPSHOT_DATA order by TIME_OBSERVED desc fetch first 20 rows only ;
21+
22+
23+
this gets the most recent history data, best to ass a WHERE contentPath = 'path' clause though to focus on specific data items
24+
select * from HISTORIZED_DATA order by TIME_OBSERVED desc fetch first 10 rows only ;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/EntityTestData.txt
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Model data for Illuminance
2+
# display name of the model (its file name is worked out based on the suffix
3+
# DTMI.json)
4+
export ENTITY_MODEL_NAME=HATAirPressureModel
5+
# display name of the adapter (its envelope and route file names are worked
6+
# out based on the suffixs Envelope.json and Rutes.json respetivly)
7+
export ENTITY_ADAPTER_NAME=HAAirPressureAdapter
8+
# the last part of the endpoint, used for the sample data commands, if the
9+
# routes file has a condition based on the endpoint then this must match
10+
export ENTITY_ENDPOINT_NAME=airpressure
11+
# sample payload for the sample data commands, be very carefull about
12+
# escaping, and for the timestamp field use the variable $CURRENT_TS
13+
# as the sample code will generate a line to set it. The sample generator
14+
# will also produce the wrapper json which specifies the devicekey
15+
# for each instance
16+
export ENTITY_SAMPLE_DATA="{\\\"airpressure\\\": 1013.25, \\\"timestamp\\\": \\\"\$CURRENT_TS\\\"}"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"@context": [
3+
"dtmi:dtdl:context;3",
4+
"dtmi:dtdl:extension:historization;1",
5+
"dtmi:dtdl:extension:quantitativeTypes;1",
6+
"dtmi:com:oracle:dtdl:extension:validation;1"
7+
],
8+
"@id": "dtmi:com:oracle:demo:timg:iot:homeassistant:airpressure;1",
9+
"@type": "Interface",
10+
"contents": [
11+
{
12+
"@type": [
13+
"Telemetry",
14+
"Historized",
15+
"Pressure",
16+
"Validated"
17+
],
18+
"displayName": "Air Pressure",
19+
"name": "airpressure",
20+
"schema": "double",
21+
"unit": "millibar",
22+
"minimum": -1,
23+
"maximum": 1000000000
24+
}
25+
]
26+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"reference-endpoint": "house/homeassistant/entities/airpressure",
3+
"reference-payload": {
4+
"data": {
5+
"payload": {
6+
"timestamp": "2026-07-10T16:09:18.934123Z",
7+
"airpressure": 1013.1
8+
},
9+
"devicekey": "def"
10+
},
11+
"data-format": "JSON"
12+
},
13+
"envelope-mapping": {
14+
"timeObserved": "$.payload.timestamp"
15+
}
16+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[
2+
{
3+
"condition": "${endpoint(1) == \"house\" and endpoint(2) == \"homeassistant\" and endpoint(3) == \"entities\" and endpoint(4) == \"airpressure\"}",
4+
"description": "Air pressure adapter",
5+
"payload-mapping": {
6+
"$.airpressure": "$.payload.airpressure"
7+
},
8+
"reference-payload": {
9+
"dataFormat": "JSON",
10+
"data": {
11+
"payload": {
12+
"timestamp": "2026-07-10T16:09:18.934123Z",
13+
"airpressure": 1023.1
14+
},
15+
"devicekey": "def"
16+
}
17+
}
18+
}
19+
]
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export INSTANCE_DISPLAY_NAME=AverageAirPressure
2+
export INSTANCE_KEY=AvgArPrssr
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/EntityTestData.txt
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Model data for Illuminance
2+
# display name of the model (its file name is worked out based on the suffix
3+
# DTMI.json)
4+
export ENTITY_MODEL_NAME=HADailyGridEnergyFlowsModel
5+
# display name of the adapter (its envelope and route file names are worked
6+
# out based on the suffixs Envelope.json and Rutes.json respetivly)
7+
export ENTITY_ADAPTER_NAME=HADailyGridEnergyFlowsAdapter
8+
# the last part of the endpoint, used for the sample data commands, if the
9+
# routes file has a condition based on the endpoint then this must match
10+
export ENTITY_ENDPOINT_NAME=dailygridenergyflows
11+
# sample payload for the sample data commands, be very carefull about
12+
# escaping, and for the timestamp field use the variable $CURRENT_TS
13+
# as the sample code will generate a line to set it. The sample generator
14+
# will also produce the wrapper json which specifies the devicekey
15+
# for each instance
16+
export ENTITY_SAMPLE_DATA="{\\\"importkwh\\\": 1.15, \\\"exportkwh\\\": 5.5,\\\"timestamp\\\": \\\"\$CURRENT_TS\\\"}"
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"@context": [
3+
"dtmi:dtdl:context;3",
4+
"dtmi:dtdl:extension:historization;1",
5+
"dtmi:dtdl:extension:quantitativeTypes;1",
6+
"dtmi:com:oracle:dtdl:extension:validation;1"
7+
],
8+
"@id": "dtmi:com:oracle:demo:timg:iot:homeassistant:dailygridenergyflows;1",
9+
"@type": "Interface",
10+
"contents": [
11+
{
12+
"@type": [
13+
"Telemetry",
14+
"Historized",
15+
"Energy"
16+
],
17+
"displayName": "Imported Energy",
18+
"name": "importkwh",
19+
"schema": "double",
20+
"unit": "kilowattHour"
21+
},
22+
{
23+
"@type": [
24+
"Telemetry",
25+
"Historized",
26+
"Energy"
27+
],
28+
"displayName": "Exported Energy",
29+
"name": "exportkwh",
30+
"schema": "double",
31+
"unit": "kilowattHour"
32+
}
33+
]
34+
}

0 commit comments

Comments
 (0)