Skip to content

GH-31: Thermostat Operating State CC #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15863,5 +15863,5 @@ export let ClusterTypeAttrs: any = {
commands: [
]
}
}
},
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
diff a/applications/dev_ui/dev_gui/zap-generated/src/cluster-types/cluster-type-attributes.ts b/applications/dev_ui/dev_gui/zap-generated/src/cluster-types/cluster-type-attributes.ts (rejected hunks)
@@ -1,7 +1,7 @@
//This file is generated automatically. Don't try to change something here.
//To add support for new clusters, modify addon-helper.js
//To change the stucture of the ClusterTypeAttrs, modify cluster-type-attributes.zapt
-
+

//generate ClusterTypes
export let ClusterTypeAttrs: any = {
25 changes: 25 additions & 0 deletions applications/zpc/components/dotdot_mapper/rules/Thermostat.uam
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ def zwTHERMOSTAT_MODE_VERSION 0x4001
def zwTHERMOSTAT_MODE 0x4002
def zwTHERMOSTAT_SUPPORTED_MODES 0x4003

//Thermostat Operating State CC
def zwTHERMOSTAT_OPERATING_STATE_MODE 0x4202

// Thermostat Cluster
def zb_LocalTemperature 0x02010000
def zb_HVACSystemTypeConfiguration 0x02010009
Expand All @@ -40,6 +43,7 @@ def zb_SystemMode 0x0201001c
def zb_TemperatureSetpointHold 0x02010023
def zb_TemperatureSetpointHoldDuration 0x02010024
def zb_ThermostatProgrammingOperationMode 0x02010025
def zb_ThermostatRunningState 0x02010029
def zb_OccupiedSetback 0x02010034
def zb_OccupiedSetbackMin 0x02010035
def zb_OccupiedSetbackMax 0x02010036
Expand All @@ -54,7 +58,11 @@ def zb_ACLouverPosition 0x02010045
def zb_ACCoilTemperature 0x02010046
def zb_ACCapacityFormat 0x02010047

// Unify thermostat cluster
def zb_OperatingState 0xfd150003

def thermostat_setpoint_supported (e'zwTHERMOSTAT_SETPOINT_TYPE[2].zwTHERMOSTAT_SETPOINT_VALUE_SCALE | e'zwTHERMOSTAT_SETPOINT_TYPE[1].zwTHERMOSTAT_SETPOINT_VALUE_SCALE)
def no_thermostat_operating_state (e'zwTHERMOSTAT_OPERATING_STATE_MODE == 0)

scope 0 {
// We map Setpoint setpoint_type 0x01 (HEATING) and 0x02 (COOLING)
Expand Down Expand Up @@ -252,4 +260,21 @@ scope 0 chain_reaction(0) {
d'zb_ACCapacityFormat =
if (r'zb_ACCapacityFormat != d'zb_ACCapacityFormat) r'zb_ACCapacityFormat
undefined

// Thermostat Operating State
// UCL bindings
r'zb_ThermostatRunningState =
if (no_thermostat_operating_state) undefined
if (r'zwTHERMOSTAT_OPERATING_STATE_MODE == 0x00) 0x00
if (r'zwTHERMOSTAT_OPERATING_STATE_MODE == 0x01) 0x01
if (r'zwTHERMOSTAT_OPERATING_STATE_MODE == 0x02) 0x02
if (r'zwTHERMOSTAT_OPERATING_STATE_MODE == 0x03) 0x04
if (r'zwTHERMOSTAT_OPERATING_STATE_MODE == 0x08) 0x08
if (r'zwTHERMOSTAT_OPERATING_STATE_MODE == 0x09) 0x10
if (r'zwTHERMOSTAT_OPERATING_STATE_MODE == 0x0A) 0x20
if (r'zwTHERMOSTAT_OPERATING_STATE_MODE == 0x0B) 0x40
undefined // Default state

// Custom cluster binding
r'zb_OperatingState = r'zwTHERMOSTAT_OPERATING_STATE_MODE
}
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,39 @@ DEFINE_ATTRIBUTE(ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_SETPOINT_MAX_VALUE,
DEFINE_ATTRIBUTE(ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_SETPOINT_MAX_VALUE_SCALE,
((COMMAND_CLASS_THERMOSTAT_SETPOINT << 8) | 0x09))

/////////////////////////////////////////////////
// Thermostat Operating State Command Class
/// zwave_cc_version_t
DEFINE_ATTRIBUTE(ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_OPERATING_STATE_VERSION,
ZWAVE_CC_VERSION_ATTRIBUTE(COMMAND_CLASS_THERMOSTAT_OPERATING_STATE))
/// Current State
DEFINE_ATTRIBUTE(ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_OPERATING_STATE_CURRENT_STATE,
((COMMAND_CLASS_THERMOSTAT_OPERATING_STATE << 8) | 0x02))
/// Log supported count (v2)
DEFINE_ATTRIBUTE(ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_OPERATING_STATE_LOG_SUPPORTED_BITMASK,
((COMMAND_CLASS_THERMOSTAT_OPERATING_STATE << 8) | 0x03))
/// Log supported (v2)
DEFINE_ATTRIBUTE(ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_OPERATING_STATE_LOG_SUPPORTED,
((COMMAND_CLASS_THERMOSTAT_OPERATING_STATE << 8) | 0x04))
/// Log count (v2)
DEFINE_ATTRIBUTE(ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_OPERATING_STATE_LOG_BITMASK,
((COMMAND_CLASS_THERMOSTAT_OPERATING_STATE << 8) | 0x05))
/// Log State (v2)
DEFINE_ATTRIBUTE(ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_OPERATING_STATE_LOG_STATE,
((COMMAND_CLASS_THERMOSTAT_OPERATING_STATE << 8) | 0x06))
/// Log Usage Today (hours) (v2)
DEFINE_ATTRIBUTE(ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_OPERATING_STATE_LOG_USAGE_TODAY_HOURS,
((COMMAND_CLASS_THERMOSTAT_OPERATING_STATE << 8) | 0x07))
/// Log Usage Today (min) (v2)
DEFINE_ATTRIBUTE(ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_OPERATING_STATE_LOG_USAGE_TODAY_MIN,
((COMMAND_CLASS_THERMOSTAT_OPERATING_STATE << 8) | 0x08))
/// Log Usage Yesterday (hours) (v2)
DEFINE_ATTRIBUTE(ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_OPERATING_STATE_LOG_USAGE_YESTERDAY_HOURS,
((COMMAND_CLASS_THERMOSTAT_OPERATING_STATE << 8) | 0x09))
/// Log Usage Yesterday (min) (v2)
DEFINE_ATTRIBUTE(ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_OPERATING_STATE_LOG_USAGE_YESTERDAY_MIN,
((COMMAND_CLASS_THERMOSTAT_OPERATING_STATE << 8) | 0x0A))

/////////////////////////////////////////////////
// Wakeup command class
DEFINE_ATTRIBUTE(ATTRIBUTE_COMMAND_CLASS_WAKE_UP_VERSION,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/******************************************************************************
* # License
* <b>Copyright 2024 Silicon Laboratories Inc. www.silabs.com</b>
******************************************************************************
* The licensor of this software is Silicon Laboratories Inc. Your use of this
* software is governed by the terms of Silicon Labs Master Software License
* Agreement (MSLA) available at
* www.silabs.com/about-us/legal/master-software-license-agreement. This
* software is distributed to you in Source Code format and is governed by the
* sections of the MSLA applicable to Source Code.
*
*****************************************************************************/

/**
* @defgroup zwave_command_class_thermostat_operating_state_types Type definitions for attribute storage of the Thermostat Operating State Command Class
* @ingroup zpc_attribute_store_command_classes_types
* @brief Type definitions for the Thermostat Operating State Command Class.
*
* @{
*/

#ifndef ZWAVE_COMMAND_CLASS_THERMOSTAT_OPERATING_STATE_TYPES_H
#define ZWAVE_COMMAND_CLASS_THERMOSTAT_OPERATING_STATE_TYPES_H

#include <stdint.h>

///> Operating State. uint8_t
typedef uint8_t thermostat_operating_state_t;
///> Usage representation (v2). uint8_t
typedef uint8_t thermostat_operating_state_usage_t;

#ifdef __cplusplus
extern "C" {
#endif

#ifdef __cplusplus
}
#endif

#endif //ZWAVE_COMMAND_CLASS_THERMOSTAT_OPERATING_STATE_TYPES_H
/** @} end zwave_command_class_thermostat_operating_state_types */
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,22 @@ static const std::vector<attribute_schema_t> attribute_schema = {
{ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_SETPOINT_MIN_VALUE_SCALE, "Min Value Scale", ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_SETPOINT_TYPE, U32_STORAGE_TYPE},
{ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_SETPOINT_MAX_VALUE, "Max Value", ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_SETPOINT_TYPE, I32_STORAGE_TYPE},
{ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_SETPOINT_MAX_VALUE_SCALE, "Max Value Scale", ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_SETPOINT_TYPE, U32_STORAGE_TYPE},

/////////////////////////////////////////////////////////////////////
// Thermostat Operating State Command Class attributes
/////////////////////////////////////////////////////////////////////
{ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_OPERATING_STATE_VERSION, "Thermostat Operating State Version", ATTRIBUTE_ENDPOINT_ID, U8_STORAGE_TYPE},
{ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_OPERATING_STATE_CURRENT_STATE, "Thermostat Operating State", ATTRIBUTE_ENDPOINT_ID, U8_STORAGE_TYPE},
// V2
{ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_OPERATING_STATE_LOG_SUPPORTED_BITMASK, "Thermostat Operating State Log Supported Count", ATTRIBUTE_ENDPOINT_ID, U32_STORAGE_TYPE},
{ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_OPERATING_STATE_LOG_SUPPORTED, "Thermostat Operating State Log Supported", ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_OPERATING_STATE_LOG_SUPPORTED_BITMASK, U8_STORAGE_TYPE},
{ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_OPERATING_STATE_LOG_BITMASK, "Thermostat Operating State Log", ATTRIBUTE_ENDPOINT_ID, U32_STORAGE_TYPE},
{ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_OPERATING_STATE_LOG_STATE, "Thermostat Operating State Log State", ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_OPERATING_STATE_LOG_BITMASK, U8_STORAGE_TYPE},
{ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_OPERATING_STATE_LOG_USAGE_TODAY_HOURS, "Thermostat Operating State Log Usage Today (Hours)", ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_OPERATING_STATE_LOG_STATE, U8_STORAGE_TYPE},
{ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_OPERATING_STATE_LOG_USAGE_TODAY_MIN, "Thermostat Operating State Log Usage Today (Min)", ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_OPERATING_STATE_LOG_STATE, U8_STORAGE_TYPE},
{ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_OPERATING_STATE_LOG_USAGE_YESTERDAY_HOURS, "Thermostat Operating State Log Usage Yesterday (Hours)", ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_OPERATING_STATE_LOG_STATE, U8_STORAGE_TYPE},
{ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_OPERATING_STATE_LOG_USAGE_YESTERDAY_MIN, "Thermostat Operating State Log Usage Yesterday (Hours)", ATTRIBUTE_COMMAND_CLASS_THERMOSTAT_OPERATING_STATE_LOG_STATE, U8_STORAGE_TYPE},

/////////////////////////////////////////////////////////////////////
// Supervision Command Class attributes
/////////////////////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ add_library(
src/zwave_command_class_switch_multilevel.c
src/zwave_command_class_thermostat_mode.c
src/zwave_command_class_thermostat_setpoint.c
src/zwave_command_class_thermostat_operating_state.c
src/zwave_command_class_time.c
src/zwave_command_class_user_code.c
src/zwave_command_class_version.c
Expand Down
Loading