-
Notifications
You must be signed in to change notification settings - Fork 476
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for the device types introduced by the Matter 1.4 Spec. Co-authored-by: Harrison Carter <harrison.carter@smartthings.com> Co-authored-by: Nick DeBoom <nick.deboom@smartthings.com> Co-authored-by: Hunsup Jung <hunsup.jung@samsung.com>
- Loading branch information
1 parent
8456daf
commit 432f686
Showing
167 changed files
with
5,010 additions
and
1,024 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
name: 'Matter Energy' | ||
packageKey: 'matter-energy' | ||
permissions: | ||
matter: {} | ||
description: "SmartThings driver for Matter Energy devices" | ||
vendorSupportInformation: "https://support.smartthings.com" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
matterGeneric: | ||
- id: "matter/evse" | ||
deviceLabel: Matter EVSE | ||
deviceTypes: | ||
- id: 0x0510 | ||
- id: 0x050C | ||
deviceProfileName: evse | ||
- id: "matter/solar-power" | ||
deviceLabel: Matter Solar Power | ||
deviceTypes: | ||
- id: 0x0017 #Solar Power | ||
deviceProfileName: solar-power | ||
- id: "matter/battery-storage" | ||
deviceLabel: Matter Battery Storage | ||
deviceTypes: | ||
- id: 0x0018 #Battery Storage | ||
deviceProfileName: battery-storage |
30 changes: 30 additions & 0 deletions
30
drivers/SmartThings/matter-energy/profiles/battery-storage.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: battery-storage | ||
components: | ||
- id: main | ||
capabilities: | ||
- id: battery | ||
version: 1 | ||
- id: chargingState | ||
version: 1 | ||
- id: powerMeter | ||
version: 1 | ||
- id: firmwareUpdate | ||
version: 1 | ||
- id: refresh | ||
version: 1 | ||
categories: | ||
- name: Battery | ||
- id: importedEnergy | ||
label: Imported Energy | ||
capabilities: | ||
- id: energyMeter | ||
version: 1 | ||
- id: powerConsumptionReport | ||
version: 1 | ||
- id: exportedEnergy | ||
label: Exported Energy | ||
capabilities: | ||
- id: energyMeter | ||
version: 1 | ||
- id: powerConsumptionReport | ||
version: 1 |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions
18
drivers/SmartThings/matter-energy/profiles/solar-power.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: solar-power | ||
components: | ||
- id: main | ||
capabilities: | ||
- id: energyMeter | ||
version: 1 | ||
- id: powerMeter | ||
version: 1 | ||
- id: firmwareUpdate | ||
version: 1 | ||
- id: refresh | ||
version: 1 | ||
categories: | ||
- name: SolarPanel | ||
- id: exportedEnergy | ||
capabilities: | ||
- id: powerConsumptionReport | ||
version: 1 |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
...ter-energy/src/ElectricalEnergyMeasurement/server/attributes/CumulativeEnergyExported.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
local cluster_base = require "st.matter.cluster_base" | ||
local data_types = require "st.matter.data_types" | ||
local TLVParser = require "st.matter.TLV.TLVParser" | ||
|
||
local CumulativeEnergyExported = { | ||
ID = 0x0002, | ||
NAME = "CumulativeEnergyExported", | ||
base_type = require "ElectricalEnergyMeasurement.types.EnergyMeasurementStruct", | ||
} | ||
|
||
function CumulativeEnergyExported:new_value(...) | ||
local o = self.base_type(table.unpack({...})) | ||
self:augment_type(o) | ||
return o | ||
end | ||
|
||
function CumulativeEnergyExported:read(device, endpoint_id) | ||
return cluster_base.read( | ||
device, | ||
endpoint_id, | ||
self._cluster.ID, | ||
self.ID, | ||
nil | ||
) | ||
end | ||
|
||
function CumulativeEnergyExported:subscribe(device, endpoint_id) | ||
return cluster_base.subscribe( | ||
device, | ||
endpoint_id, | ||
self._cluster.ID, | ||
self.ID, | ||
nil | ||
) | ||
end | ||
|
||
function CumulativeEnergyExported:set_parent_cluster(cluster) | ||
self._cluster = cluster | ||
return self | ||
end | ||
|
||
function CumulativeEnergyExported:build_test_report_data( | ||
device, | ||
endpoint_id, | ||
value, | ||
status | ||
) | ||
local data = data_types.validate_or_build_type(value, self.base_type) | ||
self:augment_type(data) | ||
return cluster_base.build_test_report_data( | ||
device, | ||
endpoint_id, | ||
self._cluster.ID, | ||
self.ID, | ||
data, | ||
status | ||
) | ||
end | ||
|
||
function CumulativeEnergyExported:deserialize(tlv_buf) | ||
local data = TLVParser.decode_tlv(tlv_buf) | ||
self:augment_type(data) | ||
return data | ||
end | ||
|
||
setmetatable(CumulativeEnergyExported, {__call = CumulativeEnergyExported.new_value, __index = CumulativeEnergyExported.base_type}) | ||
return CumulativeEnergyExported |
67 changes: 67 additions & 0 deletions
67
...ter-energy/src/ElectricalEnergyMeasurement/server/attributes/CumulativeEnergyImported.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
local cluster_base = require "st.matter.cluster_base" | ||
local data_types = require "st.matter.data_types" | ||
local TLVParser = require "st.matter.TLV.TLVParser" | ||
|
||
local CumulativeEnergyImported = { | ||
ID = 0x0001, | ||
NAME = "CumulativeEnergyImported", | ||
base_type = require "ElectricalEnergyMeasurement.types.EnergyMeasurementStruct", | ||
} | ||
|
||
function CumulativeEnergyImported:new_value(...) | ||
local o = self.base_type(table.unpack({...})) | ||
self:augment_type(o) | ||
return o | ||
end | ||
|
||
function CumulativeEnergyImported:read(device, endpoint_id) | ||
return cluster_base.read( | ||
device, | ||
endpoint_id, | ||
self._cluster.ID, | ||
self.ID, | ||
nil | ||
) | ||
end | ||
|
||
function CumulativeEnergyImported:subscribe(device, endpoint_id) | ||
return cluster_base.subscribe( | ||
device, | ||
endpoint_id, | ||
self._cluster.ID, | ||
self.ID, | ||
nil | ||
) | ||
end | ||
|
||
function CumulativeEnergyImported:set_parent_cluster(cluster) | ||
self._cluster = cluster | ||
return self | ||
end | ||
|
||
function CumulativeEnergyImported:build_test_report_data( | ||
device, | ||
endpoint_id, | ||
value, | ||
status | ||
) | ||
local data = data_types.validate_or_build_type(value, self.base_type) | ||
self:augment_type(data) | ||
return cluster_base.build_test_report_data( | ||
device, | ||
endpoint_id, | ||
self._cluster.ID, | ||
self.ID, | ||
data, | ||
status | ||
) | ||
end | ||
|
||
function CumulativeEnergyImported:deserialize(tlv_buf) | ||
local data = TLVParser.decode_tlv(tlv_buf) | ||
self:augment_type(data) | ||
return data | ||
end | ||
|
||
setmetatable(CumulativeEnergyImported, {__call = CumulativeEnergyImported.new_value, __index = CumulativeEnergyImported.base_type}) | ||
return CumulativeEnergyImported |
67 changes: 67 additions & 0 deletions
67
...atter-energy/src/ElectricalEnergyMeasurement/server/attributes/PeriodicEnergyExported.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
local cluster_base = require "st.matter.cluster_base" | ||
local data_types = require "st.matter.data_types" | ||
local TLVParser = require "st.matter.TLV.TLVParser" | ||
|
||
local PeriodicEnergyExported = { | ||
ID = 0x0004, | ||
NAME = "PeriodicEnergyExported", | ||
base_type = require "ElectricalEnergyMeasurement.types.EnergyMeasurementStruct", | ||
} | ||
|
||
function PeriodicEnergyExported:new_value(...) | ||
local o = self.base_type(table.unpack({...})) | ||
self:augment_type(o) | ||
return o | ||
end | ||
|
||
function PeriodicEnergyExported:read(device, endpoint_id) | ||
return cluster_base.read( | ||
device, | ||
endpoint_id, | ||
self._cluster.ID, | ||
self.ID, | ||
nil | ||
) | ||
end | ||
|
||
function PeriodicEnergyExported:subscribe(device, endpoint_id) | ||
return cluster_base.subscribe( | ||
device, | ||
endpoint_id, | ||
self._cluster.ID, | ||
self.ID, | ||
nil | ||
) | ||
end | ||
|
||
function PeriodicEnergyExported:set_parent_cluster(cluster) | ||
self._cluster = cluster | ||
return self | ||
end | ||
|
||
function PeriodicEnergyExported:build_test_report_data( | ||
device, | ||
endpoint_id, | ||
value, | ||
status | ||
) | ||
local data = data_types.validate_or_build_type(value, self.base_type) | ||
self:augment_type(data) | ||
return cluster_base.build_test_report_data( | ||
device, | ||
endpoint_id, | ||
self._cluster.ID, | ||
self.ID, | ||
data, | ||
status | ||
) | ||
end | ||
|
||
function PeriodicEnergyExported:deserialize(tlv_buf) | ||
local data = TLVParser.decode_tlv(tlv_buf) | ||
self:augment_type(data) | ||
return data | ||
end | ||
|
||
setmetatable(PeriodicEnergyExported, {__call = PeriodicEnergyExported.new_value, __index = PeriodicEnergyExported.base_type}) | ||
return PeriodicEnergyExported |
Oops, something went wrong.