From 24f26f653565bd235fe155b05cf0644499ec24dd Mon Sep 17 00:00:00 2001 From: chrisbeach59 <33329862+chrisbeach59@users.noreply.github.com> Date: Thu, 15 Apr 2021 12:14:25 -0400 Subject: [PATCH] Thermostat cluster added. Support for raise-lower-setpoint command (#6012) * Thermostat cluster added. Support for raise-lower-setpoint command * Restyled by whitespace * Restyled by clang-format Co-authored-by: Restyled.io --- .../all-clusters-common/all-clusters-app.zap | 1015 ++++++++++------- .../gen/call-command-handler.cpp | 5 + .../all-clusters-common/gen/callback-stub.cpp | 8 + .../all-clusters-common/gen/callback.h | 78 ++ .../all-clusters-common/gen/endpoint_config.h | 57 +- .../all-clusters-common/gen/gen_config.h | 6 + examples/chip-tool/chip-tool.zap | 699 ++++++++---- .../chip-tool/commands/clusters/Commands.h | 633 ++++++++++ .../chip-tool/commands/reporting/Commands.h | 5 + src/app/chip-zcl-zpro-codec-api.h | 147 +++ .../clusters/thermostat-client/thermostat.cpp | 43 + .../clusters/thermostat-server/thermostat.cpp | 165 +++ src/app/encoder.cpp | 235 ++++ src/controller/CHIPClusters.cpp | 279 +++++ src/controller/CHIPClusters.h | 50 + src/controller/controller-clusters.zap | 983 +++++++++------- .../python/chip/clusters/CHIPClusters.cpp | 98 ++ .../python/chip/clusters/CHIPClusters.py | 94 ++ 18 files changed, 3557 insertions(+), 1043 deletions(-) create mode 100644 src/app/clusters/thermostat-client/thermostat.cpp create mode 100644 src/app/clusters/thermostat-server/thermostat.cpp diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 2d93651dfa5740..22a885cf38ebc6 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 19, + "featureLevel": 26, "creator": "zap", "keyValuePairs": [ { @@ -98,30 +98,30 @@ ], "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "identify time", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "identify time", - "code": 0, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "2", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -247,30 +247,30 @@ ], "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "name support", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "name support", - "code": 0, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "3", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -419,21 +419,6 @@ } ], "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "scene count", "code": 0, @@ -508,6 +493,21 @@ "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 } ] }, @@ -572,31 +572,31 @@ "commands": [], "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "on/off", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", - "reportable": 0, + "defaultValue": "0x00", + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "on/off", - "code": 0, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, + "defaultValue": "2", + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -704,31 +704,31 @@ "commands": [], "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "current level", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", - "reportable": 0, + "defaultValue": "0x00", + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "current level", - "code": 0, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, + "defaultValue": "3", + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -771,23 +771,23 @@ "commands": [], "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "device list", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "device list", - "code": 0, + "name": "server list", + "code": 1, "mfgCode": null, "side": "server", "included": 1, @@ -801,8 +801,8 @@ "reportableChange": 0 }, { - "name": "server list", - "code": 1, + "name": "client list", + "code": 2, "mfgCode": null, "side": "server", "included": 1, @@ -816,8 +816,8 @@ "reportableChange": 0 }, { - "name": "client list", - "code": 2, + "name": "parts list", + "code": 3, "mfgCode": null, "side": "server", "included": 1, @@ -831,15 +831,15 @@ "reportableChange": 0 }, { - "name": "parts list", - "code": 3, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -858,7 +858,7 @@ { "name": "MfgSpecificPing", "code": 0, - "mfgCode": "4098", + "mfgCode": 4098, "source": "client", "incoming": 1, "outgoing": 0 @@ -916,21 +916,6 @@ } ], "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "InteractionModelVersion", "code": 0, @@ -1095,6 +1080,21 @@ "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 } ] }, @@ -1184,45 +1184,45 @@ ], "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "FabricId", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "o", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "FabricId", - "code": 0, + "name": "Breadcrumb", + "code": 1, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "o", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "Breadcrumb", - "code": 1, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -1657,21 +1657,6 @@ } ], "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "lock state", "code": 0, @@ -2091,6 +2076,21 @@ "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 } ] }, @@ -2147,23 +2147,23 @@ "commands": [], "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "barrier moving state", + "code": 1, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "barrier moving state", - "code": 1, + "name": "barrier safety status", + "code": 2, "mfgCode": null, "side": "server", "included": 1, @@ -2177,8 +2177,8 @@ "reportableChange": 0 }, { - "name": "barrier safety status", - "code": 2, + "name": "barrier capabilities", + "code": 3, "mfgCode": null, "side": "server", "included": 1, @@ -2192,8 +2192,8 @@ "reportableChange": 0 }, { - "name": "barrier capabilities", - "code": 3, + "name": "barrier position", + "code": 10, "mfgCode": null, "side": "server", "included": 1, @@ -2207,15 +2207,15 @@ "reportableChange": 0 }, { - "name": "barrier position", - "code": 10, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -2224,75 +2224,290 @@ ] }, { - "name": "Color Control", - "code": 768, + "name": "Thermostat", + "code": 513, "mfgCode": null, - "define": "COLOR_CONTROL_CLUSTER", + "define": "THERMOSTAT_CLUSTER", "side": "client", "enabled": 0, "commands": [ { - "name": "MoveToHue", + "name": "SetpointRaiseLower", "code": 0, "mfgCode": null, "source": "client", - "incoming": 1, + "incoming": 0, "outgoing": 1 }, { - "name": "MoveHue", + "name": "SetWeeklySchedule", "code": 1, "mfgCode": null, "source": "client", - "incoming": 1, + "incoming": 0, "outgoing": 1 }, { - "name": "StepHue", + "name": "GetWeeklySchedule", "code": 2, "mfgCode": null, "source": "client", - "incoming": 1, + "incoming": 0, "outgoing": 1 }, { - "name": "MoveToSaturation", + "name": "ClearWeeklySchedule", "code": 3, "mfgCode": null, "source": "client", - "incoming": 1, + "incoming": 0, "outgoing": 1 }, { - "name": "MoveSaturation", + "name": "GetRelayStatusLog", "code": 4, "mfgCode": null, "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "StepSaturation", - "code": 5, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "MoveToHueAndSaturation", - "code": 6, - "mfgCode": null, - "source": "client", - "incoming": 1, + "incoming": 0, "outgoing": 1 - }, + } + ], + "attributes": [ { - "name": "MoveToColor", - "code": 7, + "name": "cluster revision", + "code": 65533, "mfgCode": null, - "source": "client", - "incoming": 1, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Thermostat", + "code": 513, + "mfgCode": null, + "define": "THERMOSTAT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "CurrentWeeklySchedule", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RelayStatusLog", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "local temperature", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "pi cooling demand", + "code": 7, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "pi heating demand", + "code": 8, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "occupied cooling setpoint", + "code": 17, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0A28", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "occupied heating setpoint", + "code": 18, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x07D0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "control sequence of operation", + "code": 27, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x04", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "system mode", + "code": 28, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Color Control", + "code": 768, + "mfgCode": null, + "define": "COLOR_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "MoveToHue", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveHue", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StepHue", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveToSaturation", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveSaturation", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StepSaturation", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveToHueAndSaturation", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveToColor", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, "outgoing": 1 }, { @@ -2371,21 +2586,6 @@ "enabled": 1, "commands": [], "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "current hue", "code": 0, @@ -2986,36 +3186,6 @@ "maxInterval": 65344, "reportableChange": 0 }, - { - "name": "couple color temp to level min-mireds", - "code": 16397, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "start up color temperature mireds", - "code": 16400, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "enhanced current hue", "code": 16384, @@ -3135,6 +3305,51 @@ "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + }, + { + "name": "couple color temp to level min-mireds", + "code": 16397, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "start up color temperature mireds", + "code": 16400, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 } ] }, @@ -3173,21 +3388,6 @@ "enabled": 1, "commands": [], "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "measured value", "code": 0, @@ -3247,6 +3447,21 @@ "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 } ] }, @@ -3311,21 +3526,6 @@ } ], "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "zone state", "code": 0, @@ -3400,6 +3600,21 @@ "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 } ] }, @@ -3499,21 +3714,6 @@ "enabled": 1, "commands": [], "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "vendor name", "code": 0, @@ -3618,6 +3818,21 @@ "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 } ] }, @@ -3726,23 +3941,23 @@ "commands": [], "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "groups", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "groups", - "code": 0, + "name": "group keys", + "code": 1, "mfgCode": null, "side": "server", "included": 1, @@ -3756,15 +3971,15 @@ "reportableChange": 0 }, { - "name": "group keys", - "code": 1, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -3842,30 +4057,30 @@ ], "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "identify time", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "identify time", - "code": 0, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "2", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -3991,30 +4206,30 @@ ], "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "name support", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "name support", - "code": 0, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "3", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -4163,21 +4378,6 @@ } ], "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "scene count", "code": 0, @@ -4252,6 +4452,21 @@ "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 } ] }, @@ -4316,31 +4531,31 @@ "commands": [], "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "on/off", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", - "reportable": 0, + "defaultValue": "0x00", + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "on/off", - "code": 0, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, + "defaultValue": "2", + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -4448,31 +4663,31 @@ "commands": [], "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "current level", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", - "reportable": 0, + "defaultValue": "0x00", + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "current level", - "code": 0, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, + "defaultValue": "3", + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -4539,21 +4754,6 @@ } ], "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "InteractionModelVersion", "code": 0, @@ -4718,6 +4918,21 @@ "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 } ] }, @@ -4958,21 +5173,6 @@ } ], "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "lock state", "code": 0, @@ -5392,6 +5592,21 @@ "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 } ] }, @@ -5448,23 +5663,23 @@ "commands": [], "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "barrier moving state", + "code": 1, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "barrier moving state", - "code": 1, + "name": "barrier safety status", + "code": 2, "mfgCode": null, "side": "server", "included": 1, @@ -5478,8 +5693,8 @@ "reportableChange": 0 }, { - "name": "barrier safety status", - "code": 2, + "name": "barrier capabilities", + "code": 3, "mfgCode": null, "side": "server", "included": 1, @@ -5493,8 +5708,8 @@ "reportableChange": 0 }, { - "name": "barrier capabilities", - "code": 3, + "name": "barrier position", + "code": 10, "mfgCode": null, "side": "server", "included": 1, @@ -5508,15 +5723,15 @@ "reportableChange": 0 }, { - "name": "barrier position", - "code": 10, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -5672,21 +5887,6 @@ "enabled": 0, "commands": [], "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "current hue", "code": 0, @@ -6287,36 +6487,6 @@ "maxInterval": 65344, "reportableChange": 0 }, - { - "name": "couple color temp to level min-mireds", - "code": 16397, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "start up color temperature mireds", - "code": 16400, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "enhanced current hue", "code": 16384, @@ -6436,6 +6606,51 @@ "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + }, + { + "name": "couple color temp to level min-mireds", + "code": 16397, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "start up color temperature mireds", + "code": 16400, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 } ] }, @@ -6474,21 +6689,6 @@ "enabled": 0, "commands": [], "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "measured value", "code": 0, @@ -6548,6 +6748,21 @@ "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 } ] }, @@ -6612,21 +6827,6 @@ } ], "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "zone state", "code": 0, @@ -6701,6 +6901,21 @@ "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 } ] } diff --git a/examples/all-clusters-app/all-clusters-common/gen/call-command-handler.cpp b/examples/all-clusters-app/all-clusters-common/gen/call-command-handler.cpp index 24920f10f3c1a3..bbd24100a77b64 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/call-command-handler.cpp +++ b/examples/all-clusters-app/all-clusters-common/gen/call-command-handler.cpp @@ -46,6 +46,7 @@ EmberAfStatus emberAfNetworkCommissioningClusterServerCommandParse(EmberAfCluste EmberAfStatus emberAfOnOffClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfScenesClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfTemperatureMeasurementClusterServerCommandParse(EmberAfClusterCommand * cmd); +EmberAfStatus emberAfThermostatClusterServerCommandParse(EmberAfClusterCommand * cmd); static EmberAfStatus status(bool wasHandled, bool clusterExists, bool mfgSpecific) { @@ -144,6 +145,10 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd) // No commands are enabled for cluster Temperature Measurement result = status(false, true, cmd->mfgSpecific); break; + case ZCL_THERMOSTAT_CLUSTER_ID: + // No commands are enabled for cluster Thermostat + result = status(false, true, cmd->mfgSpecific); + break; default: // Unrecognized cluster ID, error status will apply. break; diff --git a/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp b/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp index 1845be88085c1b..460d90ebd20be1 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp +++ b/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp @@ -83,6 +83,9 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_TEMP_MEASUREMENT_CLUSTER_ID: emberAfTemperatureMeasurementClusterInitCallback(endpoint); break; + case ZCL_THERMOSTAT_CLUSTER_ID: + emberAfThermostatClusterInitCallback(endpoint); + break; default: // Unrecognized cluster ID break; @@ -179,6 +182,11 @@ void __attribute__((weak)) emberAfTemperatureMeasurementClusterInitCallback(Endp // To prevent warning (void) endpoint; } +void __attribute__((weak)) emberAfThermostatClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} // // Non-Cluster Related Callbacks diff --git a/examples/all-clusters-app/all-clusters-common/gen/callback.h b/examples/all-clusters-app/all-clusters-common/gen/callback.h index b8af681d2922cd..743a981dab7c11 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/callback.h +++ b/examples/all-clusters-app/all-clusters-common/gen/callback.h @@ -183,6 +183,14 @@ void emberAfScenesClusterInitCallback(chip::EndpointId endpoint); */ void emberAfTemperatureMeasurementClusterInitCallback(chip::EndpointId endpoint); +/** @brief Thermostat Cluster Init + * + * Cluster Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfThermostatClusterInitCallback(chip::EndpointId endpoint); + // Cluster Server/Client Init Functions // @@ -1447,6 +1455,76 @@ EmberAfStatus emberAfTemperatureMeasurementClusterServerPreAttributeChangedCallb */ void emberAfTemperatureMeasurementClusterServerTickCallback(chip::EndpointId endpoint); +// +// Thermostat Cluster server +// + +/** @brief Thermostat Cluster Server Init + * + * Server Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfThermostatClusterServerInitCallback(chip::EndpointId endpoint); + +/** @brief Thermostat Cluster Server Attribute Changed + * + * Server Attribute Changed + * + * @param endpoint Endpoint that is being initialized + * @param attributeId Attribute that changed + */ +void emberAfThermostatClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); + +/** @brief Thermostat Cluster Server Manufacturer Specific Attribute Changed + * + * Server Manufacturer Specific Attribute Changed + * + * @param endpoint Endpoint that is being initialized + * @param attributeId Attribute that changed + * @param manufacturerCode Manufacturer Code of the attribute that changed + */ +void emberAfThermostatClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + uint16_t manufacturerCode); + +/** @brief Thermostat Cluster Server Message Sent + * + * Server Message Sent + * + * @param type The type of message sent + * @param indexOrDestination The destination or address to which the message was sent + * @param apsFrame The APS frame for the message + * @param msgLen The length of the message + * @param message The message that was sent + * @param status The status of the sent message + */ +void emberAfThermostatClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); + +/** @brief Thermostat Cluster Server Pre Attribute Changed + * + * server Pre Attribute Changed + * + * @param endpoint Endpoint that is being initialized + * @param attributeId Attribute to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +EmberAfStatus emberAfThermostatClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, + EmberAfAttributeType attributeType, uint8_t size, + uint8_t * value); + +/** @brief Thermostat Cluster Server Tick + * + * server Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfThermostatClusterServerTickCallback(chip::EndpointId endpoint); + // Cluster Commands Callback /** diff --git a/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h b/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h index c2dfa1414f0e3c..8e0a79712a85ff 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h +++ b/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h @@ -447,7 +447,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 132 +#define GENERATED_ATTRIBUTE_COUNT 138 #define GENERATED_ATTRIBUTES \ { \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* Identify (server): cluster revision */ \ @@ -468,8 +468,8 @@ { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(0) }, /* Descriptor (server): device list */ \ { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(254) }, /* Descriptor (server): server list */ \ { 0x0002, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(508) }, /* Descriptor (server): client list */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Descriptor (server): cluster revision */ \ { 0x0003, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(762) }, /* Descriptor (server): parts list */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Descriptor (server): cluster revision */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), \ ZAP_SIMPLE_DEFAULT(3) }, /* Basic (server): cluster revision */ \ { 0x0000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), \ @@ -507,6 +507,16 @@ { 0x0002, ZAP_TYPE(BITMAP16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Barrier Control (server): barrier safety status */ \ { 0x0003, ZAP_TYPE(BITMAP8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* Barrier Control (server): barrier capabilities */ \ { 0x000A, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* Barrier Control (server): barrier position */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* Thermostat (server): cluster revision */ \ + { 0x0000, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Thermostat (server): local temperature */ \ + { 0x0011, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_SIMPLE_DEFAULT(0x0A28) }, /* Thermostat (server): occupied cooling setpoint */ \ + { 0x0012, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_SIMPLE_DEFAULT(0x07D0) }, /* Thermostat (server): occupied heating setpoint */ \ + { 0x001B, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_SIMPLE_DEFAULT(0x04) }, /* Thermostat (server): control sequence of operation */ \ + { 0x001C, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_SIMPLE_DEFAULT(0x01) }, /* Thermostat (server): system mode */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* Color Control (server): cluster revision */ \ { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Color Control (server): current hue */ \ { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Color Control (server): current saturation */ \ @@ -665,7 +675,7 @@ }; #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask -#define GENERATED_CLUSTER_COUNT 20 +#define GENERATED_CLUSTER_COUNT 21 #define GENERATED_CLUSTERS \ { \ { 0x0003, \ @@ -722,42 +732,45 @@ { \ 0x0103, ZAP_ATTRIBUTE_INDEX(39), 5, 7, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Barrier Control (server) */ \ + { \ + 0x0201, ZAP_ATTRIBUTE_INDEX(44), 6, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ + }, /* Endpoint: 1, Cluster: Thermostat (server) */ \ { 0x0300, \ - ZAP_ATTRIBUTE_INDEX(44), \ + ZAP_ATTRIBUTE_INDEX(50), \ 51, \ 336, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayColorControlServer }, /* Endpoint: 1, Cluster: Color Control (server) */ \ { \ - 0x0402, ZAP_ATTRIBUTE_INDEX(95), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0402, ZAP_ATTRIBUTE_INDEX(101), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ { 0x0500, \ - ZAP_ATTRIBUTE_INDEX(99), \ + ZAP_ATTRIBUTE_INDEX(105), \ 6, \ 16, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION) | \ ZAP_CLUSTER_MASK(MESSAGE_SENT_FUNCTION), \ chipFuncArrayIasZoneServer }, /* Endpoint: 1, Cluster: IAS Zone (server) */ \ { \ - 0x0508, ZAP_ATTRIBUTE_INDEX(105), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0508, ZAP_ATTRIBUTE_INDEX(111), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Low Power (server) */ \ { \ - 0x050D, ZAP_ATTRIBUTE_INDEX(106), 8, 105, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050D, ZAP_ATTRIBUTE_INDEX(112), 8, 105, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Application Basic (server) */ \ { \ - 0xF000, ZAP_ATTRIBUTE_INDEX(114), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0xF000, ZAP_ATTRIBUTE_INDEX(120), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Binding (server) */ \ { \ - 0xF004, ZAP_ATTRIBUTE_INDEX(115), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0xF004, ZAP_ATTRIBUTE_INDEX(121), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Group Key Management (server) */ \ { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(118), \ + ZAP_ATTRIBUTE_INDEX(124), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 2, Cluster: On/off (server) */ \ { 0x0028, \ - ZAP_ATTRIBUTE_INDEX(120), \ + ZAP_ATTRIBUTE_INDEX(126), \ 12, \ 254, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -769,7 +782,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 18, 2304 }, { ZAP_CLUSTER_INDEX(18), 2, 257 }, \ + { ZAP_CLUSTER_INDEX(0), 19, 2314 }, { ZAP_CLUSTER_INDEX(19), 2, 257 }, \ } // Largest attribute size is needed for various buffers @@ -779,7 +792,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (508) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (2561) +#define ATTRIBUTE_MAX_SIZE (2571) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (2) @@ -823,7 +836,7 @@ // Array of EmberAfCommandMetadata structs. #define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask -#define EMBER_AF_GENERATED_COMMAND_COUNT (117) +#define EMBER_AF_GENERATED_COMMAND_COUNT (124) #define GENERATED_COMMANDS \ { \ { 0x0003, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Identify (server): Identify */ \ @@ -955,6 +968,13 @@ ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* Door Lock (server): ClearAllRfids */ \ { 0x0103, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Barrier Control (server): BarrierControlGoToPercent */ \ { 0x0103, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Barrier Control (server): BarrierControlStop */ \ + { 0x0201, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Thermostat (server): CurrentWeeklySchedule */ \ + { 0x0201, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Thermostat (server): SetpointRaiseLower */ \ + { 0x0201, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Thermostat (server): RelayStatusLog */ \ + { 0x0201, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Thermostat (server): SetWeeklySchedule */ \ + { 0x0201, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Thermostat (server): GetWeeklySchedule */ \ + { 0x0201, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Thermostat (server): ClearWeeklySchedule */ \ + { 0x0201, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Thermostat (server): GetRelayStatusLog */ \ { 0x0300, 0x00, \ ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* Color Control (server): MoveToHue */ \ { 0x0300, 0x01, \ @@ -1025,10 +1045,10 @@ #define ZAP_REPORT_DIRECTION(x) ZRD(x) // User options for plugin Reporting -#define EMBER_AF_PLUGIN_REPORTING_TABLE_SIZE (10) +#define EMBER_AF_PLUGIN_REPORTING_TABLE_SIZE (11) #define EMBER_AF_PLUGIN_REPORTING_ENABLE_GROUP_BOUND_REPORTS -#define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS_TABLE_SIZE (10) +#define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS_TABLE_SIZE (11) #define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS \ { \ { \ @@ -1040,6 +1060,9 @@ { \ ZAP_REPORT_DIRECTION(REPORTED), 0x0001, 0x0101, 0x0000, ZAP_CLUSTER_MASK(SERVER), 0x0000, { { 0, 65344, 0 } } \ }, /* Reporting for cluster: "Door Lock", attribute: "lock state". side: server */ \ + { \ + ZAP_REPORT_DIRECTION(REPORTED), 0x0001, 0x0201, 0x0000, ZAP_CLUSTER_MASK(SERVER), 0x0000, { { 0, 65344, 0 } } \ + }, /* Reporting for cluster: "Thermostat", attribute: "local temperature". side: server */ \ { \ ZAP_REPORT_DIRECTION(REPORTED), 0x0001, 0x0300, 0x0000, ZAP_CLUSTER_MASK(SERVER), 0x0000, { { 0, 65344, 0 } } \ }, /* Reporting for cluster: "Color Control", attribute: "current hue". side: server */ \ diff --git a/examples/all-clusters-app/all-clusters-common/gen/gen_config.h b/examples/all-clusters-app/all-clusters-common/gen/gen_config.h index bcc56fb2c568fe..ff8386f5ab6043 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/gen_config.h +++ b/examples/all-clusters-app/all-clusters-common/gen/gen_config.h @@ -47,6 +47,7 @@ #define EMBER_AF_ON_OFF_CLUSTER_SERVER_ENDPOINT_COUNT (2) #define EMBER_AF_SCENES_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_TEMP_MEASUREMENT_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_THERMOSTAT_CLUSTER_SERVER_ENDPOINT_COUNT (1) /**** Cluster Plugins ****/ @@ -151,3 +152,8 @@ #define ZCL_USING_TEMP_MEASUREMENT_CLUSTER_SERVER #define EMBER_AF_PLUGIN_TEMPERATURE_MEASUREMENT_SERVER #define EMBER_AF_PLUGIN_TEMPERATURE_MEASUREMENT + +// Use this macro to check if the server side of the Thermostat cluster is included +#define ZCL_USING_THERMOSTAT_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_THERMOSTAT_SERVER +#define EMBER_AF_PLUGIN_THERMOSTAT diff --git a/examples/chip-tool/chip-tool.zap b/examples/chip-tool/chip-tool.zap index 845eaf7071a9e8..3cb9d43e0ccd4f 100644 --- a/examples/chip-tool/chip-tool.zap +++ b/examples/chip-tool/chip-tool.zap @@ -1,5 +1,5 @@ { - "featureLevel": 19, + "featureLevel": 26, "creator": "zap", "keyValuePairs": [ { @@ -18,13 +18,13 @@ "package": [ { "pathRelativity": "relativeToZap", - "path": "../../../connectedhomeip-1/src/app/zap-templates/zcl/zcl.json", + "path": "../../src/app/zap-templates/zcl/zcl.json", "version": "ZCL Test Data", "type": "zcl-properties" }, { "pathRelativity": "relativeToZap", - "path": "../../../connectedhomeip-1/src/app/zap-templates/app-templates.json", + "path": "../../src/app/zap-templates/app-templates.json", "version": "chip-v1", "type": "gen-templates-json" } @@ -88,30 +88,30 @@ "enabled": 0, "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "identify time", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "identify time", - "code": 0, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "2", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -247,30 +247,30 @@ ], "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "name support", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "name support", - "code": 0, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "3", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -419,21 +419,6 @@ } ], "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "scene count", "code": 0, @@ -508,6 +493,21 @@ "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 } ] }, @@ -572,31 +572,31 @@ "commands": [], "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "on/off", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", - "reportable": 0, + "defaultValue": "0x00", + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "on/off", - "code": 0, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, + "defaultValue": "2", + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -704,31 +704,31 @@ "commands": [], "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "current level", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", - "reportable": 0, + "defaultValue": "0x00", + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "current level", - "code": 0, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, + "defaultValue": "3", + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -771,23 +771,23 @@ "commands": [], "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "device list", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "device list", - "code": 0, + "name": "server list", + "code": 1, "mfgCode": null, "side": "server", "included": 1, @@ -801,8 +801,8 @@ "reportableChange": 0 }, { - "name": "server list", - "code": 1, + "name": "client list", + "code": 2, "mfgCode": null, "side": "server", "included": 1, @@ -816,8 +816,8 @@ "reportableChange": 0 }, { - "name": "client list", - "code": 2, + "name": "parts list", + "code": 3, "mfgCode": null, "side": "server", "included": 1, @@ -831,15 +831,15 @@ "reportableChange": 0 }, { - "name": "parts list", - "code": 3, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -858,7 +858,7 @@ { "name": "MfgSpecificPing", "code": 0, - "mfgCode": "4098", + "mfgCode": 4098, "source": "client", "incoming": 0, "outgoing": 1 @@ -916,21 +916,6 @@ } ], "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "InteractionModelVersion", "code": 0, @@ -1095,6 +1080,21 @@ "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 } ] }, @@ -1184,45 +1184,45 @@ ], "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "FabricId", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "o", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "FabricId", - "code": 0, + "name": "Breadcrumb", + "code": 1, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "o", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "Breadcrumb", - "code": 1, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -1841,21 +1841,6 @@ } ], "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "lock state", "code": 0, @@ -2275,6 +2260,21 @@ "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 } ] }, @@ -2331,23 +2331,23 @@ "commands": [], "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "barrier moving state", + "code": 1, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "barrier moving state", - "code": 1, + "name": "barrier safety status", + "code": 2, "mfgCode": null, "side": "server", "included": 1, @@ -2361,8 +2361,8 @@ "reportableChange": 0 }, { - "name": "barrier safety status", - "code": 2, + "name": "barrier capabilities", + "code": 3, "mfgCode": null, "side": "server", "included": 1, @@ -2376,8 +2376,8 @@ "reportableChange": 0 }, { - "name": "barrier capabilities", - "code": 3, + "name": "barrier position", + "code": 10, "mfgCode": null, "side": "server", "included": 1, @@ -2391,15 +2391,15 @@ "reportableChange": 0 }, { - "name": "barrier position", - "code": 10, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -2408,75 +2408,290 @@ ] }, { - "name": "Color Control", - "code": 768, + "name": "Thermostat", + "code": 513, "mfgCode": null, - "define": "COLOR_CONTROL_CLUSTER", + "define": "THERMOSTAT_CLUSTER", "side": "client", "enabled": 1, "commands": [ { - "name": "MoveToHue", + "name": "SetpointRaiseLower", "code": 0, "mfgCode": null, "source": "client", - "incoming": 1, + "incoming": 0, "outgoing": 1 }, { - "name": "MoveHue", + "name": "SetWeeklySchedule", "code": 1, "mfgCode": null, "source": "client", - "incoming": 1, + "incoming": 0, "outgoing": 1 }, { - "name": "StepHue", + "name": "GetWeeklySchedule", "code": 2, "mfgCode": null, "source": "client", - "incoming": 1, + "incoming": 0, "outgoing": 1 }, { - "name": "MoveToSaturation", + "name": "ClearWeeklySchedule", "code": 3, "mfgCode": null, "source": "client", - "incoming": 1, + "incoming": 0, "outgoing": 1 }, { - "name": "MoveSaturation", + "name": "GetRelayStatusLog", "code": 4, "mfgCode": null, "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "StepSaturation", - "code": 5, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "MoveToHueAndSaturation", - "code": 6, - "mfgCode": null, - "source": "client", - "incoming": 1, + "incoming": 0, "outgoing": 1 - }, + } + ], + "attributes": [ { - "name": "MoveToColor", - "code": 7, + "name": "cluster revision", + "code": 65533, "mfgCode": null, - "source": "client", - "incoming": 1, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Thermostat", + "code": 513, + "mfgCode": null, + "define": "THERMOSTAT_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "CurrentWeeklySchedule", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RelayStatusLog", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "local temperature", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "pi cooling demand", + "code": 7, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "pi heating demand", + "code": 8, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "occupied cooling setpoint", + "code": 17, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0A28", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "occupied heating setpoint", + "code": 18, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x07D0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "control sequence of operation", + "code": 27, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x04", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "system mode", + "code": 28, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Color Control", + "code": 768, + "mfgCode": null, + "define": "COLOR_CONTROL_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [ + { + "name": "MoveToHue", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveHue", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StepHue", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveToSaturation", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveSaturation", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StepSaturation", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveToHueAndSaturation", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveToColor", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, "outgoing": 1 }, { @@ -2555,21 +2770,6 @@ "enabled": 0, "commands": [], "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "current hue", "code": 0, @@ -3170,36 +3370,6 @@ "maxInterval": 65344, "reportableChange": 0 }, - { - "name": "couple color temp to level min-mireds", - "code": 16397, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "start up color temperature mireds", - "code": 16400, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "enhanced current hue", "code": 16384, @@ -3319,6 +3489,51 @@ "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + }, + { + "name": "couple color temp to level min-mireds", + "code": 16397, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "start up color temperature mireds", + "code": 16400, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 } ] }, @@ -3357,21 +3572,6 @@ "enabled": 0, "commands": [], "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "measured value", "code": 0, @@ -3431,6 +3631,21 @@ "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 } ] }, @@ -3495,21 +3710,6 @@ } ], "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "zone state", "code": 0, @@ -3584,6 +3784,21 @@ "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 } ] }, @@ -3683,21 +3898,6 @@ "enabled": 0, "commands": [], "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "vendor name", "code": 0, @@ -3802,6 +4002,21 @@ "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 } ] }, @@ -3910,23 +4125,23 @@ "commands": [], "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "groups", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "groups", - "code": 0, + "name": "group keys", + "code": 1, "mfgCode": null, "side": "server", "included": 1, @@ -3940,15 +4155,15 @@ "reportableChange": 0 }, { - "name": "group keys", - "code": 1, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/chip-tool/commands/clusters/Commands.h b/examples/chip-tool/commands/clusters/Commands.h index ccd1427e1c76cd..def63f93a68936 100644 --- a/examples/chip-tool/commands/clusters/Commands.h +++ b/examples/chip-tool/commands/clusters/Commands.h @@ -582,6 +582,7 @@ static void OnGroupKeyManagementGroupKeysListAttributeResponse(void * context, u | OnOff | 0x0006 | | Scenes | 0x0005 | | TemperatureMeasurement | 0x0402 | +| Thermostat | 0x0201 | \*----------------------------------------------------------------------------*/ constexpr chip::ClusterId kApplicationBasicClusterId = 0x050D; @@ -601,6 +602,7 @@ constexpr chip::ClusterId kNetworkCommissioningClusterId = 0x0031; constexpr chip::ClusterId kOnOffClusterId = 0x0006; constexpr chip::ClusterId kScenesClusterId = 0x0005; constexpr chip::ClusterId kTemperatureMeasurementClusterId = 0x0402; +constexpr chip::ClusterId kThermostatClusterId = 0x0201; /*----------------------------------------------------------------------------*\ | Cluster ApplicationBasic | 0x050D | @@ -9275,6 +9277,610 @@ class ReadTemperatureMeasurementClusterRevision : public ModelCommand new chip::Callback::Callback(OnDefaultFailureResponse, this); }; +/*----------------------------------------------------------------------------*\ +| Cluster Thermostat | 0x0201 | +|------------------------------------------------------------------------------| +| Commands: | | +| * ClearWeeklySchedule | 0x03 | +| * GetRelayStatusLog | 0x04 | +| * GetWeeklySchedule | 0x02 | +| * SetWeeklySchedule | 0x01 | +| * SetpointRaiseLower | 0x00 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * LocalTemperature | 0x0000 | +| * OccupiedCoolingSetpoint | 0x0011 | +| * OccupiedHeatingSetpoint | 0x0012 | +| * ControlSequenceOfOperation | 0x001B | +| * SystemMode | 0x001C | +| * ClusterRevision | 0xFFFD | +\*----------------------------------------------------------------------------*/ + +/* + * Command ClearWeeklySchedule + */ +class ThermostatClearWeeklySchedule : public ModelCommand +{ +public: + ThermostatClearWeeklySchedule() : ModelCommand("clear-weekly-schedule") { ModelCommand::AddArguments(); } + ~ThermostatClearWeeklySchedule() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x03) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ClearWeeklySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +/* + * Command GetRelayStatusLog + */ +class ThermostatGetRelayStatusLog : public ModelCommand +{ +public: + ThermostatGetRelayStatusLog() : ModelCommand("get-relay-status-log") { ModelCommand::AddArguments(); } + ~ThermostatGetRelayStatusLog() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x04) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + return cluster.GetRelayStatusLog(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +/* + * Command GetWeeklySchedule + */ +class ThermostatGetWeeklySchedule : public ModelCommand +{ +public: + ThermostatGetWeeklySchedule() : ModelCommand("get-weekly-schedule") + { + AddArgument("daysToReturn", 0, UINT8_MAX, &mDaysToReturn); + AddArgument("modeToReturn", 0, UINT8_MAX, &mModeToReturn); + ModelCommand::AddArguments(); + } + ~ThermostatGetWeeklySchedule() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x02) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + return cluster.GetWeeklySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mDaysToReturn, mModeToReturn); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + uint8_t mDaysToReturn; + uint8_t mModeToReturn; +}; + +/* + * Command SetWeeklySchedule + */ +class ThermostatSetWeeklySchedule : public ModelCommand +{ +public: + ThermostatSetWeeklySchedule() : ModelCommand("set-weekly-schedule") + { + AddArgument("numberOfTransitionsForSequence", 0, UINT8_MAX, &mNumberOfTransitionsForSequence); + AddArgument("dayOfWeekForSequence", 0, UINT8_MAX, &mDayOfWeekForSequence); + AddArgument("modeForSequence", 0, UINT8_MAX, &mModeForSequence); + AddArgument("payload", 0, UINT8_MAX, &mPayload); + ModelCommand::AddArguments(); + } + ~ThermostatSetWeeklySchedule() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x01) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + return cluster.SetWeeklySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mNumberOfTransitionsForSequence, + mDayOfWeekForSequence, mModeForSequence, mPayload); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + uint8_t mNumberOfTransitionsForSequence; + uint8_t mDayOfWeekForSequence; + uint8_t mModeForSequence; + uint8_t mPayload; +}; + +/* + * Command SetpointRaiseLower + */ +class ThermostatSetpointRaiseLower : public ModelCommand +{ +public: + ThermostatSetpointRaiseLower() : ModelCommand("setpoint-raise-lower") + { + AddArgument("mode", 0, UINT8_MAX, &mMode); + AddArgument("amount", INT8_MIN, INT8_MAX, &mAmount); + ModelCommand::AddArguments(); + } + ~ThermostatSetpointRaiseLower() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + return cluster.SetpointRaiseLower(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMode, mAmount); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + uint8_t mMode; + int8_t mAmount; +}; + +/* + * Discover Attributes + */ +class DiscoverThermostatAttributes : public ModelCommand +{ +public: + DiscoverThermostatAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); } + + ~DiscoverThermostatAttributes() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +/* + * Attribute LocalTemperature + */ +class ReadThermostatLocalTemperature : public ModelCommand +{ +public: + ReadThermostatLocalTemperature() : ModelCommand("read") + { + AddArgument("attr-name", "local-temperature"); + ModelCommand::AddArguments(); + } + + ~ReadThermostatLocalTemperature() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeLocalTemperature(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt16sAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class ReportThermostatLocalTemperature : public ModelCommand +{ +public: + ReportThermostatLocalTemperature() : ModelCommand("report") + { + AddArgument("attr-name", "local-temperature"); + AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); + AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); + AddArgument("change", INT16_MIN, INT16_MAX, &mChange); + ModelCommand::AddArguments(); + } + + ~ReportThermostatLocalTemperature() + { + delete onSuccessCallback; + delete onFailureCallback; + delete onReportCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x06) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + + CHIP_ERROR err = cluster.ReportAttributeLocalTemperature(onReportCallback->Cancel()); + if (err != CHIP_NO_ERROR) + { + return err; + } + + return cluster.ConfigureAttributeLocalTemperature(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval, + mMaxInterval, mChange); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + chip::Callback::Callback * onReportCallback = + new chip::Callback::Callback(OnInt16sAttributeResponse, this); + uint16_t mMinInterval; + uint16_t mMaxInterval; + int16_t mChange; +}; + +/* + * Attribute OccupiedCoolingSetpoint + */ +class ReadThermostatOccupiedCoolingSetpoint : public ModelCommand +{ +public: + ReadThermostatOccupiedCoolingSetpoint() : ModelCommand("read") + { + AddArgument("attr-name", "occupied-cooling-setpoint"); + ModelCommand::AddArguments(); + } + + ~ReadThermostatOccupiedCoolingSetpoint() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeOccupiedCoolingSetpoint(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt16sAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteThermostatOccupiedCoolingSetpoint : public ModelCommand +{ +public: + WriteThermostatOccupiedCoolingSetpoint() : ModelCommand("write") + { + AddArgument("attr-name", "occupied-cooling-setpoint"); + AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteThermostatOccupiedCoolingSetpoint() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x01) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeOccupiedCoolingSetpoint(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + int16_t mValue; +}; + +/* + * Attribute OccupiedHeatingSetpoint + */ +class ReadThermostatOccupiedHeatingSetpoint : public ModelCommand +{ +public: + ReadThermostatOccupiedHeatingSetpoint() : ModelCommand("read") + { + AddArgument("attr-name", "occupied-heating-setpoint"); + ModelCommand::AddArguments(); + } + + ~ReadThermostatOccupiedHeatingSetpoint() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeOccupiedHeatingSetpoint(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt16sAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteThermostatOccupiedHeatingSetpoint : public ModelCommand +{ +public: + WriteThermostatOccupiedHeatingSetpoint() : ModelCommand("write") + { + AddArgument("attr-name", "occupied-heating-setpoint"); + AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteThermostatOccupiedHeatingSetpoint() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x01) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeOccupiedHeatingSetpoint(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + int16_t mValue; +}; + +/* + * Attribute ControlSequenceOfOperation + */ +class ReadThermostatControlSequenceOfOperation : public ModelCommand +{ +public: + ReadThermostatControlSequenceOfOperation() : ModelCommand("read") + { + AddArgument("attr-name", "control-sequence-of-operation"); + ModelCommand::AddArguments(); + } + + ~ReadThermostatControlSequenceOfOperation() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeControlSequenceOfOperation(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt8uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteThermostatControlSequenceOfOperation : public ModelCommand +{ +public: + WriteThermostatControlSequenceOfOperation() : ModelCommand("write") + { + AddArgument("attr-name", "control-sequence-of-operation"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteThermostatControlSequenceOfOperation() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x01) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeControlSequenceOfOperation(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + uint8_t mValue; +}; + +/* + * Attribute SystemMode + */ +class ReadThermostatSystemMode : public ModelCommand +{ +public: + ReadThermostatSystemMode() : ModelCommand("read") + { + AddArgument("attr-name", "system-mode"); + ModelCommand::AddArguments(); + } + + ~ReadThermostatSystemMode() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeSystemMode(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt8uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteThermostatSystemMode : public ModelCommand +{ +public: + WriteThermostatSystemMode() : ModelCommand("write") + { + AddArgument("attr-name", "system-mode"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteThermostatSystemMode() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x01) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeSystemMode(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + uint8_t mValue; +}; + +/* + * Attribute ClusterRevision + */ +class ReadThermostatClusterRevision : public ModelCommand +{ +public: + ReadThermostatClusterRevision() : ModelCommand("read") + { + AddArgument("attr-name", "cluster-revision"); + ModelCommand::AddArguments(); + } + + ~ReadThermostatClusterRevision() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt16uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + /*----------------------------------------------------------------------------*\ | Register all Clusters commands | \*----------------------------------------------------------------------------*/ @@ -9637,6 +10243,32 @@ void registerClusterTemperatureMeasurement(Commands & commands) commands.Register(clusterName, clusterCommands); } +void registerClusterThermostat(Commands & commands) +{ + const char * clusterName = "Thermostat"; + + commands_list clusterCommands = { + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + }; + + commands.Register(clusterName, clusterCommands); +} void registerClusters(Commands & commands) { @@ -9657,4 +10289,5 @@ void registerClusters(Commands & commands) registerClusterOnOff(commands); registerClusterScenes(commands); registerClusterTemperatureMeasurement(commands); + registerClusterThermostat(commands); } diff --git a/examples/chip-tool/commands/reporting/Commands.h b/examples/chip-tool/commands/reporting/Commands.h index d07348ee499386..e86fcc4053ce7c 100644 --- a/examples/chip-tool/commands/reporting/Commands.h +++ b/examples/chip-tool/commands/reporting/Commands.h @@ -39,6 +39,7 @@ class Listen : public ReportingCommand delete onReportLevelControlCurrentLevelCallback; delete onReportOnOffOnOffCallback; delete onReportTemperatureMeasurementMeasuredValueCallback; + delete onReportThermostatLocalTemperatureCallback; } void AddReportCallbacks(uint8_t endpointId) override @@ -61,6 +62,8 @@ class Listen : public ReportingCommand callbacksMgr.AddReportCallback(chip::kTestDeviceNodeId, endpointId, 0x0006, 0x0000, onReportOnOffOnOffCallback->Cancel()); callbacksMgr.AddReportCallback(chip::kTestDeviceNodeId, endpointId, 0x0402, 0x0000, onReportTemperatureMeasurementMeasuredValueCallback->Cancel()); + callbacksMgr.AddReportCallback(chip::kTestDeviceNodeId, endpointId, 0x0201, 0x0000, + onReportThermostatLocalTemperatureCallback->Cancel()); } static void OnDefaultSuccessResponse(void * context) { ChipLogProgress(chipTool, "Default Success Response"); } @@ -114,6 +117,8 @@ class Listen : public ReportingCommand new chip::Callback::Callback(OnBooleanAttributeResponse, this); chip::Callback::Callback * onReportTemperatureMeasurementMeasuredValueCallback = new chip::Callback::Callback(OnInt16sAttributeResponse, this); + chip::Callback::Callback * onReportThermostatLocalTemperatureCallback = + new chip::Callback::Callback(OnInt16sAttributeResponse, this); }; void registerCommandsReporting(Commands & commands) diff --git a/src/app/chip-zcl-zpro-codec-api.h b/src/app/chip-zcl-zpro-codec-api.h index 7e49b7d56cb668..e2aede2e562a47 100644 --- a/src/app/chip-zcl-zpro-codec-api.h +++ b/src/app/chip-zcl-zpro-codec-api.h @@ -46,6 +46,7 @@ | OnOff | 0x0006 | | Scenes | 0x0005 | | TemperatureMeasurement | 0x0402 | +| Thermostat | 0x0201 | | WindowCovering | 0x0102 | \*----------------------------------------------------------------------------*/ @@ -2146,6 +2147,152 @@ encodeTemperatureMeasurementClusterReadMaxMeasuredValueAttribute(uint8_t seqNum, chip::System::PacketBufferHandle encodeTemperatureMeasurementClusterReadClusterRevisionAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint); +/*----------------------------------------------------------------------------*\ +| Cluster Thermostat | 0x0201 | +|------------------------------------------------------------------------------| +| Commands: | | +| * ClearWeeklySchedule | 0x03 | +| * GetRelayStatusLog | 0x04 | +| * GetWeeklySchedule | 0x02 | +| * SetWeeklySchedule | 0x01 | +| * SetpointRaiseLower | 0x00 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * LocalTemperature | 0x0000 | +| * OccupiedCoolingSetpoint | 0x0011 | +| * OccupiedHeatingSetpoint | 0x0012 | +| * ControlSequenceOfOperation | 0x001B | +| * SystemMode | 0x001C | +| * ClusterRevision | 0xFFFD | +\*----------------------------------------------------------------------------*/ + +/** + * @brief + * Encode an ClearWeeklySchedule command for Thermostat server into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeThermostatClusterClearWeeklyScheduleCommand(uint8_t seqNum, + chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode an GetRelayStatusLog command for Thermostat server into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeThermostatClusterGetRelayStatusLogCommand(uint8_t seqNum, + chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode an GetWeeklySchedule command for Thermostat server into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeThermostatClusterGetWeeklyScheduleCommand(uint8_t seqNum, + chip::EndpointId destinationEndpoint, + uint8_t daysToReturn, uint8_t modeToReturn); + +/** + * @brief + * Encode an SetWeeklySchedule command for Thermostat server into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeThermostatClusterSetWeeklyScheduleCommand(uint8_t seqNum, + chip::EndpointId destinationEndpoint, + uint8_t numberOfTransitionsForSequence, + uint8_t dayOfWeekForSequence, + uint8_t modeForSequence, uint8_t payload); + +/** + * @brief + * Encode an SetpointRaiseLower command for Thermostat server into buffer including the APS frame + */ +chip::System::PacketBufferHandle +encodeThermostatClusterSetpointRaiseLowerCommand(uint8_t seqNum, chip::EndpointId destinationEndpoint, uint8_t mode, int8_t amount); + +/** + * @brief + * Encode a Thermostat server discover command into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeThermostatClusterDiscoverAttributes(uint8_t seqNum, chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Thermostat server read command for the local temperature attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeThermostatClusterReadLocalTemperatureAttribute(uint8_t seqNum, + chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Thermostat server configure report command for the local temperature attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeThermostatClusterConfigureLocalTemperatureAttribute(uint8_t seqNum, + chip::EndpointId destinationEndpoint, + uint16_t minInterval, + uint16_t maxInterval, int16_t change); + +/** + * @brief + * Encode a Thermostat server read command for the occupied cooling setpoint attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeThermostatClusterReadOccupiedCoolingSetpointAttribute(uint8_t seqNum, + chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Thermostat server write command for the occupied cooling setpoint attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeThermostatClusterWriteOccupiedCoolingSetpointAttribute(uint8_t seqNum, + chip::EndpointId destinationEndpoint, + int16_t occupiedCoolingSetpoint); + +/** + * @brief + * Encode a Thermostat server read command for the occupied heating setpoint attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeThermostatClusterReadOccupiedHeatingSetpointAttribute(uint8_t seqNum, + chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Thermostat server write command for the occupied heating setpoint attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeThermostatClusterWriteOccupiedHeatingSetpointAttribute(uint8_t seqNum, + chip::EndpointId destinationEndpoint, + int16_t occupiedHeatingSetpoint); + +/** + * @brief + * Encode a Thermostat server read command for the control sequence of operation attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle +encodeThermostatClusterReadControlSequenceOfOperationAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Thermostat server write command for the control sequence of operation attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle +encodeThermostatClusterWriteControlSequenceOfOperationAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint, + uint8_t controlSequenceOfOperation); + +/** + * @brief + * Encode a Thermostat server read command for the system mode attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeThermostatClusterReadSystemModeAttribute(uint8_t seqNum, + chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Thermostat server write command for the system mode attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle +encodeThermostatClusterWriteSystemModeAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint, uint8_t systemMode); + +/** + * @brief + * Encode a Thermostat server read command for the cluster revision attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeThermostatClusterReadClusterRevisionAttribute(uint8_t seqNum, + chip::EndpointId destinationEndpoint); + /*----------------------------------------------------------------------------*\ | Cluster WindowCovering | 0x0102 | |------------------------------------------------------------------------------| diff --git a/src/app/clusters/thermostat-client/thermostat.cpp b/src/app/clusters/thermostat-client/thermostat.cpp new file mode 100644 index 00000000000000..95d553f2d2afd2 --- /dev/null +++ b/src/app/clusters/thermostat-client/thermostat.cpp @@ -0,0 +1,43 @@ +/** + * + * Copyright (c) 2020 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include +#include + +#include "gen/attribute-id.h" +#include "gen/attribute-type.h" +#include "gen/cluster-id.h" + +using namespace chip; + +void emberAfThermostatClusterClientInitCallback(void) +{ + // TODO +} +bool emberAfThermostatClusterCurrentWeeklyScheduleCallback(uint8_t, uint8_t, uint8_t, uint8_t *) +{ + // TODO + return false; +} + +bool emberAfThermostatClusterRelayStatusLogCallback(uint16_t, uint16_t, int16_t, uint8_t, int16_t, uint16_t) +{ + // TODO + return false; +} diff --git a/src/app/clusters/thermostat-server/thermostat.cpp b/src/app/clusters/thermostat-server/thermostat.cpp new file mode 100644 index 00000000000000..daf1c146214921 --- /dev/null +++ b/src/app/clusters/thermostat-server/thermostat.cpp @@ -0,0 +1,165 @@ +/** + * + * Copyright (c) 2020 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include +#include + +#include "gen/attribute-id.h" +#include "gen/attribute-type.h" +#include "gen/cluster-id.h" +#include "gen/enums.h" + +using namespace chip; + +void emberAfThermostatClusterServerInitCallback(void) +{ + // TODO + // Get from the "real thermostat" + // current mode + // current occupied heating setpoint + // current unoccupied heating setpoint + // current occupied cooling setpoint + // current unoccupied cooling setpoint + // and update the zcl cluster values + // This should be a callback defined function + // with weak binding so that real thermostat + // can get the values. + // or should this just be the responsibility of the thermostat application? +} + +bool emberAfThermostatClusterClearWeeklyScheduleCallback() +{ + // TODO + return false; +} +bool emberAfThermostatClusterGetRelayStatusLogCallback() +{ + // TODO + return false; +} + +bool emberAfThermostatClusterGetWeeklyScheduleCallback(uint8_t daysToReturn, uint8_t modeToReturn) +{ + // TODO + return false; +} + +bool emberAfThermostatClusterSetWeeklyScheduleCallback(uint8_t numberOfTransitionsForSequence, uint8_t daysOfWeekForSequence, + uint8_t modeForSequence, uint8_t * payload) +{ + // TODO + return false; +} + +bool emberAfThermostatClusterSetpointRaiseLowerCallback(uint8_t mode, int8_t amount) +{ + bool result = false; + EndpointId endpoint = 1; // Hard code to 1 for now/ + int32_t HeatingSetpoint = 2000, CoolingSetpoint = 2600; // Set to defaults to be safe + EmberAfStatus status; + switch (mode) + { + case EMBER_ZCL_SETPOINT_ADJUST_MODE_HEAT_AND_COOL_SETPOINTS: { + // In auto mode we will need to change both the heating and cooling setpoints + status = emberAfReadAttribute(endpoint, ZCL_THERMOSTAT_CLUSTER_ID, ZCL_OCCUPIED_COOLING_SETPOINT_ATTRIBUTE_ID, + CLUSTER_MASK_SERVER, (uint8_t *) &CoolingSetpoint, sizeof(CoolingSetpoint), NULL); + if (status == EMBER_ZCL_STATUS_SUCCESS) + { + status = emberAfReadAttribute(endpoint, ZCL_THERMOSTAT_CLUSTER_ID, ZCL_OCCUPIED_HEATING_SETPOINT_ATTRIBUTE_ID, + CLUSTER_MASK_SERVER, (uint8_t *) &HeatingSetpoint, sizeof(HeatingSetpoint), NULL); + if (status == EMBER_ZCL_STATUS_SUCCESS) + { + HeatingSetpoint += (amount * 10); + CoolingSetpoint += (amount * 10); + // TODO should check against maximum/minimum and absolute max and min values + status = emberAfWriteAttribute(endpoint, ZCL_THERMOSTAT_CLUSTER_ID, ZCL_OCCUPIED_HEATING_SETPOINT_ATTRIBUTE_ID, + CLUSTER_MASK_SERVER, (uint8_t *) &HeatingSetpoint, ZCL_INT16U_ATTRIBUTE_TYPE); + if (status == EMBER_ZCL_STATUS_SUCCESS) + { + status = emberAfWriteAttribute(endpoint, ZCL_THERMOSTAT_CLUSTER_ID, ZCL_OCCUPIED_COOLING_SETPOINT_ATTRIBUTE_ID, + CLUSTER_MASK_SERVER, (uint8_t *) &CoolingSetpoint, ZCL_INT16U_ATTRIBUTE_TYPE); + if (status == EMBER_ZCL_STATUS_SUCCESS) + { + result = true; + } + else + { + // Todo roll back the setpoints + } + } + else + { + // Todo roll back the setpoints + } + } + } + break; + } + + case EMBER_ZCL_SETPOINT_ADJUST_MODE_COOL_SETPOINT: { + // In cooling mode we will need to change only the cooling setpoint + status = emberAfReadAttribute(endpoint, ZCL_THERMOSTAT_CLUSTER_ID, ZCL_OCCUPIED_COOLING_SETPOINT_ATTRIBUTE_ID, + CLUSTER_MASK_SERVER, (uint8_t *) &CoolingSetpoint, sizeof(CoolingSetpoint), NULL); + if (status == EMBER_ZCL_STATUS_SUCCESS) + { + CoolingSetpoint += (amount * 10); + // TODO should check against maximum/minimum and absolute max and min values + status = emberAfWriteAttribute(endpoint, ZCL_THERMOSTAT_CLUSTER_ID, ZCL_OCCUPIED_COOLING_SETPOINT_ATTRIBUTE_ID, + CLUSTER_MASK_SERVER, (uint8_t *) &CoolingSetpoint, ZCL_INT16U_ATTRIBUTE_TYPE); + if (status == EMBER_ZCL_STATUS_SUCCESS) + { + result = true; + } + else + { + // Todo roll back the setpoints + } + } + break; + } + + case EMBER_ZCL_SETPOINT_ADJUST_MODE_HEAT_SETPOINT: { + // In cooling mode we will need to change only the cooling setpoint + status = emberAfReadAttribute(endpoint, ZCL_THERMOSTAT_CLUSTER_ID, ZCL_OCCUPIED_HEATING_SETPOINT_ATTRIBUTE_ID, + CLUSTER_MASK_SERVER, (uint8_t *) &HeatingSetpoint, sizeof(CoolingSetpoint), NULL); + if (status == EMBER_ZCL_STATUS_SUCCESS) + { + HeatingSetpoint += (amount * 10); + // TODO should check against maximum/minimum and absolute max and min values + status = emberAfWriteAttribute(endpoint, ZCL_THERMOSTAT_CLUSTER_ID, ZCL_OCCUPIED_HEATING_SETPOINT_ATTRIBUTE_ID, + CLUSTER_MASK_SERVER, (uint8_t *) &HeatingSetpoint, ZCL_INT16U_ATTRIBUTE_TYPE); + if (status == EMBER_ZCL_STATUS_SUCCESS) + { + result = true; + } + else + { + // Todo roll back the setpoints + } + } + break; + } + + default: + // Nothing to do here + break; + } + emberAfSendImmediateDefaultResponse(status); + return result; +} diff --git a/src/app/encoder.cpp b/src/app/encoder.cpp index 30a85a197127b1..63e8479303d987 100644 --- a/src/app/encoder.cpp +++ b/src/app/encoder.cpp @@ -117,6 +117,7 @@ uint16_t encodeApsFrame(uint8_t * buffer, uint16_t buf_length, EmberApsFrame * a | OnOff | 0x0006 | | Scenes | 0x0005 | | TemperatureMeasurement | 0x0402 | +| Thermostat | 0x0201 | | WindowCovering | 0x0102 | \*----------------------------------------------------------------------------*/ @@ -263,6 +264,13 @@ uint16_t encodeApsFrame(uint8_t * buffer, uint16_t buf_length, EmberApsFrame * a #define TEMP_MEASUREMENT_CLUSTER_ID 0x0402 +#define THERMOSTAT_CLUSTER_ID 0x0201 +#define ZCL_CLEAR_WEEKLY_SCHEDULE_COMMAND_ID (0x03) +#define ZCL_GET_RELAY_STATUS_LOG_COMMAND_ID (0x04) +#define ZCL_GET_WEEKLY_SCHEDULE_COMMAND_ID (0x02) +#define ZCL_SET_WEEKLY_SCHEDULE_COMMAND_ID (0x01) +#define ZCL_SETPOINT_RAISE_LOWER_COMMAND_ID (0x00) + #define WINDOW_COVERING_CLUSTER_ID 0x0102 #define ZCL_WINDOW_COVERING_DOWN_CLOSE_COMMAND_ID (0x01) #define ZCL_WINDOW_COVERING_GO_TO_LIFT_PERCENTAGE_COMMAND_ID (0x05) @@ -3726,6 +3734,233 @@ PacketBufferHandle encodeTemperatureMeasurementClusterReadClusterRevisionAttribu COMMAND_FOOTER(); } +/*----------------------------------------------------------------------------*\ +| Cluster Thermostat | 0x0201 | +|------------------------------------------------------------------------------| +| Commands: | | +| * ClearWeeklySchedule | 0x03 | +| * GetRelayStatusLog | 0x04 | +| * GetWeeklySchedule | 0x02 | +| * SetWeeklySchedule | 0x01 | +| * SetpointRaiseLower | 0x00 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * LocalTemperature | 0x0000 | +| * OccupiedCoolingSetpoint | 0x0011 | +| * OccupiedHeatingSetpoint | 0x0012 | +| * ControlSequenceOfOperation | 0x001B | +| * SystemMode | 0x001C | +| * ClusterRevision | 0xFFFD | +\*----------------------------------------------------------------------------*/ + +/* + * Command ClearWeeklySchedule + */ +PacketBufferHandle encodeThermostatClusterClearWeeklyScheduleCommand(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ClearWeeklySchedule", THERMOSTAT_CLUSTER_ID); + buf.Put8(kFrameControlClusterSpecificCommand).Put8(seqNum).Put8(ZCL_CLEAR_WEEKLY_SCHEDULE_COMMAND_ID); + COMMAND_FOOTER(); +} + +/* + * Command GetRelayStatusLog + */ +PacketBufferHandle encodeThermostatClusterGetRelayStatusLogCommand(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("GetRelayStatusLog", THERMOSTAT_CLUSTER_ID); + buf.Put8(kFrameControlClusterSpecificCommand).Put8(seqNum).Put8(ZCL_GET_RELAY_STATUS_LOG_COMMAND_ID); + COMMAND_FOOTER(); +} + +/* + * Command GetWeeklySchedule + */ +PacketBufferHandle encodeThermostatClusterGetWeeklyScheduleCommand(uint8_t seqNum, EndpointId destinationEndpoint, + uint8_t daysToReturn, uint8_t modeToReturn) +{ + COMMAND_HEADER("GetWeeklySchedule", THERMOSTAT_CLUSTER_ID); + + buf.Put8(kFrameControlClusterSpecificCommand) + .Put8(seqNum) + .Put8(ZCL_GET_WEEKLY_SCHEDULE_COMMAND_ID) + .Put8(daysToReturn) + .Put8(modeToReturn); + COMMAND_FOOTER(); +} + +/* + * Command SetWeeklySchedule + */ +PacketBufferHandle encodeThermostatClusterSetWeeklyScheduleCommand(uint8_t seqNum, EndpointId destinationEndpoint, + uint8_t numberOfTransitionsForSequence, + uint8_t dayOfWeekForSequence, uint8_t modeForSequence, + uint8_t payload) +{ + COMMAND_HEADER("SetWeeklySchedule", THERMOSTAT_CLUSTER_ID); + + buf.Put8(kFrameControlClusterSpecificCommand) + .Put8(seqNum) + .Put8(ZCL_SET_WEEKLY_SCHEDULE_COMMAND_ID) + .Put8(numberOfTransitionsForSequence) + .Put8(dayOfWeekForSequence) + .Put8(modeForSequence) + .Put8(payload); + COMMAND_FOOTER(); +} + +/* + * Command SetpointRaiseLower + */ +PacketBufferHandle encodeThermostatClusterSetpointRaiseLowerCommand(uint8_t seqNum, EndpointId destinationEndpoint, uint8_t mode, + int8_t amount) +{ + COMMAND_HEADER("SetpointRaiseLower", THERMOSTAT_CLUSTER_ID); + + buf.Put8(kFrameControlClusterSpecificCommand) + .Put8(seqNum) + .Put8(ZCL_SETPOINT_RAISE_LOWER_COMMAND_ID) + .Put8(mode) + .Put8(static_cast(amount)); + COMMAND_FOOTER(); +} + +PacketBufferHandle encodeThermostatClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("DiscoverThermostatAttributes", THERMOSTAT_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_DISCOVER_ATTRIBUTES_COMMAND_ID).Put16(0x0000).Put8(0xFF); + COMMAND_FOOTER(); +} + +/* + * Attribute LocalTemperature + */ +PacketBufferHandle encodeThermostatClusterReadLocalTemperatureAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadThermostatLocalTemperature", THERMOSTAT_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0x0000); + COMMAND_FOOTER(); +} + +PacketBufferHandle encodeThermostatClusterConfigureLocalTemperatureAttribute(uint8_t seqNum, EndpointId destinationEndpoint, + uint16_t minInterval, uint16_t maxInterval, + int16_t change) +{ + COMMAND_HEADER("ReportThermostatLocalTemperature", THERMOSTAT_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand) + .Put8(seqNum) + .Put8(ZCL_CONFIGURE_REPORTING_COMMAND_ID) + .Put8(EMBER_ZCL_REPORTING_DIRECTION_REPORTED) + .Put16(0x0000) + .Put8(41) + .Put16(minInterval) + .Put16(maxInterval); + buf.Put16(static_cast(change)); + COMMAND_FOOTER(); +} + +/* + * Attribute OccupiedCoolingSetpoint + */ +PacketBufferHandle encodeThermostatClusterReadOccupiedCoolingSetpointAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadThermostatOccupiedCoolingSetpoint", THERMOSTAT_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0x0011); + COMMAND_FOOTER(); +} + +PacketBufferHandle encodeThermostatClusterWriteOccupiedCoolingSetpointAttribute(uint8_t seqNum, EndpointId destinationEndpoint, + int16_t occupiedCoolingSetpoint) +{ + COMMAND_HEADER("WriteThermostatOccupiedCoolingSetpoint", THERMOSTAT_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand) + .Put8(seqNum) + .Put8(ZCL_WRITE_ATTRIBUTES_COMMAND_ID) + .Put16(0x0011) + .Put8(41) + .Put16(static_cast(occupiedCoolingSetpoint)); + COMMAND_FOOTER(); +} + +/* + * Attribute OccupiedHeatingSetpoint + */ +PacketBufferHandle encodeThermostatClusterReadOccupiedHeatingSetpointAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadThermostatOccupiedHeatingSetpoint", THERMOSTAT_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0x0012); + COMMAND_FOOTER(); +} + +PacketBufferHandle encodeThermostatClusterWriteOccupiedHeatingSetpointAttribute(uint8_t seqNum, EndpointId destinationEndpoint, + int16_t occupiedHeatingSetpoint) +{ + COMMAND_HEADER("WriteThermostatOccupiedHeatingSetpoint", THERMOSTAT_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand) + .Put8(seqNum) + .Put8(ZCL_WRITE_ATTRIBUTES_COMMAND_ID) + .Put16(0x0012) + .Put8(41) + .Put16(static_cast(occupiedHeatingSetpoint)); + COMMAND_FOOTER(); +} + +/* + * Attribute ControlSequenceOfOperation + */ +PacketBufferHandle encodeThermostatClusterReadControlSequenceOfOperationAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadThermostatControlSequenceOfOperation", THERMOSTAT_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0x001B); + COMMAND_FOOTER(); +} + +PacketBufferHandle encodeThermostatClusterWriteControlSequenceOfOperationAttribute(uint8_t seqNum, EndpointId destinationEndpoint, + uint8_t controlSequenceOfOperation) +{ + COMMAND_HEADER("WriteThermostatControlSequenceOfOperation", THERMOSTAT_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand) + .Put8(seqNum) + .Put8(ZCL_WRITE_ATTRIBUTES_COMMAND_ID) + .Put16(0x001B) + .Put8(48) + .Put8(static_cast(controlSequenceOfOperation)); + COMMAND_FOOTER(); +} + +/* + * Attribute SystemMode + */ +PacketBufferHandle encodeThermostatClusterReadSystemModeAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadThermostatSystemMode", THERMOSTAT_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0x001C); + COMMAND_FOOTER(); +} + +PacketBufferHandle encodeThermostatClusterWriteSystemModeAttribute(uint8_t seqNum, EndpointId destinationEndpoint, + uint8_t systemMode) +{ + COMMAND_HEADER("WriteThermostatSystemMode", THERMOSTAT_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand) + .Put8(seqNum) + .Put8(ZCL_WRITE_ATTRIBUTES_COMMAND_ID) + .Put16(0x001C) + .Put8(48) + .Put8(static_cast(systemMode)); + COMMAND_FOOTER(); +} + +/* + * Attribute ClusterRevision + */ +PacketBufferHandle encodeThermostatClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadThermostatClusterRevision", THERMOSTAT_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0xFFFD); + COMMAND_FOOTER(); +} + /*----------------------------------------------------------------------------*\ | Cluster WindowCovering | 0x0102 | |------------------------------------------------------------------------------| diff --git a/src/controller/CHIPClusters.cpp b/src/controller/CHIPClusters.cpp index 5823480becce4c..53e4da0dfd63ac 100644 --- a/src/controller/CHIPClusters.cpp +++ b/src/controller/CHIPClusters.cpp @@ -4388,6 +4388,285 @@ CHIP_ERROR TemperatureMeasurementCluster::ReadAttributeClusterRevision(Callback: return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); } +// Thermostat Cluster Commands +CHIP_ERROR ThermostatCluster::ClearWeeklySchedule(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ +#if CHIP_ENABLE_INTERACTION_MODEL + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + (void) onSuccessCallback; + (void) onFailureCallback; + + app::Command::CommandParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kClearWeeklyScheduleCommandId, + (chip::app::Command::CommandPathFlags::kEndpointIdValid) }; + app::Command * ZCLcommand = mDevice->GetCommandSender(); + + TLV::TLVWriter writer = ZCLcommand->CreateCommandDataElementTLVWriter(); + + TLV::TLVType dummyType = TLV::kTLVType_NotSpecified; + ReturnErrorOnFailure(writer.StartContainer(TLV::AnonymousTag, TLV::kTLVType_Structure, dummyType)); + + // Command takes no arguments. + + ReturnErrorOnFailure(writer.EndContainer(dummyType)); + ReturnErrorOnFailure(writer.Finalize()); + ReturnErrorOnFailure(ZCLcommand->AddCommand(cmdParams)); + + return mDevice->SendCommands(); +#else + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeThermostatClusterClearWeeklyScheduleCommand(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +#endif +} + +CHIP_ERROR ThermostatCluster::GetRelayStatusLog(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +{ +#if CHIP_ENABLE_INTERACTION_MODEL + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + (void) onSuccessCallback; + (void) onFailureCallback; + + app::Command::CommandParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kGetRelayStatusLogCommandId, + (chip::app::Command::CommandPathFlags::kEndpointIdValid) }; + app::Command * ZCLcommand = mDevice->GetCommandSender(); + + TLV::TLVWriter writer = ZCLcommand->CreateCommandDataElementTLVWriter(); + + TLV::TLVType dummyType = TLV::kTLVType_NotSpecified; + ReturnErrorOnFailure(writer.StartContainer(TLV::AnonymousTag, TLV::kTLVType_Structure, dummyType)); + + // Command takes no arguments. + + ReturnErrorOnFailure(writer.EndContainer(dummyType)); + ReturnErrorOnFailure(writer.Finalize()); + ReturnErrorOnFailure(ZCLcommand->AddCommand(cmdParams)); + + return mDevice->SendCommands(); +#else + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeThermostatClusterGetRelayStatusLogCommand(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +#endif +} + +CHIP_ERROR ThermostatCluster::GetWeeklySchedule(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t daysToReturn, uint8_t modeToReturn) +{ +#if CHIP_ENABLE_INTERACTION_MODEL + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + (void) onSuccessCallback; + (void) onFailureCallback; + + app::Command::CommandParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kGetWeeklyScheduleCommandId, + (chip::app::Command::CommandPathFlags::kEndpointIdValid) }; + app::Command * ZCLcommand = mDevice->GetCommandSender(); + + TLV::TLVWriter writer = ZCLcommand->CreateCommandDataElementTLVWriter(); + + TLV::TLVType dummyType = TLV::kTLVType_NotSpecified; + ReturnErrorOnFailure(writer.StartContainer(TLV::AnonymousTag, TLV::kTLVType_Structure, dummyType)); + + uint8_t argSeqNumber = 0; + // daysToReturn: dayOfWeek + ReturnErrorOnFailure(writer.Put(TLV::ContextTag(argSeqNumber++), daysToReturn)); + // modeToReturn: modeForSequence + ReturnErrorOnFailure(writer.Put(TLV::ContextTag(argSeqNumber++), modeToReturn)); + + ReturnErrorOnFailure(writer.EndContainer(dummyType)); + ReturnErrorOnFailure(writer.Finalize()); + ReturnErrorOnFailure(ZCLcommand->AddCommand(cmdParams)); + + return mDevice->SendCommands(); +#else + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = + encodeThermostatClusterGetWeeklyScheduleCommand(seqNum, mEndpoint, daysToReturn, modeToReturn); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +#endif +} + +CHIP_ERROR ThermostatCluster::SetWeeklySchedule(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t numberOfTransitionsForSequence, uint8_t dayOfWeekForSequence, + uint8_t modeForSequence, uint8_t payload) +{ +#if CHIP_ENABLE_INTERACTION_MODEL + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + (void) onSuccessCallback; + (void) onFailureCallback; + + app::Command::CommandParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kSetWeeklyScheduleCommandId, + (chip::app::Command::CommandPathFlags::kEndpointIdValid) }; + app::Command * ZCLcommand = mDevice->GetCommandSender(); + + TLV::TLVWriter writer = ZCLcommand->CreateCommandDataElementTLVWriter(); + + TLV::TLVType dummyType = TLV::kTLVType_NotSpecified; + ReturnErrorOnFailure(writer.StartContainer(TLV::AnonymousTag, TLV::kTLVType_Structure, dummyType)); + + uint8_t argSeqNumber = 0; + // numberOfTransitionsForSequence: enum8 + ReturnErrorOnFailure(writer.Put(TLV::ContextTag(argSeqNumber++), numberOfTransitionsForSequence)); + // dayOfWeekForSequence: dayOfWeek + ReturnErrorOnFailure(writer.Put(TLV::ContextTag(argSeqNumber++), dayOfWeekForSequence)); + // modeForSequence: modeForSequence + ReturnErrorOnFailure(writer.Put(TLV::ContextTag(argSeqNumber++), modeForSequence)); + // payload: int8u + ReturnErrorOnFailure(writer.Put(TLV::ContextTag(argSeqNumber++), payload)); + + ReturnErrorOnFailure(writer.EndContainer(dummyType)); + ReturnErrorOnFailure(writer.Finalize()); + ReturnErrorOnFailure(ZCLcommand->AddCommand(cmdParams)); + + return mDevice->SendCommands(); +#else + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeThermostatClusterSetWeeklyScheduleCommand( + seqNum, mEndpoint, numberOfTransitionsForSequence, dayOfWeekForSequence, modeForSequence, payload); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +#endif +} + +CHIP_ERROR ThermostatCluster::SetpointRaiseLower(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t mode, int8_t amount) +{ +#if CHIP_ENABLE_INTERACTION_MODEL + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + (void) onSuccessCallback; + (void) onFailureCallback; + + app::Command::CommandParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kSetpointRaiseLowerCommandId, + (chip::app::Command::CommandPathFlags::kEndpointIdValid) }; + app::Command * ZCLcommand = mDevice->GetCommandSender(); + + TLV::TLVWriter writer = ZCLcommand->CreateCommandDataElementTLVWriter(); + + TLV::TLVType dummyType = TLV::kTLVType_NotSpecified; + ReturnErrorOnFailure(writer.StartContainer(TLV::AnonymousTag, TLV::kTLVType_Structure, dummyType)); + + uint8_t argSeqNumber = 0; + // mode: setpointAdjustMode + ReturnErrorOnFailure(writer.Put(TLV::ContextTag(argSeqNumber++), mode)); + // amount: int8s + ReturnErrorOnFailure(writer.Put(TLV::ContextTag(argSeqNumber++), amount)); + + ReturnErrorOnFailure(writer.EndContainer(dummyType)); + ReturnErrorOnFailure(writer.Finalize()); + ReturnErrorOnFailure(ZCLcommand->AddCommand(cmdParams)); + + return mDevice->SendCommands(); +#else + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeThermostatClusterSetpointRaiseLowerCommand(seqNum, mEndpoint, mode, amount); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +#endif +} + +// Thermostat Cluster Attributes +CHIP_ERROR ThermostatCluster::DiscoverAttributes(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeThermostatClusterDiscoverAttributes(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} +CHIP_ERROR ThermostatCluster::ReadAttributeLocalTemperature(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeThermostatClusterReadLocalTemperatureAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR ThermostatCluster::ConfigureAttributeLocalTemperature(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t minInterval, + uint16_t maxInterval, int16_t change) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = + encodeThermostatClusterConfigureLocalTemperatureAttribute(seqNum, mEndpoint, minInterval, maxInterval, change); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR ThermostatCluster::ReportAttributeLocalTemperature(Callback::Cancelable * onReportCallback) +{ + return RequestAttributeReporting(0x0000, onReportCallback); +} + +CHIP_ERROR ThermostatCluster::ReadAttributeOccupiedCoolingSetpoint(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeThermostatClusterReadOccupiedCoolingSetpointAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR ThermostatCluster::WriteAttributeOccupiedCoolingSetpoint(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, int16_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = + encodeThermostatClusterWriteOccupiedCoolingSetpointAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR ThermostatCluster::ReadAttributeOccupiedHeatingSetpoint(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeThermostatClusterReadOccupiedHeatingSetpointAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR ThermostatCluster::WriteAttributeOccupiedHeatingSetpoint(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, int16_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = + encodeThermostatClusterWriteOccupiedHeatingSetpointAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR ThermostatCluster::ReadAttributeControlSequenceOfOperation(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeThermostatClusterReadControlSequenceOfOperationAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR ThermostatCluster::WriteAttributeControlSequenceOfOperation(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = + encodeThermostatClusterWriteControlSequenceOfOperationAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR ThermostatCluster::ReadAttributeSystemMode(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeThermostatClusterReadSystemModeAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR ThermostatCluster::WriteAttributeSystemMode(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeThermostatClusterWriteSystemModeAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR ThermostatCluster::ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeThermostatClusterReadClusterRevisionAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + // WindowCovering Cluster Commands CHIP_ERROR WindowCoveringCluster::WindowCoveringDownClose(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) diff --git a/src/controller/CHIPClusters.h b/src/controller/CHIPClusters.h index 995aee8a1ea737..f502ba290a7988 100644 --- a/src/controller/CHIPClusters.h +++ b/src/controller/CHIPClusters.h @@ -45,6 +45,7 @@ constexpr ClusterId kNetworkCommissioningClusterId = 0x0031; constexpr ClusterId kOnOffClusterId = 0x0006; constexpr ClusterId kScenesClusterId = 0x0005; constexpr ClusterId kTemperatureMeasurementClusterId = 0x0402; +constexpr ClusterId kThermostatClusterId = 0x0201; constexpr ClusterId kWindowCoveringClusterId = 0x0102; class DLL_EXPORT ApplicationBasicCluster : public ClusterBase @@ -699,6 +700,55 @@ class DLL_EXPORT TemperatureMeasurementCluster : public ClusterBase CHIP_ERROR ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback); }; +class DLL_EXPORT ThermostatCluster : public ClusterBase +{ +public: + ThermostatCluster() : ClusterBase(kThermostatClusterId) {} + ~ThermostatCluster() {} + + // Cluster Commands + CHIP_ERROR ClearWeeklySchedule(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR GetRelayStatusLog(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR GetWeeklySchedule(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t daysToReturn, uint8_t modeToReturn); + CHIP_ERROR SetWeeklySchedule(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t numberOfTransitionsForSequence, uint8_t dayOfWeekForSequence, uint8_t modeForSequence, + uint8_t payload); + CHIP_ERROR SetpointRaiseLower(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t mode, + int8_t amount); + + // Cluster Attributes + CHIP_ERROR DiscoverAttributes(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeLocalTemperature(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeOccupiedCoolingSetpoint(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeOccupiedHeatingSetpoint(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeControlSequenceOfOperation(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeSystemMode(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR WriteAttributeOccupiedCoolingSetpoint(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, int16_t value); + CHIP_ERROR WriteAttributeOccupiedHeatingSetpoint(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, int16_t value); + CHIP_ERROR WriteAttributeControlSequenceOfOperation(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t value); + CHIP_ERROR WriteAttributeSystemMode(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t value); + CHIP_ERROR ConfigureAttributeLocalTemperature(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t minInterval, + uint16_t maxInterval, int16_t change); + CHIP_ERROR ReportAttributeLocalTemperature(Callback::Cancelable * onReportCallback); + +private: + static constexpr CommandId kClearWeeklyScheduleCommandId = 0x03; + static constexpr CommandId kGetRelayStatusLogCommandId = 0x04; + static constexpr CommandId kGetWeeklyScheduleCommandId = 0x02; + static constexpr CommandId kSetWeeklyScheduleCommandId = 0x01; + static constexpr CommandId kSetpointRaiseLowerCommandId = 0x00; +}; + class DLL_EXPORT WindowCoveringCluster : public ClusterBase { public: diff --git a/src/controller/controller-clusters.zap b/src/controller/controller-clusters.zap index c61f7a7d7a7c11..018c3c08c98cdd 100644 --- a/src/controller/controller-clusters.zap +++ b/src/controller/controller-clusters.zap @@ -1,5 +1,5 @@ { - "featureLevel": 19, + "featureLevel": 26, "creator": "zap", "keyValuePairs": [ { @@ -18,13 +18,13 @@ "package": [ { "pathRelativity": "relativeToZap", - "path": "../../../connectedhomeip-1/src/app/zap-templates/zcl/zcl.json", + "path": "../app/zap-templates/zcl/zcl.json", "version": "ZCL Test Data", "type": "zcl-properties" }, { "pathRelativity": "relativeToZap", - "path": "../../../connectedhomeip-1/src/app/zap-templates/app-templates.json", + "path": "../app/zap-templates/app-templates.json", "version": "chip-v1", "type": "gen-templates-json" } @@ -98,30 +98,30 @@ ], "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "identify time", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "identify time", - "code": 0, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "2", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -247,30 +247,30 @@ ], "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "name support", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "name support", - "code": 0, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "3", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -419,21 +419,6 @@ } ], "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "scene count", "code": 0, @@ -508,6 +493,21 @@ "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 } ] }, @@ -572,31 +572,31 @@ "commands": [], "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "on/off", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", - "reportable": 0, + "defaultValue": "0x00", + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "on/off", - "code": 0, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, + "defaultValue": "2", + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -704,31 +704,31 @@ "commands": [], "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "current level", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", - "reportable": 0, + "defaultValue": "0x00", + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "current level", - "code": 0, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, + "defaultValue": "3", + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -771,23 +771,23 @@ "commands": [], "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "device list", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "device list", - "code": 0, + "name": "server list", + "code": 1, "mfgCode": null, "side": "server", "included": 1, @@ -801,8 +801,8 @@ "reportableChange": 0 }, { - "name": "server list", - "code": 1, + "name": "client list", + "code": 2, "mfgCode": null, "side": "server", "included": 1, @@ -816,8 +816,8 @@ "reportableChange": 0 }, { - "name": "client list", - "code": 2, + "name": "parts list", + "code": 3, "mfgCode": null, "side": "server", "included": 1, @@ -831,15 +831,15 @@ "reportableChange": 0 }, { - "name": "parts list", - "code": 3, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -858,7 +858,7 @@ { "name": "MfgSpecificPing", "code": 0, - "mfgCode": "4098", + "mfgCode": 4098, "source": "client", "incoming": 1, "outgoing": 0 @@ -916,21 +916,6 @@ } ], "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "InteractionModelVersion", "code": 0, @@ -1095,6 +1080,21 @@ "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 } ] }, @@ -1184,45 +1184,45 @@ ], "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "FabricId", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "o", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "FabricId", - "code": 0, + "name": "Breadcrumb", + "code": 1, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "o", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "Breadcrumb", - "code": 1, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -1657,21 +1657,6 @@ } ], "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "lock state", "code": 0, @@ -2091,6 +2076,21 @@ "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 } ] }, @@ -2186,21 +2186,6 @@ "enabled": 1, "commands": [], "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "window covering type", "code": 0, @@ -2335,6 +2320,21 @@ "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 } ] }, @@ -2391,23 +2391,23 @@ "commands": [], "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "barrier moving state", + "code": 1, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "barrier moving state", - "code": 1, + "name": "barrier safety status", + "code": 2, "mfgCode": null, "side": "server", "included": 1, @@ -2421,8 +2421,8 @@ "reportableChange": 0 }, { - "name": "barrier safety status", - "code": 2, + "name": "barrier capabilities", + "code": 3, "mfgCode": null, "side": "server", "included": 1, @@ -2436,8 +2436,8 @@ "reportableChange": 0 }, { - "name": "barrier capabilities", - "code": 3, + "name": "barrier position", + "code": 10, "mfgCode": null, "side": "server", "included": 1, @@ -2451,15 +2451,15 @@ "reportableChange": 0 }, { - "name": "barrier position", - "code": 10, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -2468,43 +2468,258 @@ ] }, { - "name": "Color Control", - "code": 768, + "name": "Thermostat", + "code": 513, "mfgCode": null, - "define": "COLOR_CONTROL_CLUSTER", + "define": "THERMOSTAT_CLUSTER", "side": "client", "enabled": 0, "commands": [ { - "name": "MoveToHue", + "name": "SetpointRaiseLower", "code": 0, "mfgCode": null, "source": "client", - "incoming": 1, + "incoming": 0, "outgoing": 1 }, { - "name": "MoveHue", + "name": "SetWeeklySchedule", "code": 1, "mfgCode": null, "source": "client", - "incoming": 1, + "incoming": 0, "outgoing": 1 }, { - "name": "StepHue", + "name": "GetWeeklySchedule", "code": 2, "mfgCode": null, "source": "client", - "incoming": 1, + "incoming": 0, "outgoing": 1 }, { - "name": "MoveToSaturation", + "name": "ClearWeeklySchedule", "code": 3, "mfgCode": null, "source": "client", - "incoming": 1, + "incoming": 0, + "outgoing": 1 + }, + { + "name": "GetRelayStatusLog", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Thermostat", + "code": 513, + "mfgCode": null, + "define": "THERMOSTAT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "CurrentWeeklySchedule", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RelayStatusLog", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "local temperature", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "pi cooling demand", + "code": 7, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "pi heating demand", + "code": 8, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "occupied cooling setpoint", + "code": 17, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0A28", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "occupied heating setpoint", + "code": 18, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x07D0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "control sequence of operation", + "code": 27, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x04", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "system mode", + "code": 28, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Color Control", + "code": 768, + "mfgCode": null, + "define": "COLOR_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "MoveToHue", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveHue", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StepHue", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveToSaturation", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, "outgoing": 1 }, { @@ -2615,21 +2830,6 @@ "enabled": 1, "commands": [], "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "current hue", "code": 0, @@ -3230,36 +3430,6 @@ "maxInterval": 65344, "reportableChange": 0 }, - { - "name": "couple color temp to level min-mireds", - "code": 16397, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "start up color temperature mireds", - "code": 16400, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "enhanced current hue", "code": 16384, @@ -3379,6 +3549,51 @@ "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + }, + { + "name": "couple color temp to level min-mireds", + "code": 16397, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "start up color temperature mireds", + "code": 16400, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 } ] }, @@ -3417,21 +3632,6 @@ "enabled": 1, "commands": [], "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "measured value", "code": 0, @@ -3491,6 +3691,21 @@ "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 } ] }, @@ -3555,21 +3770,6 @@ } ], "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "zone state", "code": 0, @@ -3644,6 +3844,21 @@ "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 } ] }, @@ -3743,21 +3958,6 @@ "enabled": 1, "commands": [], "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "vendor name", "code": 0, @@ -3862,6 +4062,21 @@ "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 } ] }, @@ -3970,23 +4185,23 @@ "commands": [], "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "groups", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "groups", - "code": 0, + "name": "group keys", + "code": 1, "mfgCode": null, "side": "server", "included": 1, @@ -4000,15 +4215,15 @@ "reportableChange": 0 }, { - "name": "group keys", - "code": 1, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -4086,30 +4301,30 @@ ], "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "identify time", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "identify time", - "code": 0, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "2", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -4235,30 +4450,30 @@ ], "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "name support", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "name support", - "code": 0, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "3", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -4402,26 +4617,11 @@ "code": 6, "mfgCode": null, "source": "server", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ { "name": "scene count", "code": 0, @@ -4496,6 +4696,21 @@ "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 } ] }, @@ -4560,31 +4775,31 @@ "commands": [], "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "on/off", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", - "reportable": 0, + "defaultValue": "0x00", + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "on/off", - "code": 0, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, + "defaultValue": "2", + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -4692,31 +4907,31 @@ "commands": [], "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "current level", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", - "reportable": 0, + "defaultValue": "0x00", + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "current level", - "code": 0, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, + "defaultValue": "3", + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -4960,21 +5175,6 @@ } ], "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "lock state", "code": 0, @@ -5394,6 +5594,21 @@ "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 } ] }, @@ -5450,23 +5665,23 @@ "commands": [], "attributes": [ { - "name": "cluster revision", - "code": 65533, + "name": "barrier moving state", + "code": 1, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "barrier moving state", - "code": 1, + "name": "barrier safety status", + "code": 2, "mfgCode": null, "side": "server", "included": 1, @@ -5480,8 +5695,8 @@ "reportableChange": 0 }, { - "name": "barrier safety status", - "code": 2, + "name": "barrier capabilities", + "code": 3, "mfgCode": null, "side": "server", "included": 1, @@ -5495,8 +5710,8 @@ "reportableChange": 0 }, { - "name": "barrier capabilities", - "code": 3, + "name": "barrier position", + "code": 10, "mfgCode": null, "side": "server", "included": 1, @@ -5510,15 +5725,15 @@ "reportableChange": 0 }, { - "name": "barrier position", - "code": 10, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -5674,21 +5889,6 @@ "enabled": 0, "commands": [], "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "current hue", "code": 0, @@ -6289,36 +6489,6 @@ "maxInterval": 65344, "reportableChange": 0 }, - { - "name": "couple color temp to level min-mireds", - "code": 16397, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "start up color temperature mireds", - "code": 16400, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "enhanced current hue", "code": 16384, @@ -6438,6 +6608,51 @@ "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + }, + { + "name": "couple color temp to level min-mireds", + "code": 16397, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "start up color temperature mireds", + "code": 16400, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 } ] }, @@ -6476,21 +6691,6 @@ "enabled": 0, "commands": [], "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "measured value", "code": 0, @@ -6550,6 +6750,21 @@ "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 } ] }, @@ -6614,21 +6829,6 @@ } ], "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "zone state", "code": 0, @@ -6703,6 +6903,21 @@ "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 } ] } diff --git a/src/controller/python/chip/clusters/CHIPClusters.cpp b/src/controller/python/chip/clusters/CHIPClusters.cpp index cc5d299b9bc4be..2640a7c273600e 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.cpp +++ b/src/controller/python/chip/clusters/CHIPClusters.cpp @@ -1827,6 +1827,104 @@ CHIP_ERROR chip_ime_ReadAttribute_TemperatureMeasurement_ClusterRevision(chip::C } // End of Cluster TemperatureMeasurement +// Cluster Thermostat + +CHIP_ERROR chip_ime_AppendCommand_Thermostat_ClearWeeklySchedule(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ClearWeeklySchedule(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel()); +} +CHIP_ERROR chip_ime_AppendCommand_Thermostat_GetRelayStatusLog(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.GetRelayStatusLog(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel()); +} +CHIP_ERROR chip_ime_AppendCommand_Thermostat_GetWeeklySchedule(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId, uint8_t daysToReturn, uint8_t modeToReturn) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.GetWeeklySchedule(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), daysToReturn, + modeToReturn); +} +CHIP_ERROR chip_ime_AppendCommand_Thermostat_SetWeeklySchedule(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId, uint8_t numberOfTransitionsForSequence, + uint8_t dayOfWeekForSequence, uint8_t modeForSequence, + uint8_t payload) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.SetWeeklySchedule(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), + numberOfTransitionsForSequence, dayOfWeekForSequence, modeForSequence, payload); +} +CHIP_ERROR chip_ime_AppendCommand_Thermostat_SetpointRaiseLower(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId, uint8_t mode, int8_t amount) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.SetpointRaiseLower(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), mode, amount); +} + +CHIP_ERROR chip_ime_ReadAttribute_Thermostat_LocalTemperature(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeLocalTemperature(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()); +} +CHIP_ERROR chip_ime_ReadAttribute_Thermostat_OccupiedCoolingSetpoint(chip::Controller::Device * device, + chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeOccupiedCoolingSetpoint(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()); +} +CHIP_ERROR chip_ime_ReadAttribute_Thermostat_OccupiedHeatingSetpoint(chip::Controller::Device * device, + chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeOccupiedHeatingSetpoint(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()); +} +CHIP_ERROR chip_ime_ReadAttribute_Thermostat_ControlSequenceOfOperation(chip::Controller::Device * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeControlSequenceOfOperation(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()); +} +CHIP_ERROR chip_ime_ReadAttribute_Thermostat_SystemMode(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeSystemMode(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()); +} +CHIP_ERROR chip_ime_ReadAttribute_Thermostat_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()); +} + +// End of Cluster Thermostat // Cluster WindowCovering CHIP_ERROR chip_ime_AppendCommand_WindowCovering_WindowCoveringDownClose(chip::Controller::Device * device, diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 56c96ec7bfb15a..55fba180f2babb 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -438,6 +438,26 @@ def ListClusterCommands(self): }, "TemperatureMeasurement": { }, + "Thermostat": { + "ClearWeeklySchedule": { + }, + "GetRelayStatusLog": { + }, + "GetWeeklySchedule": { + "daysToReturn": "int", + "modeToReturn": "int", + }, + "SetWeeklySchedule": { + "numberOfTransitionsForSequence": "int", + "dayOfWeekForSequence": "int", + "modeForSequence": "int", + "payload": "int", + }, + "SetpointRaiseLower": { + "mode": "int", + "amount": "int", + }, + }, "WindowCovering": { "WindowCoveringDownClose": { }, @@ -610,6 +630,14 @@ def ListClusterAttributes(self): "MaxMeasuredValue", "ClusterRevision", ], + "Thermostat": [ + "LocalTemperature", + "OccupiedCoolingSetpoint", + "OccupiedHeatingSetpoint", + "ControlSequenceOfOperation", + "SystemMode", + "ClusterRevision", + ], "WindowCovering": [ "WindowCoveringType", "CurrentPositionLift", @@ -972,6 +1000,26 @@ def ClusterScenes_CommandViewScene(self, device: ctypes.c_void_p, ZCLendpoint: i return self._chipLib.chip_ime_AppendCommand_Scenes_ViewScene( device, ZCLendpoint, ZCLgroupid, groupId, sceneId ) + def ClusterThermostat_CommandClearWeeklySchedule(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_AppendCommand_Thermostat_ClearWeeklySchedule( + device, ZCLendpoint, ZCLgroupid + ) + def ClusterThermostat_CommandGetRelayStatusLog(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_AppendCommand_Thermostat_GetRelayStatusLog( + device, ZCLendpoint, ZCLgroupid + ) + def ClusterThermostat_CommandGetWeeklySchedule(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, daysToReturn: int, modeToReturn: int): + return self._chipLib.chip_ime_AppendCommand_Thermostat_GetWeeklySchedule( + device, ZCLendpoint, ZCLgroupid, daysToReturn, modeToReturn + ) + def ClusterThermostat_CommandSetWeeklySchedule(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, numberOfTransitionsForSequence: int, dayOfWeekForSequence: int, modeForSequence: int, payload: int): + return self._chipLib.chip_ime_AppendCommand_Thermostat_SetWeeklySchedule( + device, ZCLendpoint, ZCLgroupid, numberOfTransitionsForSequence, dayOfWeekForSequence, modeForSequence, payload + ) + def ClusterThermostat_CommandSetpointRaiseLower(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, mode: int, amount: int): + return self._chipLib.chip_ime_AppendCommand_Thermostat_SetpointRaiseLower( + device, ZCLendpoint, ZCLgroupid, mode, amount + ) def ClusterWindowCovering_CommandWindowCoveringDownClose(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_AppendCommand_WindowCovering_WindowCoveringDownClose( device, ZCLendpoint, ZCLgroupid @@ -1227,6 +1275,18 @@ def ClusterTemperatureMeasurement_ReadAttributeMaxMeasuredValue(self, device: ct return self._chipLib.chip_ime_ReadAttribute_TemperatureMeasurement_MaxMeasuredValue(device, ZCLendpoint, ZCLgroupid) def ClusterTemperatureMeasurement_ReadAttributeClusterRevision(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_ReadAttribute_TemperatureMeasurement_ClusterRevision(device, ZCLendpoint, ZCLgroupid) + def ClusterThermostat_ReadAttributeLocalTemperature(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_Thermostat_LocalTemperature(device, ZCLendpoint, ZCLgroupid) + def ClusterThermostat_ReadAttributeOccupiedCoolingSetpoint(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_Thermostat_OccupiedCoolingSetpoint(device, ZCLendpoint, ZCLgroupid) + def ClusterThermostat_ReadAttributeOccupiedHeatingSetpoint(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_Thermostat_OccupiedHeatingSetpoint(device, ZCLendpoint, ZCLgroupid) + def ClusterThermostat_ReadAttributeControlSequenceOfOperation(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_Thermostat_ControlSequenceOfOperation(device, ZCLendpoint, ZCLgroupid) + def ClusterThermostat_ReadAttributeSystemMode(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_Thermostat_SystemMode(device, ZCLendpoint, ZCLgroupid) + def ClusterThermostat_ReadAttributeClusterRevision(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_Thermostat_ClusterRevision(device, ZCLendpoint, ZCLgroupid) def ClusterWindowCovering_ReadAttributeWindowCoveringType(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_ReadAttribute_WindowCovering_WindowCoveringType(device, ZCLendpoint, ZCLgroupid) def ClusterWindowCovering_ReadAttributeCurrentPositionLift(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): @@ -1854,6 +1914,40 @@ def InitLib(self, chipLib): # Cluster TemperatureMeasurement ReadAttribute ClusterRevision self._chipLib.chip_ime_ReadAttribute_TemperatureMeasurement_ClusterRevision.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] self._chipLib.chip_ime_ReadAttribute_TemperatureMeasurement_ClusterRevision.restype = ctypes.c_uint32 + # Cluster Thermostat + # Cluster Thermostat Command ClearWeeklySchedule + self._chipLib.chip_ime_AppendCommand_Thermostat_ClearWeeklySchedule.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_AppendCommand_Thermostat_ClearWeeklySchedule.restype = ctypes.c_uint32 + # Cluster Thermostat Command GetRelayStatusLog + self._chipLib.chip_ime_AppendCommand_Thermostat_GetRelayStatusLog.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_AppendCommand_Thermostat_GetRelayStatusLog.restype = ctypes.c_uint32 + # Cluster Thermostat Command GetWeeklySchedule + self._chipLib.chip_ime_AppendCommand_Thermostat_GetWeeklySchedule.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint8, ctypes.c_uint8] + self._chipLib.chip_ime_AppendCommand_Thermostat_GetWeeklySchedule.restype = ctypes.c_uint32 + # Cluster Thermostat Command SetWeeklySchedule + self._chipLib.chip_ime_AppendCommand_Thermostat_SetWeeklySchedule.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint8, ctypes.c_uint8, ctypes.c_uint8, ctypes.c_uint8] + self._chipLib.chip_ime_AppendCommand_Thermostat_SetWeeklySchedule.restype = ctypes.c_uint32 + # Cluster Thermostat Command SetpointRaiseLower + self._chipLib.chip_ime_AppendCommand_Thermostat_SetpointRaiseLower.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint8, ctypes.c_int8] + self._chipLib.chip_ime_AppendCommand_Thermostat_SetpointRaiseLower.restype = ctypes.c_uint32 + # Cluster Thermostat ReadAttribute LocalTemperature + self._chipLib.chip_ime_ReadAttribute_Thermostat_LocalTemperature.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_Thermostat_LocalTemperature.restype = ctypes.c_uint32 + # Cluster Thermostat ReadAttribute OccupiedCoolingSetpoint + self._chipLib.chip_ime_ReadAttribute_Thermostat_OccupiedCoolingSetpoint.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_Thermostat_OccupiedCoolingSetpoint.restype = ctypes.c_uint32 + # Cluster Thermostat ReadAttribute OccupiedHeatingSetpoint + self._chipLib.chip_ime_ReadAttribute_Thermostat_OccupiedHeatingSetpoint.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_Thermostat_OccupiedHeatingSetpoint.restype = ctypes.c_uint32 + # Cluster Thermostat ReadAttribute ControlSequenceOfOperation + self._chipLib.chip_ime_ReadAttribute_Thermostat_ControlSequenceOfOperation.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_Thermostat_ControlSequenceOfOperation.restype = ctypes.c_uint32 + # Cluster Thermostat ReadAttribute SystemMode + self._chipLib.chip_ime_ReadAttribute_Thermostat_SystemMode.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_Thermostat_SystemMode.restype = ctypes.c_uint32 + # Cluster Thermostat ReadAttribute ClusterRevision + self._chipLib.chip_ime_ReadAttribute_Thermostat_ClusterRevision.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_Thermostat_ClusterRevision.restype = ctypes.c_uint32 # Cluster WindowCovering # Cluster WindowCovering Command WindowCoveringDownClose self._chipLib.chip_ime_AppendCommand_WindowCovering_WindowCoveringDownClose.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16]