zcl_hvac.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. /**************************************************************************************************
  2. Filename: zcl_hvac.h
  3. Revised: $Date: 2011-05-19 11:53:12 -0700 (Thu, 19 May 2011) $
  4. Revision: $Revision: 26031 $
  5. Description: This file contains the ZCL HVAC definitions.
  6. Copyright 2006-2011 Texas Instruments Incorporated. All rights reserved.
  7. IMPORTANT: Your use of this Software is limited to those specific rights
  8. granted under the terms of a software license agreement between the user
  9. who downloaded the software, his/her employer (which must be your employer)
  10. and Texas Instruments Incorporated (the "License"). You may not use this
  11. Software unless you agree to abide by the terms of the License. The License
  12. limits your use, and you acknowledge, that the Software may not be modified,
  13. copied or distributed unless embedded on a Texas Instruments microcontroller
  14. or used solely and exclusively in conjunction with a Texas Instruments radio
  15. frequency transceiver, which is integrated into your product. Other than for
  16. the foregoing purpose, you may not use, reproduce, copy, prepare derivative
  17. works of, modify, distribute, perform, display or sell this Software and/or
  18. its documentation for any purpose.
  19. YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
  20. PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
  21. INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
  22. NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
  23. TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,
  24. NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
  25. LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
  26. INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
  27. OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
  28. OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
  29. (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
  30. Should you have any questions regarding your right to use this Software,
  31. contact Texas Instruments Incorporated at www.TI.com.
  32. **************************************************************************************************/
  33. #ifndef ZCL_HVAC_H
  34. #define ZCL_HVAC_H
  35. #ifdef __cplusplus
  36. extern "C"
  37. {
  38. #endif
  39. /*********************************************************************
  40. * INCLUDES
  41. */
  42. #include "zcl.h"
  43. /*********************************************************************
  44. * CONSTANTS
  45. */
  46. /**************************************************************************/
  47. /*** HVAC: Pump Config and Control Cluster Attributes ***/
  48. /**************************************************************************/
  49. // Pump information attribute set
  50. #define ATTRID_HVAC_PUMP_MAX_PRESSURE 0x0000
  51. #define ATTRID_HVAC_PUMP_MAX_SPEED 0x0001
  52. #define ATTRID_HVAC_PUMP_MAX_FLOW 0x0002
  53. #define ATTRID_HVAC_PUMP_MIN_CONST_PRESSURE 0x0003
  54. #define ATTRID_HVAC_PUMP_MAX_CONST_PRESSURE 0x0004
  55. #define ATTRID_HVAC_PUMP_MIN_COMP_PRESSURE 0x0005
  56. #define ATTRID_HVAC_PUMP_MAX_COMP_PRESSURE 0x0006
  57. #define ATTRID_HVAC_PUMP_MIN_CONST_SPEED 0x0007
  58. #define ATTRID_HVAC_PUMP_MAX_CONST_SPEED 0x0008
  59. #define ATTRID_HVAC_PUMP_MIN_CONST_FLOW 0x0009
  60. #define ATTRID_HVAC_PUMP_MAX_CONST_FLOW 0x000A
  61. #define ATTRID_HVAC_PUMP_MIN_CONST_TEMP 0x000B
  62. #define ATTRID_HVAC_PUMP_MAX_CONST_TEMP 0x000C
  63. // Pump Dynamic Information attribute set
  64. #define ATTRID_HVAC_PUMP_STATUS 0x0010
  65. #define ATTRID_HVAC_PUMP_EFECTIVE_OPERATION_MODE 0x0011
  66. #define ATTRID_HVAC_PUMP_EFFECTIVE_CONTROL_MODE 0x0012
  67. #define ATTRID_HVAC_PUMP_CAPACITY 0x0013
  68. #define ATTRID_HVAC_PUMP_SPEED 0x0014
  69. #define ATTRID_HVAC_PUMP_LIFETIME_RUNNING_HOURS 0x0015
  70. #define ATTRID_HVAC_PUMP_POWER 0x0016
  71. #define ATTRID_HVAC_LIFETIME_ENERGY_CONSUMED 0x0017
  72. /*** Pump status attribute values ***/
  73. #define HVAC_PUMP_DEVICE_FAULT 0x0000
  74. #define HVAC_PUMP_SUPPLY_FAULT 0x0001
  75. #define HVAC_PUMP_SPEED_LOW 0x0002
  76. #define HVAC_PUMP_SPEED_HIGH 0x0003
  77. #define HVAC_PUMP_LOCAL_OVERRIDE 0x0004
  78. #define HVAC_PUMP_RUNNING 0x0005
  79. #define HVAC_PUMP_REMOTE_PRESSURE 0x0006
  80. #define HVAC_PUMP_REMOTE_FLOW 0x0007
  81. #define HVAC_PUMP_REMOTE_TEMPERATURE 0x0008
  82. // Pump Settings attributes set
  83. #define ATTRID_HVAC_PUMP_OPERATION_MODE 0x0020
  84. #define ATTRID_HVAC_PUMP_CONTROL_MODE 0x0021
  85. #define ATTRID_HVAC_PUMP_ALARM_MASK 0x0022
  86. //#define ATTRID_HVAC_PUMP_CAPACITY_MIN_PERCENT_CHANGE 0x0023
  87. //#define ATTRID_HVAC_PUMP_CAPACITY_MIN_ABSOLUTE_CHANGE 0x0024
  88. /*** Operation mode attribute values ***/
  89. #define HVAC_PUMP_OPERATION_MODE_NORMAL 0x00
  90. #define HVAC_PUMP_OPERATION_MODE_MINIMUM 0x01
  91. #define HVAC_PUMP_OPERATION_MODE_MAXIMUM 0x02
  92. #define HVAC_PUMP_OPERATION_MODE_LOCAL 0x03
  93. /*** Control mode attribute values ***/
  94. #define HVAC_PUMP_CONTROL_MODE_CONSTANT_SPEED 0x00
  95. #define HVAC_PUMP_CONTROL_MODE_CONSTANT_PRESSURE 0x01
  96. #define HVAC_PUMP_CONTROL_MODE_PR0PORTIONAL_PRESSURE 0x02
  97. #define HVAC_PUMP_CONTROL_MODE_CONSTANT_FLOW 0x03
  98. #define HVAC_PUMP_CONTROL_MODE_CONSTANT_TEMPERATURE 0x05
  99. #define HVAC_PUMP_CONTROL_MODE_CONSTANT_AUTOMATIC 0x07
  100. /*** Alarm Mask attribute values ***/
  101. #define HVAC_PUMP_SUPPLY_VOLTAGE_TOO_LOW 0x0001
  102. #define HVAC_PUMP_SUPPLY_VOLTAGE_TOO_HIGH 0x0002
  103. #define HVAC_PUMP_POWER_MISSING_PHASE 0x0004
  104. #define HVAC_PUMP_SYSTEM_PRESSURE_TOO_LOW 0x0008
  105. #define HVAC_PUMP_SYSTEM_PRESSURE_TOO_HIGH 0x0010
  106. #define HVAC_PUMP_DRY_RUNNING 0x0020
  107. #define HVAC_PUMP_MOTOR_TEMPERATURE_TOO_HIGH 0x0040
  108. #define HVAC_PUMP_MOTOR_HAS_FATAL_FAILURE 0x0080
  109. #define HVAC_PUMP_ELECTRONIC_TEMPERATURE_TOO_HIGH 0x0100
  110. #define HVAC_PUMP_BLOCKED 0x0200
  111. #define HVAC_PUMP_SENSOR_FAILURE 0x0400
  112. #define HVAC_PUMP_ELECTRONIC_NON_FATAL_FAILURE 0x0800
  113. #define HVAC_PUMP_ELECTRONIC_FATAL_FAILURE 0x1000
  114. #define HVAC_PUMP_GENERAL_FAULT 0x2000
  115. // Pump Unit Table attributes set
  116. //#define ATTRID_HVAC_PUMP_POWER_UNIT 0x0030
  117. /*** Power Unit attribute values ***/
  118. //#define HVAC_PUMP_POWER_UNIT_POWER_IN_WATTS 0x00
  119. //#define HVAC_PUMP_POWER_UNIT_POWER_IN_KILOWATTS 0x01
  120. /**************************************************************************/
  121. /*** HVAC: Thermostat Cluster Attributes ***/
  122. /**************************************************************************/
  123. // Thermostat information attribute set
  124. #define ATTRID_HVAC_THERMOSTAT_LOCAL_TEMPERATURE 0x0000
  125. #define ATTRID_HVAC_THERMOSTAT_OUTDOOR_TEMPERATURE 0x0001
  126. #define ATTRID_HVAC_THERMOSTAT_OCCUPANCY 0x0002
  127. #define ATTRID_HVAC_THERMOSTAT_ABS_MIN_HEAT_SETPOINT_LIMIT 0x0003
  128. #define ATTRID_HVAC_THERMOSTAT_ABS_MAX_HEAT_SETPOINT_LIMIT 0x0004
  129. #define ATTRID_HVAC_THERMOSTAT_ABS_MIN_COOL_SETPOINT_LIMIT 0x0005
  130. #define ATTRID_HVAC_THERMOSTAT_ABS_MAX_COOL_SETPOINT_LIMIT 0x0006
  131. #define ATTRID_HVAC_THERMOSTAT_PI_COOLING_DEMAND 0x0007
  132. #define ATTRID_HVAC_THERMOSTAT_PI_HEATING_DEMAND 0x0008
  133. // Thermostat settings attribute set
  134. #define ATTRID_HVAC_THERMOSTAT_LOCAL_TEMP_CALIBRATION 0x0010
  135. #define ATTRID_HVAC_THERMOSTAT_OCCUPIED_COOLING_SETPOINT 0x0011
  136. #define ATTRID_HVAC_THERMOSTAT_OCCUPIED_HEATING_SETPOINT 0x0012
  137. #define ATTRID_HVAC_THERMOSTAT_UNOCCUPIED_COOLING_SETPOINT 0x0013
  138. #define ATTRID_HVAC_THERMOSTAT_UNOCCUPIED_HEATING_SETPOINT 0x0014
  139. #define ATTRID_HVAC_THERMOSTAT_MIN_HEAT_SETPOINT_LIMIT 0x0015
  140. #define ATTRID_HVAC_THERMOSTAT_MAX_HEAT_SETPOINT_LIMIT 0x0016
  141. #define ATTRID_HVAC_THERMOSTAT_MIN_COOL_SETPOINT_LIMIT 0x0017
  142. #define ATTRID_HVAC_THERMOSTAT_MAX_COOL_SETPOINT_LIMIT 0x0018
  143. #define ATTRID_HVAC_THERMOSTAT_MIN_SETPOINT_DEAD_BAND 0x0019
  144. #define ATTRID_HVAC_THERMOSTAT_REMOTE_SENSING 0x001A
  145. #define ATTRID_HVAC_THERMOSTAT_CTRL_SEQ_OF_OPER 0x001B
  146. #define ATTRID_HVAC_THERMOSTAT_SYSTEM_MODE 0x001C
  147. #define ATTRID_HVAC_THERMOSTAT_ALAM_MASK 0x001D
  148. /*** Remote Sensing attribute values ***/
  149. #define HVAC_THERMOSTAT_REMOTE_SENSING_LOCAL_TEMPERATURE 0x0001
  150. #define HVAC_THERMOSTAT_REMOTE_SENSING_OUTDOOR_TEMPERATURE 0x0002
  151. #define HVAC_THERMOSTAT_REMOTE_SENSING_OCCUPANCY 0x0004
  152. /*** Control Sequence of Operation attribute values ***/
  153. #define HVAC_THERMOSTAT_CTRL_SEQ_OF_OPER_COOLING_ONLY 0x00
  154. #define HVAC_THERMOSTAT_CTRL_SEQ_OF_OPER_COOLING_WITH_REHEAT 0x01
  155. #define HVAC_THERMOSTAT_CTRL_SEQ_OF_OPER_HEATING_ONLY 0x02
  156. #define HVAC_THERMOSTAT_CTRL_SEQ_OF_OPER_HEATING_WITH_REHEAT 0x03
  157. #define HVAC_THERMOSTAT_CTRL_SEQ_OF_OPER_COOLING_HEATING 0x04
  158. #define HVAC_THERMOSTAT_CTRL_SEQ_OF_OPER_COOLING_HEATING_WITH_REHEAT 0x05
  159. /*** System Mode attribute values ***/
  160. #define HVAC_THERMOSTAT_SYSTEM_MODE_OFF 0x00
  161. #define HVAC_THERMOSTAT_SYSTEM_MODE_AUTO 0x01
  162. #define HVAC_THERMOSTAT_SYSTEM_MODE_COOL 0x03
  163. #define HVAC_THERMOSTAT_SYSTEM_MODE_HEAT 0x04
  164. #define HVAC_THERMOSTAT_SYSTEM_MODE_EMERGENCY_HEATING 0x05
  165. #define HVAC_THERMOSTAT_SYSTEM_MODE_PRECOOLING 0x06
  166. #define HVAC_THERMOSTAT_SYSTEM_MODE_FAN_ONLY 0x07
  167. /*** Alarm Mask attribute values ***/
  168. #define HVAC_THERMOSTAT_INITIALIZATION_FAILURE 0x01
  169. #define HVAC_THERMOSTAT_HARDWARE_FAILURE 0x02
  170. #define HVAC_THERMOSTAT_SELF_CALIBRATION_FAILURE 0x03
  171. // command IDs received by Server
  172. #define COMMAND_THERMOSTAT_SETPOINT_RAISE_LOWER 0x00
  173. // Mode field values for the setpoint raise/lower command
  174. #define HVAC_THERMOSTAT_MODE_HEAT 0x00
  175. #define HVAC_THERMOSTAT_MODE_COOL 0x01
  176. #define HVAC_THERMOSTAT_MODE_BOTH 0x02
  177. /**************************************************************************/
  178. /*** HVAC: Fan Control Cluster Attributes ***/
  179. /**************************************************************************/
  180. // Fan Control attribute set
  181. #define ATTRID_HVAC_FAN_CTRL_FAN_MODE 0x0000
  182. #define ATTRID_HVAC_FAN_CTRL_FAN_SEQUENCE 0x0001
  183. /*** Fan Mode attribute values ***/
  184. #define HVAC_FAN_CTRL_FAN_MODE_OFF 0x00
  185. #define HVAC_FAN_CTRL_FAN_MODE_LOW 0x01
  186. #define HVAC_FAN_CTRL_FAN_MODE_MEDIUM 0x02
  187. #define HVAC_FAN_CTRL_FAN_MODE_HIGH 0x03
  188. #define HVAC_FAN_CTRL_FAN_MODE_ON 0x04
  189. #define HVAC_FAN_CTRL_FAN_MODE_AUTO 0x05
  190. #define HVAC_FAN_CTRL_FAN_MODE_SMART 0x06
  191. /*** Fan Mode Sequence attribute values ***/
  192. #define HVAC_FAN_CTRL_FAN_MODE_SEQ_LOW_MED_HI 0x00
  193. #define HVAC_FAN_CTRL_FAN_MODE_SEQ_LOW_HI 0x01
  194. #define HVAC_FAN_CTRL_FAN_MODE_SEQ_LOW_MED_HI_AUTO 0x02
  195. #define HVAC_FAN_CTRL_FAN_MODE_SEQ_LOW_HI_AUTO 0x03
  196. #define HVAC_FAN_CTRL_FAN_MODE_SEQ_ON_AUTO 0x04
  197. /**************************************************************************/
  198. /*** HVAC: Dehumidifcation Control Cluster Attributes ***/
  199. /**************************************************************************/
  200. // Dehumidifcation Control Information attribute set
  201. #define ATTRID_HVAC_DEHUMIDIFICATION_CTRL_RELATIVE_HUMIDITY 0x0000
  202. #define ATTRID_HVAC_DEHUMIDIFICATION_CTRL_DEHUMID_COOLING 0x0001
  203. // Dehumidifcation Control Settings attribute set
  204. #define ATTRID_HVAC_DEHUMIDIFICATION_CTRL_RHDEHUMID_SETPOINT 0x0010
  205. #define ATTRID_HVAC_DEHUMIDIFICATION_CTRL_RELATIVE_HUMIDITY_MODE 0x0011
  206. #define ATTRID_HVAC_DEHUMIDIFICATION_CTRL_DEHUMID_LOCKOUT 0x0012
  207. #define ATTRID_HVAC_DEHUMIDIFICATION_CTRL_DEHUMID_HYSTERESIS 0x0013
  208. #define ATTRID_HVAC_DEHUMIDIFICATION_CTRL_DEHUMID_MAX_COOL 0x0014
  209. #define ATTRID_HVAC_DEHUMIDIFICATION_CTRL_RELATIVE_HUMIDITY_DISPLAY 0x0015
  210. /*** Relative Humidity Mode attribute values ***/
  211. #define HVAC_DEHUMIDIFICATION_CTRL_RELATIVE_HUMIDITY_MEASURED_LOCALLY 0x00
  212. #define HVAC_DEHUMIDIFICATION_CTRL_RELATIVE_HUMIDITY_UPDATED_OVER_NET 0x00
  213. /*** Dehumidification Lockout attribute values ***/
  214. #define HVAC_DEHUMIDIFICATION_CTRL_DEHIMID_NOT_ALLOWED 0x00
  215. #define HVAC_DEHUMIDIFICATION_CTRL_DEHIMID_ALLOWED 0x01
  216. /*** Relative Humidity Display attribute values ***/
  217. #define HVAC_DEHUMIDIFICATION_CTRL_RELATIVE_HUMIDITY_NOT_DISPLAYED 0x00
  218. #define HVAC_DEHUMIDIFICATION_CTRL_RELATIVE_HUMIDITY_DISPLAYED 0x01
  219. /**************************************************************************/
  220. /*** HVAC: Thermostat User Interface Config Cluster Attributes ***/
  221. /**************************************************************************/
  222. // Thermostat User Interface Config attribute set
  223. #define ATTRID_HVAC_THERMOSTAT_UI_CONFIG_TEMP_DISPLAY_MODE 0x0000
  224. #define ATTRID_HVAC_THERMOSTAT_UI_CONFIG_KEYPAD_LOCKOUT 0x0001
  225. /*** Display Mode attribute values ***/
  226. #define ATTRID_HVAC_THERMOSTAT_UI_CONFIG_DISPLAY_MODE_IN_C 0x00
  227. #define ATTRID_HVAC_THERMOSTAT_UI_CONFIG_DISPLAY_MODE_IN_F 0x01
  228. /*** Keypad Lockout attribute values ***/
  229. #define ATTRID_HVAC_THERMOSTAT_UI_KEYPAD_NO_LOCOUT 0x00
  230. #define ATTRID_HVAC_THERMOSTAT_UI_KEYPAD_LEVEL1_LOCOUT 0x01
  231. #define ATTRID_HVAC_THERMOSTAT_UI_KEYPAD_LEVEL2_LOCOUT 0x02
  232. #define ATTRID_HVAC_THERMOSTAT_UI_KEYPAD_LEVEL3_LOCOUT 0x03
  233. #define ATTRID_HVAC_THERMOSTAT_UI_KEYPAD_LEVEL4_LOCOUT 0x04
  234. #define ATTRID_HVAC_THERMOSTAT_UI_KEYPAD_LEVEL5_LOCOUT 0x05
  235. /*********************************************************************
  236. * VARIABLES
  237. */
  238. /*********************************************************************
  239. * MACROS
  240. */
  241. /*********************************************************************
  242. * TYPEDEFS
  243. */
  244. /*** ZCL HVAC Thermostat Cluster: Setpoint Raise/Lower Cmd payload ***/
  245. typedef struct
  246. {
  247. uint8 mode; // which setpoint is to be configured
  248. int8 amount; // amount setpoint(s) are to be increased (or decreased) by, in steps of 0.1°C
  249. } zclCmdThermostatSetpointRaiseLowerPayload_t;
  250. // This callback is called to process a Setpoint Raise/Lower command
  251. // mode - which setpoint to be configured
  252. // amount - the amount the setpoints are to be increased (or decreased) by, in steps of 0.1°C
  253. typedef void (*zclHVAC_SetpointRaiseLower_t)( zclCmdThermostatSetpointRaiseLowerPayload_t *pCmd );
  254. // Register Callbacks table entry - enter function pointers for callbacks that
  255. // the application would like to receive
  256. typedef struct
  257. {
  258. zclHVAC_SetpointRaiseLower_t pfnHVAC_SetpointRaiseLower;
  259. } zclHVAC_AppCallbacks_t;
  260. /*********************************************************************
  261. * VARIABLES
  262. */
  263. /*********************************************************************
  264. * FUNCTIONS
  265. */
  266. /*
  267. * Register for callbacks from this cluster library
  268. */
  269. extern ZStatus_t zclHVAC_RegisterCmdCallbacks( uint8 endpoint, zclHVAC_AppCallbacks_t *callbacks );
  270. /*
  271. * Send a Setpoint Raise/Lower Command
  272. */
  273. ZStatus_t zclHVAC_SendSetpointRaiseLower( uint8 srcEP, afAddrType_t *dstAddr,
  274. uint8 mode, int8 amount,
  275. uint8 disableDefaultRsp, uint8 seqNum );
  276. /*********************************************************************
  277. *********************************************************************/
  278. #ifdef __cplusplus
  279. }
  280. #endif
  281. #endif /* ZCL_HVAC_H */