Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
28cf528
initial commit of the proxy gateway, this is the HA side of the code
atimgraves Jul 6, 2026
2526fe3
documentation on the time series database
atimgraves Jul 7, 2026
ef14986
time series DB notes
atimgraves Jul 7, 2026
1488824
update to the latest oci sdk version as that's needed if doing
atimgraves Jul 7, 2026
d0d3f25
update with 1st pass at gateway device implementation (script to set it
atimgraves Jul 7, 2026
4def252
remove obselete json samples
atimgraves Jul 8, 2026
47f7fe5
expanded the conditions to cover the full endpoint path
atimgraves Jul 8, 2026
4d3e8d7
now conditions cover the full endpoint path
atimgraves Jul 8, 2026
7b7b76f
rename the adapter files to Routes as it's a better description
atimgraves Jul 8, 2026
5d24dcc
added support for uploading the gateway stats and tested
atimgraves Jul 10, 2026
08a3e97
added scripting support for creation of a gateway and indirectly
atimgraves Jul 10, 2026
951dc2a
update timestamp strings ti be microseconds (apparently milli seconds is
atimgraves Jul 10, 2026
5e9d5f0
rename power entities to power watts to differentiate for wh/kwh/kw
atimgraves Jul 10, 2026
0455f30
re-written because the serialization only works on the class it's given,
atimgraves Jul 10, 2026
be5cac7
update gatewat stats / config uploads to make them configurable
atimgraves Jul 13, 2026
8abed7e
support additional iot data types
atimgraves Jul 13, 2026
ad07774
finally got the mqtt turn off working for the gateway config / stats
atimgraves Jul 13, 2026
a0df018
added example type which is known to fail
atimgraves Jul 13, 2026
9d75ebb
make the mqtt upload handler / publicher conditional on
atimgraves Jul 13, 2026
57dbff3
allow for multiple entities in an upload, add some additional IoTType
atimgraves Jul 13, 2026
e1671ec
update testing / sample entries to support the multi element uploads
atimgraves Jul 13, 2026
3602aa7
Make the HAState support a generic string comparisson for true / false
atimgraves Jul 13, 2026
212cd86
Added support for temperature and relative humidity IoT Types
atimgraves Jul 14, 2026
9270859
added AIR_PRESSURE iot sensor
atimgraves Jul 14, 2026
ae4ffe7
made handling unexpected HA state attributes more robust, added check
atimgraves Jul 14, 2026
1d5f769
more realistic default air pressure field name
atimgraves Jul 14, 2026
4a1168e
added additional gateway models / adapters / entities
atimgraves Jul 14, 2026
d8d1f8a
added some example configs for reference
atimgraves Jul 14, 2026
5efd45f
tightened up logging, added copyright
atimgraves Jul 14, 2026
97ada55
corrected error in sample setting output
atimgraves Jul 14, 2026
8991abc
fixed create bastion to allow for non active bastions and to ignore
atimgraves Jul 14, 2026
83dcc1f
update sample VM setup instructions
atimgraves Jul 14, 2026
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
2 changes: 2 additions & 0 deletions IoTDBJDBC/SetupAndDataAccessNotes/GrafanaPlugin.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The development team are building a grafana plugin that can be used to connect to the time series DB
this is available at https://github.com/oracle-samples/oracle-telemetry-streaming
19 changes: 19 additions & 0 deletions IoTDBJDBC/SetupAndDataAccessNotes/SQLAccess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#SQL Access
## Why ?
Though the primary access will be through promQL that is more for monitoring access. For broader access, for example combining business and IoT data (assuming both are in the same DB) there is also the option to access the data using "normal" SQL which allow access to the individual (not time series) data
##How
You need to connect to the database using your "normal" DB connect mechanisms (JDBC, SQLDeveloper, SQLPlus etc.) then access the TELEMETRY_METRICS data

'select * from TELEMETRY_METRICS order by metric_time_epoch desc fetch first 10 rows only'

|METRIC_NAME|METRIC_TAGS|METRIC_VALUE|METRIC_EPOCH_TIMESTAMP|
|:-----:|:-----:|:-----:|:-----:|
|iot.normalized.inverter_power_watts_point_in_time|{"iot_content_path":"InverterPowerWattsPointInTime","iot_content_type":"DECIMAL","iot_digital_twin_instance_id":"ocid1.iotdigitaltwininstance.oc1.uk-london-1.amaaaaaauevftmr7h6t75eifevhfihvbwazwi43ndgrauaawue22d6svdpna","iot_digital_twin_model_id":"ocid1.iotdigitaltwinmodel.oc1.uk-london-1.amaaaaaauevftmr7wuslrtqim6zflcxhqaprmzib74p76ev64g4zqy7edbva","iot_digital_twin_model_name":"homebattery","service_name":"IoTDBJDBC"}|-1947|1783075316.509|
|iot.normalized.discharge_power |{"iot_content_path":"DischargePower","iot_content_type":"DECIMAL","iot_digital_twin_instance_id":"ocid1.iotdigitaltwininstance.oc1.uk-london-1.amaaaaaauevftmr7h6t75eifevhfihvbwazwi43ndgrauaawue22d6svdpna","iot_digital_twin_model_id":"ocid1.iotdigitaltwinmodel.oc1.uk-london-1.amaaaaaauevftmr7wuslrtqim6zflcxhqaprmzib74p76ev64g4zqy7edbva","iot_digital_twin_model_name":"homebattery","service_name":"IoTDBJDBC"}| 0 |1783075316.509|
|iot.normalized.capacity_remaining |{"iot_content_path":"CapacityRemaining","iot_content_type":"DECIMAL","iot_digital_twin_instance_id":"ocid1.iotdigitaltwininstance.oc1.uk-london-1.amaaaaaauevftmr7h6t75eifevhfihvbwazwi43ndgrauaawue22d6svdpna","iot_digital_twin_model_id":"ocid1.iotdigitaltwinmodel.oc1.uk-london-1.amaaaaaauevftmr7wuslrtqim6zflcxhqaprmzib74p76ev64g4zqy7edbva","iot_digital_twin_model_name":"homebattery","service_name":"IoTDBJDBC"}| 8406 |1783075316.509|
|iot.normalized.reserved_charge_percentage |{"iot_content_path":"ReservedChargePercentage","iot_content_type":"DECIMAL","iot_digital_twin_instance_id":"ocid1.iotdigitaltwininstance.oc1.uk-london-1.amaaaaaauevftmr7h6t75eifevhfihvbwazwi43ndgrauaawue22d6svdpna","iot_digital_twin_model_id":"ocid1.iotdigitaltwinmodel.oc1.uk-london-1.amaaaaaauevftmr7wuslrtqim6zflcxhqaprmzib74p76ev64g4zqy7edbva","iot_digital_twin_model_name":"homebattery","service_name":"IoTDBJDBC"} |5 |1783075316.509|


Important to note. Open Telemetry recommends the use of dot separated namespaces with the names in snake_case, for example 'iot.normalized.inverter_power_watts_point_in_time' the IoTDBJDBC upload code supports this, currently however there is a "feature" in the time series DB code that on ingest converts the names of tags (also known as attributes) into only snake_case (e.g. iot.digital_twin.instance_id, to iot_digital_twin_instance_id) This was implemented to support PromQL (which seems to only like the use of _) but it means that when querying the data the tags may not be what you expect. This is being fixed, but for now when using the tags (which you will need to use to identify the specific devices) remember it's iot_digital_twin_instance_id

Also note that the upload code tries to do C like boolean mappings, so true is 1 and false is 0;
2 changes: 1 addition & 1 deletion IoTDBJDBC/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ SOFTWARE. -->
<packaging>jar</packaging>
<jdk.version>21</jdk.version>
<release.version>21</release.version>
<version.ocisdk>3.74.2</version.ocisdk>
<version.ocisdk>3.91.0</version.ocisdk>
<version.lombok>1.18.46</version.lombok>
<version.slf4j>2.0.7</version.slf4j>
<!-- Oracle JDBC 23ai line (set to the latest approved version) -->
Expand Down
51 changes: 51 additions & 0 deletions IoTDemoProxyGateway/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
42 changes: 42 additions & 0 deletions IoTDemoProxyGateway/.factorypath
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<factorypath>
<factorypathentry kind="VARJAR" id="M2_REPO/org/projectlombok/lombok/1.18.42/lombok-1.18.42.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/micronaut/micronaut-inject-java/4.10.25/micronaut-inject-java-4.10.25.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/slf4j/slf4j-api/2.0.17/slf4j-api-2.0.17.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/micronaut/micronaut-core-processor/4.10.25/micronaut-core-processor-4.10.25.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/micronaut/micronaut-inject/4.10.25/micronaut-inject-4.10.25.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/jakarta/inject/jakarta.inject-api/2.0.1/jakarta.inject-api-2.0.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/jakarta/annotation/jakarta.annotation-api/2.1.1/jakarta.annotation-api-2.1.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/micronaut/micronaut-core/4.10.25/micronaut-core-4.10.25.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/micronaut/micronaut-aop/4.10.25/micronaut-aop-4.10.25.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/github/javaparser/javaparser-symbol-solver-core/3.27.0/javaparser-symbol-solver-core-3.27.0.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/com/github/javaparser/javaparser-core/3.27.0/javaparser-core-3.27.0.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/checkerframework/checker-qual/3.49.4/checker-qual-3.49.4.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/micronaut/sourcegen/micronaut-sourcegen-bytecode-writer/1.8.2/micronaut-sourcegen-bytecode-writer-1.8.2.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/micronaut/sourcegen/micronaut-sourcegen-model/1.8.2/micronaut-sourcegen-model-1.8.2.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/ow2/asm/asm-commons/9.8/asm-commons-9.8.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/ow2/asm/asm-tree/9.8/asm-tree-9.8.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/ow2/asm/asm-util/9.8/asm-util-9.8.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/ow2/asm/asm-analysis/9.8/asm-analysis-9.8.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/micronaut/micronaut-core-reactive/4.10.25/micronaut-core-reactive-4.10.25.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/reactivestreams/reactive-streams/1.0.4/reactive-streams-1.0.4.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/ow2/asm/asm/9.8/asm-9.8.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/micronaut/micronaut-graal/4.10.25/micronaut-graal-4.10.25.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/micronaut/micronaut-http-validation/4.10.25/micronaut-http-validation-4.10.25.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/micronaut/micronaut-http-server/4.10.25/micronaut-http-server-4.10.25.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/micronaut/micronaut-http/4.10.25/micronaut-http-4.10.25.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/micronaut/micronaut-context-propagation/4.10.25/micronaut-context-propagation-4.10.25.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/micronaut/micronaut-router/4.10.25/micronaut-router-4.10.25.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/projectreactor/reactor-core/3.7.12/reactor-core-3.7.12.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/micronaut/micronaut-websocket/4.10.25/micronaut-websocket-4.10.25.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/micronaut/micronaut-http-client-core/4.10.25/micronaut-http-client-core-4.10.25.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/micronaut/micronaut-discovery-core/4.10.25/micronaut-discovery-core-4.10.25.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/micronaut/serde/micronaut-serde-processor/2.16.2/micronaut-serde-processor-2.16.2.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/micronaut/serde/micronaut-serde-api/2.16.2/micronaut-serde-api-2.16.2.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/micronaut/micronaut-context/4.9.11/micronaut-context-4.9.11.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/micronaut/micronaut-json-core/4.9.11/micronaut-json-core-4.9.11.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/micronaut/validation/micronaut-validation-processor/4.12.0/micronaut-validation-processor-4.12.0.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/micronaut/validation/micronaut-validation/4.12.0/micronaut-validation-4.12.0.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/jakarta/validation/jakarta.validation-api/3.1.1/jakarta.validation-api-3.1.1.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/io/micronaut/reactor/micronaut-reactor/3.9.0/micronaut-reactor-3.9.0.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="PLUGIN" id="org.eclipse.jst.ws.annotations.core" enabled="false" runInBatchMode="false"/>
</factorypath>
4 changes: 4 additions & 0 deletions IoTDemoProxyGateway/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/config/
/configsecure/
/target/
/samples/
23 changes: 23 additions & 0 deletions IoTDemoProxyGateway/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>IoTDemoProxyGateway</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding//src/test/resources=UTF-8
encoding/<project>=UTF-8
6 changes: 6 additions & 0 deletions IoTDemoProxyGateway/.settings/org.eclipse.jdt.apt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
eclipse.preferences.version=1
org.eclipse.jdt.apt.aptEnabled=true
org.eclipse.jdt.apt.genSrcDir=target/generated-sources/annotations
org.eclipse.jdt.apt.genTestSrcDir=target/generated-test-sources/test-annotations
org.eclipse.jdt.apt.processorOptions/micronaut.processing.group=com.oracle.demo.timg.iot.iotproxygateway
org.eclipse.jdt.apt.processorOptions/micronaut.processing.module=IoTDemoProxyGateway
10 changes: 10 additions & 0 deletions IoTDemoProxyGateway/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.methodParameters=generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=21
org.eclipse.jdt.core.compiler.compliance=21
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.processAnnotations=enabled
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=21
4 changes: 4 additions & 0 deletions IoTDemoProxyGateway/.settings/org.eclipse.m2e.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
Loading