Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f56b008
made uploading options configurable to allow for a simple digital twin
atimgraves Nov 14, 2025
f3f10a3
fixed incorrect debug string contents on httpclienterror
atimgraves Nov 14, 2025
a3f7e3e
updated the sonnen data objects to enable de-serialization on the
atimgraves Nov 14, 2025
c7d16ab
added monitorreference listener config
atimgraves Nov 17, 2025
8bd66a1
added monitor that tracks the status / config uploads and outputs them
atimgraves Nov 17, 2025
0c27f9b
added timestamp to the config and status objects representing when the
atimgraves Nov 17, 2025
01b7f45
rename uploaders in prep for mqtt and https uploading
atimgraves Nov 17, 2025
f53fc56
renamt the battery client to be https to make it clear it's not using
atimgraves Nov 17, 2025
03e8e5a
removed obselete password checker util
atimgraves Nov 17, 2025
9660ba8
split out the device id and moved the u[ploaders to a mqtt class in
atimgraves Nov 17, 2025
c29318c
better description in log output as the http client will use similar
atimgraves Nov 17, 2025
af06cc5
fix timestamp format
atimgraves Nov 19, 2025
2098449
better log text
atimgraves Nov 19, 2025
02abff6
added support for https REST uploads
atimgraves Nov 19, 2025
7d8941b
update the paths for the http and mqtt uploads as the current iot route
atimgraves Nov 24, 2025
8864593
added examples on how to create the various adaptors and elements for
atimgraves Nov 24, 2025
01fda8d
changed filter paths to reflect the use of sonnenstatus and
atimgraves Nov 24, 2025
e1b3edb
added support for a configurable property in the config that can be set
atimgraves Nov 24, 2025
f9c49be
added support to capture data from the sonnen for later replay / bulk
atimgraves Nov 25, 2025
b2a0f3e
better descriptive text for the config examples
atimgraves Nov 25, 2025
940dbf1
made the command handler an optional service controlled by the config
atimgraves Nov 25, 2025
b432135
mqtt related services not require the core mqtts properties to be set
atimgraves Nov 25, 2025
71ad454
added startup handlers so we can see what's happening for all the mqtt
atimgraves Nov 25, 2025
9ff238f
get the device.id property for the command handler and use it in the
atimgraves Nov 25, 2025
983fa14
add the commanddemoplaceholder telemetry item to support demoing the
atimgraves Nov 25, 2025
fcfbdbd
added instructions on how to send data using mqtt and use the IoT to
atimgraves Nov 25, 2025
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
1 change: 1 addition & 0 deletions IoTSonnenUploader/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
/.project
/.factorypath
/.classpath
/OCISetup/
1 change: 1 addition & 0 deletions IoTSonnenUploader/DigitalTwin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/jq-notes.txt
14 changes: 14 additions & 0 deletions IoTSonnenUploader/DigitalTwin/Explanation.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
These files defint the various elements of the digital twin process for the Oracle IoT cloud service
They are written in the Digital Twin Definition Language v3 (DTDLv3)- see the specification at https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v3/DTDL.Specification.v3.md
Identifiers are based on the Digital Twin Modeling Identifier (DTMI) - see https://github.com/Azure/opendigitaltwins-dtdl/tree/master/DTMI
Items that do not use a full DTMI identifier are the elements defined in standard schemas at https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v3/DTDL.Specification.v3.md#standard-schemas
Note that the context may use extentions, see the list of extensions at https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v3/DTDL.v3.md#language-extensions

the reference data for the configuration is
{"softwareVersion":"1.18.4","timeOfUseSchedule":"[{\"start\":\"23:30\",\"stop\":\"00:00\",\"threshold_p_max\":22500},{\"start\":\"00:00\",\"stop\":\"05:30\",\"threshold_p_max\":20000}]","timestamp":"2025-11-18T16:47:32.900336Z[Europe/London]"}

the reference data for the status is
{"consumptionAvgWattsLastMinute":339,"consumptionWattsPointInTime":333,"currentBatteryCapacityPercentage":59,"currentBatteryCapacitySystemPercentage":62,"gridConsumptionWattsPointInTime":41,"operatingMode":2,"remainingBatteryCapacityWattHours":9102,"reservedBatteryCapacityPercentage":5,"solarProductionWattsPointInTime":131,"time":1763981430279,"timestamp":"2025-11-24T10:50:30.279369Z[Europe/London]","batteryCharging":false,"batteryDischarging":true}

Note that these will be updated over time. to get this data use a loval mqtt server and set the property mqtt.monitorreference.enabled to true (if missing it defaults to false.
Then as the status and configuration are published they wil be displayed as the contents string
160 changes: 160 additions & 0 deletions IoTSonnenUploader/DigitalTwin/HomeBatteryDTMI.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
{
"@context": [
"dtmi:dtdl:context;3",
"dtmi:dtdl:extension:historization;1",
"dtmi:dtdl:extension:quantitativeTypes;1",
"dtmi:com:oracle:dtdl:extension:validation;1"
],
"@id": "dtmi:com:oracle:demo:timg:iot:homebattery;1",
"@type": "Interface",
"contents": [
{
"@type": [
"Telemetry",
"Historized"
],
"displayName": "Status Data timestamp",
"name": "StatusTimestamp",
"schema": "dateTime"
},
{
"@type": [
"Telemetry",
"Historized"
],
"displayName": "Battery Operating Mode",
"name": "OperatingMode",
"schema": "string"
},
{
"@type": [
"Telemetry",
"Historized",
"Validated"
],
"displayName": "Current Battery Charge Percentage",
"name": "CurrentChargePercentage",
"schema": "integer",
"minimum": 0,
"maximum": 100
},
{
"@type": [
"Telemetry",
"Historized",
"Validated"
],
"displayName": "Reserved Battery Charge Percentage",
"name": "ReservedChargePercentage",
"schema": "integer",
"minimum": 0,
"maximum": 100
},
{
"@type": [
"Telemetry",
"Historized",
"Energy"
],
"displayName": "Remaining Power In Battery",
"name": "CapacityRemaining",
"schema": "integer",
"unit": "wattHour"
},
{
"@type": [
"Telemetry",
"Historized"
],
"displayName": "Battery Is Charging",
"name": "BatteryCharging",
"schema": "string"
},
{
"@type": [
"Telemetry",
"Historized"
],
"displayName": "Battery Is Discharging",
"name": "BatteryDischarging",
"schema": "boolean"
},
{
"@type": [
"Telemetry",
"Historized",
"EnergyRate"
],
"displayName": "Battery Power Supplied 1 min average",
"name": "DischargeRateAvgLastMinute",
"schema": "integer",
"unit": "watt"
},
{
"@type": [
"Telemetry",
"Historized",
"EnergyRate"
],
"displayName": "Battery Power Supplied Point In Time",
"name": "DischargePower",
"schema": "integer",
"unit": "watt"
},
{
"@type": [
"Telemetry",
"Historized",
"EnergyRate"
],
"displayName": "Grid Consumption Point In Time",
"name": "GridFlowPointInTime",
"schema": "integer",
"unit": "watt"
},
{
"@type": [
"Telemetry",
"Historized",
"EnergyRate"
],
"displayName": "Solar Power Production Point In Time",
"name": "SolarGeneration",
"schema": "integer",
"unit": "watt"
},
{
"@type": [
"Telemetry",
"Historized"
],
"displayName": "Configuration Data timestamp",
"name": "ConfigurationTimestamp",
"schema": "dateTime"
},
{
"@type": [
"Telemetry"
],
"displayName": "Software Version",
"name": "SoftwareVersion",
"schema": "string"
},
{
"@type": [
"Telemetry"
],
"displayName": "Time Of Use Schedule",
"name": "TimeOfUseSchedule",
"schema": "string"
},
{
"@type": [
"Telemetry"
],
"displayName": "Command Demo Placeholder",
"name": "CommandDemoPlaceholder",
"schema": "string"
}
]
}
Loading