From 86eeacbf4e31aaeaa7a72def27d524704556fb63 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Sun, 15 Mar 2020 14:27:15 +0100 Subject: [PATCH 1/2] Zigbee move all strings to PMEM --- tasmota/my_user_config.h | 2 +- tasmota/xdrv_23_zigbee_0_constants.ino | 109 ++-- tasmota/xdrv_23_zigbee_5_converters.ino | 618 ++++++++++++---------- tasmota/xdrv_23_zigbee_6_commands.ino | 143 ++--- tasmota/xdrv_23_zigbee_7_statemachine.ino | 1 + tasmota/xdrv_23_zigbee_9_impl.ino | 4 + 6 files changed, 513 insertions(+), 364 deletions(-) diff --git a/tasmota/my_user_config.h b/tasmota/my_user_config.h index a65924cdf..d44cdea3c 100644 --- a/tasmota/my_user_config.h +++ b/tasmota/my_user_config.h @@ -612,7 +612,7 @@ #define IR_RCV_MIN_UNKNOWN_SIZE 6 // Set the smallest sized "UNKNOWN" message packets we actually care about (default 6, max 255) // -- Zigbee interface ---------------------------- -//#define USE_ZIGBEE // Enable serial communication with Zigbee CC2530 flashed with ZNP (+35k code, +3.2k mem) +//#define USE_ZIGBEE // Enable serial communication with Zigbee CC2530 flashed with ZNP (+49k code, +3k mem) #define USE_ZIGBEE_PANID 0x1A63 // arbitrary PAN ID for Zigbee network, must be unique in the home #define USE_ZIGBEE_EXTPANID 0xCCCCCCCCCCCCCCCCL // arbitrary extended PAN ID #define USE_ZIGBEE_CHANNEL 11 // Zigbee Channel (11-26) diff --git a/tasmota/xdrv_23_zigbee_0_constants.ino b/tasmota/xdrv_23_zigbee_0_constants.ino index c4e76c136..c49f914b4 100644 --- a/tasmota/xdrv_23_zigbee_0_constants.ino +++ b/tasmota/xdrv_23_zigbee_0_constants.ino @@ -385,6 +385,9 @@ enum ZCL_Global_Commands { }; +#define ZF(s) static const char ZS_ ## s[] PROGMEM = #s; +#define Z(s) ZS_ ## s + const uint16_t Z_ProfileIds[] PROGMEM = { 0x0104, 0x0109, 0xA10E, 0xC05E }; const char Z_ProfileNames[] PROGMEM = "ZigBee Home Automation|ZigBee Smart Energy|ZigBee Green Power|ZigBee Light Link"; @@ -393,42 +396,78 @@ typedef struct Z_StatusLine { const char * status_msg; } Z_StatusLine; +ZF(SUCCESS) +ZF(FAILURE) +ZF(NOT_AUTHORIZED) +ZF(RESERVED_FIELD_NOT_ZERO) +ZF(MALFORMED_COMMAND) +ZF(UNSUP_CLUSTER_COMMAND) +ZF(UNSUP_GENERAL_COMMAND) +ZF(UNSUP_MANUF_CLUSTER_COMMAND) +ZF(UNSUP_MANUF_GENERAL_COMMAND) +ZF(INVALID_FIELD) +ZF(UNSUPPORTED_ATTRIBUTE) +ZF(INVALID_VALUE) +ZF(READ_ONLY) +ZF(INSUFFICIENT_SPACE) +ZF(DUPLICATE_EXISTS) +ZF(NOT_FOUND) +ZF(UNREPORTABLE_ATTRIBUTE) +ZF(INVALID_DATA_TYPE) +ZF(INVALID_SELECTOR) +ZF(WRITE_ONLY) +ZF(INCONSISTENT_STARTUP_STATE) +ZF(DEFINED_OUT_OF_BAND) +ZF(INCONSISTENT) +ZF(ACTION_DENIED) +ZF(TIMEOUT) +ZF(ABORT) +ZF(INVALID_IMAGE) +ZF(WAIT_FOR_DATA) +ZF(NO_IMAGE_AVAILABLE) +ZF(REQUIRE_MORE_IMAGE) +ZF(NOTIFICATION_PENDING) +ZF(HARDWARE_FAILURE) +ZF(SOFTWARE_FAILURE) +ZF(CALIBRATION_ERROR) +ZF(UNSUPPORTED_CLUSTER) + const Z_StatusLine Z_Status[] PROGMEM = { - 0x00, "SUCCESS", - 0x01, "FAILURE", - 0x7E, "NOT_AUTHORIZED", - 0x7F, "RESERVED_FIELD_NOT_ZERO", - 0x80, "MALFORMED_COMMAND", - 0x81, "UNSUP_CLUSTER_COMMAND", - 0x82, "UNSUP_GENERAL_COMMAND", - 0x83, "UNSUP_MANUF_CLUSTER_COMMAND", - 0x84, "UNSUP_MANUF_GENERAL_COMMAND", - 0x85, "INVALID_FIELD", - 0x86, "UNSUPPORTED_ATTRIBUTE", - 0x87, "INVALID_VALUE", - 0x88, "READ_ONLY", - 0x89, "INSUFFICIENT_SPACE", - 0x8A, "DUPLICATE_EXISTS", - 0x8B, "NOT_FOUND", - 0x8C, "UNREPORTABLE_ATTRIBUTE", - 0x8D, "INVALID_DATA_TYPE", - 0x8E, "INVALID_SELECTOR", - 0x8F, "WRITE_ONLY", - 0x90, "INCONSISTENT_STARTUP_STATE", - 0x91, "DEFINED_OUT_OF_BAND", - 0x92, "INCONSISTENT", - 0x93, "ACTION_DENIED", - 0x94, "TIMEOUT", - 0x95, "ABORT", - 0x96, "INVALID_IMAGE", - 0x97, "WAIT_FOR_DATA", - 0x98, "NO_IMAGE_AVAILABLE", - 0x99, "REQUIRE_MORE_IMAGE", - 0x9A, "NOTIFICATION_PENDING", - 0xC0, "HARDWARE_FAILURE", - 0xC1, "SOFTWARE_FAILURE", - 0xC2, "CALIBRATION_ERROR", - 0xC3, "UNSUPPORTED_CLUSTER", + 0x00, Z(SUCCESS), + 0x01, Z(FAILURE), + 0x7E, Z(NOT_AUTHORIZED), + 0x7F, Z(RESERVED_FIELD_NOT_ZERO), + 0x80, Z(MALFORMED_COMMAND), + 0x81, Z(UNSUP_CLUSTER_COMMAND), + 0x82, Z(UNSUP_GENERAL_COMMAND), + 0x83, Z(UNSUP_MANUF_CLUSTER_COMMAND), + 0x84, Z(UNSUP_MANUF_GENERAL_COMMAND), + 0x85, Z(INVALID_FIELD), + 0x86, Z(UNSUPPORTED_ATTRIBUTE), + 0x87, Z(INVALID_VALUE), + 0x88, Z(READ_ONLY), + 0x89, Z(INSUFFICIENT_SPACE), + 0x8A, Z(DUPLICATE_EXISTS), + 0x8B, Z(NOT_FOUND), + 0x8C, Z(UNREPORTABLE_ATTRIBUTE), + 0x8D, Z(INVALID_DATA_TYPE), + 0x8E, Z(INVALID_SELECTOR), + 0x8F, Z(WRITE_ONLY), + 0x90, Z(INCONSISTENT_STARTUP_STATE), + 0x91, Z(DEFINED_OUT_OF_BAND), + 0x92, Z(INCONSISTENT), + 0x93, Z(ACTION_DENIED), + 0x94, Z(TIMEOUT), + 0x95, Z(ABORT), + 0x96, Z(INVALID_IMAGE), + 0x97, Z(WAIT_FOR_DATA), + 0x98, Z(NO_IMAGE_AVAILABLE), + 0x99, Z(REQUIRE_MORE_IMAGE), + 0x9A, Z(NOTIFICATION_PENDING), + 0xC0, Z(HARDWARE_FAILURE), + 0xC1, Z(SOFTWARE_FAILURE), + 0xC2, Z(CALIBRATION_ERROR), + 0xC3, Z(UNSUPPORTED_CLUSTER), }; const __FlashStringHelper* getZigbeeStatusMessage(uint8_t status) { diff --git a/tasmota/xdrv_23_zigbee_5_converters.ino b/tasmota/xdrv_23_zigbee_5_converters.ino index 1893ba671..b7c5829ac 100644 --- a/tasmota/xdrv_23_zigbee_5_converters.ino +++ b/tasmota/xdrv_23_zigbee_5_converters.ino @@ -545,331 +545,419 @@ typedef struct Z_AttributeConverter { Z_AttrConverter func; } Z_AttributeConverter; +ZF(ZCLVersion) ZF(AppVersion) ZF(StackVersion) ZF(HWVersion) ZF(Manufacturer) ZF(ModelId) +ZF(DateCode) ZF(PowerSource) ZF(SWBuildID) ZF(Power) ZF(SwitchType) ZF(Dimmer) +ZF(MainsVoltage) ZF(MainsFrequency) ZF(BatteryVoltage) ZF(BatteryPercentage) +ZF(CurrentTemperature) ZF(MinTempExperienced) ZF(MaxTempExperienced) ZF(OverTempTotalDwell) +ZF(AlarmCount) ZF(Time) ZF(TimeStatus) ZF(TimeZone) ZF(DstStart) ZF(DstEnd) +ZF(DstShift) ZF(StandardTime) ZF(LocalTime) ZF(LastSetTime) ZF(ValidUntilTime) + +ZF(LocationType) ZF(LocationMethod) ZF(LocationAge) ZF(QualityMeasure) ZF(NumberOfDevices) + +ZF(AnalogInActiveText) ZF(AnalogInDescription) ZF(AnalogInInactiveText) ZF(AnalogInMaxValue) +ZF(AnalogInMinValue) ZF(AnalogInOutOfService) ZF(AqaraRotate) ZF(AnalogInPriorityArray) +ZF(AnalogInReliability) ZF(AnalogInRelinquishDefault) ZF(AnalogInResolution) ZF(AnalogInStatusFlags) +ZF(AnalogInEngineeringUnits) ZF(AnalogInApplicationType) ZF(Aqara_FF05) + +ZF(AnalogOutDescription) ZF(AnalogOutMaxValue) ZF(AnalogOutMinValue) ZF(AnalogOutOutOfService) +ZF(AnalogOutValue) ZF(AnalogOutPriorityArray) ZF(AnalogOutReliability) ZF(AnalogOutRelinquishDefault) +ZF(AnalogOutResolution) ZF(AnalogOutStatusFlags) ZF(AnalogOutEngineeringUnits) ZF(AnalogOutApplicationType) + +ZF(AnalogDescription) ZF(AnalogOutOfService) ZF(AnalogValue) ZF(AnalogPriorityArray) ZF(AnalogReliability) +ZF(AnalogRelinquishDefault) ZF(AnalogStatusFlags) ZF(AnalogEngineeringUnits) ZF(AnalogApplicationType) + +ZF(BinaryInActiveText) ZF(BinaryInDescription) ZF(BinaryInInactiveText) ZF(BinaryInOutOfService) +ZF(BinaryInPolarity) ZF(BinaryInValue) ZF(BinaryInPriorityArray) ZF(BinaryInReliability) +ZF(BinaryInStatusFlags) ZF(BinaryInApplicationType) + +ZF(BinaryOutActiveText) ZF(BinaryOutDescription) ZF(BinaryOutInactiveText) ZF(BinaryOutMinimumOffTime) +ZF(BinaryOutMinimumOnTime) ZF(BinaryOutOutOfService) ZF(BinaryOutPolarity) ZF(BinaryOutValue) +ZF(BinaryOutPriorityArray) ZF(BinaryOutReliability) ZF(BinaryOutRelinquishDefault) ZF(BinaryOutStatusFlags) +ZF(BinaryOutApplicationType) + +ZF(BinaryActiveText) ZF(BinaryDescription) ZF(BinaryInactiveText) ZF(BinaryMinimumOffTime) +ZF(BinaryMinimumOnTime) ZF(BinaryOutOfService) ZF(BinaryValue) ZF(BinaryPriorityArray) ZF(BinaryReliability) +ZF(BinaryRelinquishDefault) ZF(BinaryStatusFlags) ZF(BinaryApplicationType) + +ZF(MultiInStateText) ZF(MultiInDescription) ZF(MultiInNumberOfStates) ZF(MultiInOutOfService) +ZF(MultiInValue) ZF(MultiInReliability) ZF(MultiInStatusFlags) ZF(MultiInApplicationType) + +ZF(MultiOutStateText) ZF(MultiOutDescription) ZF(MultiOutNumberOfStates) ZF(MultiOutOutOfService) +ZF(MultiOutValue) ZF(MultiOutPriorityArray) ZF(MultiOutReliability) ZF(MultiOutRelinquishDefault) +ZF(MultiOutStatusFlags) ZF(MultiOutApplicationType) + +ZF(MultiStateText) ZF(MultiDescription) ZF(MultiNumberOfStates) ZF(MultiOutOfService) ZF(MultiValue) +ZF(MultiReliability) ZF(MultiRelinquishDefault) ZF(MultiStatusFlags) ZF(MultiApplicationType) + +ZF(TotalProfileNum) ZF(MultipleScheduling) ZF(EnergyFormatting) ZF(EnergyRemote) ZF(ScheduleMode) + +ZF(CheckinInterval) ZF(LongPollInterval) ZF(ShortPollInterval) ZF(FastPollTimeout) ZF(CheckinIntervalMin) +ZF(LongPollIntervalMin) ZF(FastPollTimeoutMax) + +ZF(PhysicalClosedLimit) ZF(MotorStepSize) ZF(Status) ZF(ClosedLimit) ZF(Mode) + +ZF(LockState) ZF(LockType) ZF(ActuatorEnabled) ZF(DoorState) ZF(DoorOpenEvents) +ZF(DoorClosedEvents) ZF(OpenPeriod) + +ZF(AqaraVibrationMode) ZF(AqaraVibrationsOrAngle) ZF(AqaraVibration505) ZF(AqaraAccelerometer) + +ZF(WindowCoveringType) ZF(PhysicalClosedLimitLift) ZF(PhysicalClosedLimitTilt) ZF(CurrentPositionLift) +ZF(CurrentPositionTilt) ZF(NumberofActuationsLift) ZF(NumberofActuationsTilt) ZF(ConfigStatus) +ZF(CurrentPositionLiftPercentage) ZF(CurrentPositionTiltPercentage) ZF(InstalledOpenLimitLift) +ZF(InstalledClosedLimitLift) ZF(InstalledOpenLimitTilt) ZF(InstalledClosedLimitTilt) ZF(VelocityLift) +ZF(AccelerationTimeLift) ZF(DecelerationTimeLift) ZF(IntermediateSetpointsLift) +ZF(IntermediateSetpointsTilt) + +ZF(Hue) ZF(Sat) ZF(RemainingTime) ZF(X) ZF(Y) ZF(DriftCompensation) ZF(CompensationText) ZF(CT) +ZF(ColorMode) ZF(NumberOfPrimaries) ZF(Primary1X) ZF(Primary1Y) ZF(Primary1Intensity) ZF(Primary2X) +ZF(Primary2Y) ZF(Primary2Intensity) ZF(Primary3X) ZF(Primary3Y) ZF(Primary3Intensity) ZF(WhitePointX) +ZF(WhitePointY) ZF(ColorPointRX) ZF(ColorPointRY) ZF(ColorPointRIntensity) ZF(ColorPointGX) ZF(ColorPointGY) +ZF(ColorPointGIntensity) ZF(ColorPointBX) ZF(ColorPointBY) ZF(ColorPointBIntensity) + +ZF(Illuminance) ZF(IlluminanceMinMeasuredValue) ZF(IlluminanceMaxMeasuredValue) ZF(IlluminanceTolerance) +ZF(IlluminanceLightSensorType) ZF(IlluminanceLevelStatus) + +ZF(Temperature) ZF(TemperatureMinMeasuredValue) ZF(TemperatureMaxMeasuredValue) ZF(TemperatureTolerance) + +ZF(PressureUnit) ZF(Pressure) ZF(PressureMinMeasuredValue) ZF(PressureMaxMeasuredValue) ZF(PressureTolerance) +ZF(PressureScaledValue) ZF(PressureMinScaledValue) ZF(PressureMaxScaledValue) ZF(PressureScaledTolerance) +ZF(PressureScale) + +ZF(FlowRate) ZF(FlowMinMeasuredValue) ZF(FlowMaxMeasuredValue) ZF(FlowTolerance) + +ZF(Humidity) ZF(HumidityMinMeasuredValue) ZF(HumidityMaxMeasuredValue) ZF(HumidityTolerance) + +ZF(Occupancy) ZF(OccupancySensorType) + +ZF(CompanyName) ZF(MeterTypeID) ZF(DataQualityID) ZF(CustomerName) ZF(Model) ZF(PartNumber) +ZF(SoftwareRevision) ZF(POD) ZF(AvailablePower) ZF(PowerThreshold) + +ZF(NumberOfResets) ZF(PersistentMemoryWrites) ZF(LastMessageLQI) ZF(LastMessageRSSI) // list of post-processing directives const Z_AttributeConverter Z_PostProcess[] PROGMEM = { - { 0x0000, 0x0000, "ZCLVersion", &Z_Copy }, - { 0x0000, 0x0001, "AppVersion", &Z_Copy }, - { 0x0000, 0x0002, "StackVersion", &Z_Copy }, - { 0x0000, 0x0003, "HWVersion", &Z_Copy }, - { 0x0000, 0x0004, "Manufacturer", &Z_ManufKeep }, // record Manufacturer - { 0x0000, 0x0005, D_JSON_MODEL D_JSON_ID, &Z_ModelKeep }, // record Model - { 0x0000, 0x0006, "DateCode", &Z_Copy }, - { 0x0000, 0x0007, "PowerSource", &Z_Copy }, - { 0x0000, 0x4000, "SWBuildID", &Z_Copy }, + { 0x0000, 0x0000, Z(ZCLVersion), &Z_Copy }, + { 0x0000, 0x0001, Z(AppVersion), &Z_Copy }, + { 0x0000, 0x0002, Z(StackVersion), &Z_Copy }, + { 0x0000, 0x0003, Z(HWVersion), &Z_Copy }, + { 0x0000, 0x0004, Z(Manufacturer), &Z_ManufKeep }, // record Manufacturer + { 0x0000, 0x0005, Z(ModelId), &Z_ModelKeep }, // record Model + { 0x0000, 0x0006, Z(DateCode), &Z_Copy }, + { 0x0000, 0x0007, Z(PowerSource), &Z_Copy }, + { 0x0000, 0x4000, Z(SWBuildID), &Z_Copy }, { 0x0000, 0xFFFF, nullptr, &Z_Remove }, // Remove all other values // Cmd 0x0A - Cluster 0x0000, attribute 0xFF01 - proprietary { 0x0000, 0xFF01, nullptr, &Z_AqaraSensor }, // Occupancy (map8) // Power Configuration cluster - { 0x0001, 0x0000, "MainsVoltage", &Z_Copy }, - { 0x0001, 0x0001, "MainsFrequency", &Z_Copy }, - { 0x0001, 0x0020, "BatteryVoltage", &Z_FloatDiv10 }, - { 0x0001, 0x0021, "BatteryPercentage", &Z_Copy }, + { 0x0001, 0x0000, Z(MainsVoltage), &Z_Copy }, + { 0x0001, 0x0001, Z(MainsFrequency), &Z_Copy }, + { 0x0001, 0x0020, Z(BatteryVoltage), &Z_FloatDiv10 }, + { 0x0001, 0x0021, Z(BatteryPercentage), &Z_Copy }, // Device Temperature Configuration cluster - { 0x0002, 0x0000, "CurrentTemperature", &Z_Copy }, - { 0x0002, 0x0001, "MinTempExperienced", &Z_Copy }, - { 0x0002, 0x0002, "MaxTempExperienced", &Z_Copy }, - { 0x0002, 0x0003, "OverTempTotalDwell", &Z_Copy }, + { 0x0002, 0x0000, Z(CurrentTemperature), &Z_Copy }, + { 0x0002, 0x0001, Z(MinTempExperienced), &Z_Copy }, + { 0x0002, 0x0002, Z(MaxTempExperienced), &Z_Copy }, + { 0x0002, 0x0003, Z(OverTempTotalDwell), &Z_Copy }, // On/off cluster - { 0x0006, 0x0000, "Power", &Z_Copy }, - { 0x0006, 0x8000, "Power", &Z_Copy }, // See 7280 + { 0x0006, 0x0000, Z(Power), &Z_Copy }, + { 0x0006, 0x8000, Z(Power), &Z_Copy }, // See 7280 // On/Off Switch Configuration cluster - { 0x0007, 0x0000, "SwitchType", &Z_Copy }, + { 0x0007, 0x0000, Z(SwitchType), &Z_Copy }, // Level Control cluster - { 0x0008, 0x0000, "Dimmer", &Z_Copy }, - // { 0x0008, 0x0001, "RemainingTime", &Z_Copy }, - // { 0x0008, 0x0010, "OnOffTransitionTime", &Z_Copy }, - // { 0x0008, 0x0011, "OnLevel", &Z_Copy }, - // { 0x0008, 0x0012, "OnTransitionTime", &Z_Copy }, - // { 0x0008, 0x0013, "OffTransitionTime", &Z_Copy }, - // { 0x0008, 0x0014, "DefaultMoveRate", &Z_Copy }, + { 0x0008, 0x0000, Z(Dimmer), &Z_Copy }, + // { 0x0008, 0x0001, Z(RemainingTime", &Z_Copy }, + // { 0x0008, 0x0010, Z(OnOffTransitionTime", &Z_Copy }, + // { 0x0008, 0x0011, Z(OnLevel", &Z_Copy }, + // { 0x0008, 0x0012, Z(OnTransitionTime", &Z_Copy }, + // { 0x0008, 0x0013, Z(OffTransitionTime", &Z_Copy }, + // { 0x0008, 0x0014, Z(DefaultMoveRate", &Z_Copy }, // Alarms cluster - { 0x0009, 0x0000, "AlarmCount", &Z_Copy }, + { 0x0009, 0x0000, Z(AlarmCount), &Z_Copy }, // Time cluster - { 0x000A, 0x0000, "Time", &Z_Copy }, - { 0x000A, 0x0001, "TimeStatus", &Z_Copy }, - { 0x000A, 0x0002, "TimeZone", &Z_Copy }, - { 0x000A, 0x0003, "DstStart", &Z_Copy }, - { 0x000A, 0x0004, "DstStart", &Z_Copy }, - { 0x000A, 0x0005, "DstShift", &Z_Copy }, - { 0x000A, 0x0006, "StandardTime", &Z_Copy }, - { 0x000A, 0x0007, "LocalTime", &Z_Copy }, - { 0x000A, 0x0008, "LastSetTime", &Z_Copy }, - { 0x000A, 0x0009, "ValidUntilTime", &Z_Copy }, + { 0x000A, 0x0000, Z(Time), &Z_Copy }, + { 0x000A, 0x0001, Z(TimeStatus), &Z_Copy }, + { 0x000A, 0x0002, Z(TimeZone), &Z_Copy }, + { 0x000A, 0x0003, Z(DstStart), &Z_Copy }, + { 0x000A, 0x0004, Z(DstEnd), &Z_Copy }, + { 0x000A, 0x0005, Z(DstShift), &Z_Copy }, + { 0x000A, 0x0006, Z(StandardTime), &Z_Copy }, + { 0x000A, 0x0007, Z(LocalTime), &Z_Copy }, + { 0x000A, 0x0008, Z(LastSetTime), &Z_Copy }, + { 0x000A, 0x0009, Z(ValidUntilTime), &Z_Copy }, // RSSI Location cluster - { 0x000B, 0x0000, "LocationType", &Z_Copy }, - { 0x000B, 0x0000, "LocationMethod", &Z_Copy }, - { 0x000B, 0x0000, "LocationAge", &Z_Copy }, - { 0x000B, 0x0000, "QualityMeasure", &Z_Copy }, - { 0x000B, 0x0000, "NumberOfDevices", &Z_Copy }, + { 0x000B, 0x0000, Z(LocationType), &Z_Copy }, + { 0x000B, 0x0000, Z(LocationMethod), &Z_Copy }, + { 0x000B, 0x0000, Z(LocationAge), &Z_Copy }, + { 0x000B, 0x0000, Z(QualityMeasure), &Z_Copy }, + { 0x000B, 0x0000, Z(NumberOfDevices), &Z_Copy }, // Analog Input cluster - { 0x000C, 0x0004, "AnalogInActiveText", &Z_Copy }, - { 0x000C, 0x001C, "AnalogInDescription", &Z_Copy }, - { 0x000C, 0x002E, "AnalogInInactiveText", &Z_Copy }, - { 0x000C, 0x0041, "AnalogInMaxValue", &Z_Copy }, - { 0x000C, 0x0045, "AnalogInMinValue", &Z_Copy }, - { 0x000C, 0x0051, "AnalogInOutOfService", &Z_Copy }, - { 0x000C, 0x0055, "AqaraRotate", &Z_Copy }, - { 0x000C, 0x0057, "AnalogInPriorityArray",&Z_Copy }, - { 0x000C, 0x0067, "AnalogInReliability", &Z_Copy }, - { 0x000C, 0x0068, "AnalogInRelinquishDefault",&Z_Copy }, - { 0x000C, 0x006A, "AnalogInResolution", &Z_Copy }, - { 0x000C, 0x006F, "AnalogInStatusFlags", &Z_Copy }, - { 0x000C, 0x0075, "AnalogInEngineeringUnits",&Z_Copy }, - { 0x000C, 0x0100, "AnalogInApplicationType",&Z_Copy }, - { 0x000C, 0xFF05, "Aqara_FF05", &Z_Copy }, + { 0x000C, 0x0004, Z(AnalogInActiveText), &Z_Copy }, + { 0x000C, 0x001C, Z(AnalogInDescription), &Z_Copy }, + { 0x000C, 0x002E, Z(AnalogInInactiveText), &Z_Copy }, + { 0x000C, 0x0041, Z(AnalogInMaxValue), &Z_Copy }, + { 0x000C, 0x0045, Z(AnalogInMinValue), &Z_Copy }, + { 0x000C, 0x0051, Z(AnalogInOutOfService), &Z_Copy }, + { 0x000C, 0x0055, Z(AqaraRotate), &Z_Copy }, + { 0x000C, 0x0057, Z(AnalogInPriorityArray),&Z_Copy }, + { 0x000C, 0x0067, Z(AnalogInReliability), &Z_Copy }, + { 0x000C, 0x0068, Z(AnalogInRelinquishDefault),&Z_Copy }, + { 0x000C, 0x006A, Z(AnalogInResolution), &Z_Copy }, + { 0x000C, 0x006F, Z(AnalogInStatusFlags), &Z_Copy }, + { 0x000C, 0x0075, Z(AnalogInEngineeringUnits),&Z_Copy }, + { 0x000C, 0x0100, Z(AnalogInApplicationType),&Z_Copy }, + { 0x000C, 0xFF05, Z(Aqara_FF05), &Z_Copy }, // Analog Output cluster - { 0x000D, 0x001C, "AnalogOutDescription", &Z_Copy }, - { 0x000D, 0x0041, "AnalogOutMaxValue", &Z_Copy }, - { 0x000D, 0x0045, "AnalogOutMinValue", &Z_Copy }, - { 0x000D, 0x0051, "AnalogOutOutOfService",&Z_Copy }, - { 0x000D, 0x0055, "AnalogOutValue", &Z_Copy }, - { 0x000D, 0x0057, "AnalogOutPriorityArray",&Z_Copy }, - { 0x000D, 0x0067, "AnalogOutReliability", &Z_Copy }, - { 0x000D, 0x0068, "AnalogOutRelinquishDefault",&Z_Copy }, - { 0x000D, 0x006A, "AnalogOutResolution", &Z_Copy }, - { 0x000D, 0x006F, "AnalogOutStatusFlags", &Z_Copy }, - { 0x000D, 0x0075, "AnalogOutEngineeringUnits",&Z_Copy }, - { 0x000D, 0x0100, "AnalogOutApplicationType",&Z_Copy }, + { 0x000D, 0x001C, Z(AnalogOutDescription), &Z_Copy }, + { 0x000D, 0x0041, Z(AnalogOutMaxValue), &Z_Copy }, + { 0x000D, 0x0045, Z(AnalogOutMinValue), &Z_Copy }, + { 0x000D, 0x0051, Z(AnalogOutOutOfService),&Z_Copy }, + { 0x000D, 0x0055, Z(AnalogOutValue), &Z_Copy }, + { 0x000D, 0x0057, Z(AnalogOutPriorityArray),&Z_Copy }, + { 0x000D, 0x0067, Z(AnalogOutReliability), &Z_Copy }, + { 0x000D, 0x0068, Z(AnalogOutRelinquishDefault),&Z_Copy }, + { 0x000D, 0x006A, Z(AnalogOutResolution), &Z_Copy }, + { 0x000D, 0x006F, Z(AnalogOutStatusFlags), &Z_Copy }, + { 0x000D, 0x0075, Z(AnalogOutEngineeringUnits),&Z_Copy }, + { 0x000D, 0x0100, Z(AnalogOutApplicationType),&Z_Copy }, // Analog Value cluster - { 0x000E, 0x001C, "AnalogDescription", &Z_Copy }, - { 0x000E, 0x0051, "AnalogOutOfService", &Z_Copy }, - { 0x000E, 0x0055, "AnalogValue", &Z_Copy }, - { 0x000E, 0x0057, "AnalogPriorityArray", &Z_Copy }, - { 0x000E, 0x0067, "AnalogReliability", &Z_Copy }, - { 0x000E, 0x0068, "AnalogRelinquishDefault",&Z_Copy }, - { 0x000E, 0x006F, "AnalogStatusFlags", &Z_Copy }, - { 0x000E, 0x0075, "AnalogEngineeringUnits",&Z_Copy }, - { 0x000E, 0x0100, "AnalogApplicationType",&Z_Copy }, + { 0x000E, 0x001C, Z(AnalogDescription), &Z_Copy }, + { 0x000E, 0x0051, Z(AnalogOutOfService), &Z_Copy }, + { 0x000E, 0x0055, Z(AnalogValue), &Z_Copy }, + { 0x000E, 0x0057, Z(AnalogPriorityArray), &Z_Copy }, + { 0x000E, 0x0067, Z(AnalogReliability), &Z_Copy }, + { 0x000E, 0x0068, Z(AnalogRelinquishDefault),&Z_Copy }, + { 0x000E, 0x006F, Z(AnalogStatusFlags), &Z_Copy }, + { 0x000E, 0x0075, Z(AnalogEngineeringUnits),&Z_Copy }, + { 0x000E, 0x0100, Z(AnalogApplicationType),&Z_Copy }, // Binary Input cluster - { 0x000F, 0x0004, "BinaryInActiveText", &Z_Copy }, - { 0x000F, 0x001C, "BinaryInDescription", &Z_Copy }, - { 0x000F, 0x002E, "BinaryInInactiveText",&Z_Copy }, - { 0x000F, 0x0051, "BinaryInOutOfService",&Z_Copy }, - { 0x000F, 0x0054, "BinaryInPolarity", &Z_Copy }, - { 0x000F, 0x0055, "BinaryInValue", &Z_Copy }, - { 0x000F, 0x0057, "BinaryInPriorityArray",&Z_Copy }, - { 0x000F, 0x0067, "BinaryInReliability", &Z_Copy }, - { 0x000F, 0x006F, "BinaryInStatusFlags", &Z_Copy }, - { 0x000F, 0x0100, "BinaryInApplicationType",&Z_Copy }, + { 0x000F, 0x0004, Z(BinaryInActiveText), &Z_Copy }, + { 0x000F, 0x001C, Z(BinaryInDescription), &Z_Copy }, + { 0x000F, 0x002E, Z(BinaryInInactiveText),&Z_Copy }, + { 0x000F, 0x0051, Z(BinaryInOutOfService),&Z_Copy }, + { 0x000F, 0x0054, Z(BinaryInPolarity), &Z_Copy }, + { 0x000F, 0x0055, Z(BinaryInValue), &Z_Copy }, + { 0x000F, 0x0057, Z(BinaryInPriorityArray),&Z_Copy }, + { 0x000F, 0x0067, Z(BinaryInReliability), &Z_Copy }, + { 0x000F, 0x006F, Z(BinaryInStatusFlags), &Z_Copy }, + { 0x000F, 0x0100, Z(BinaryInApplicationType),&Z_Copy }, // Binary Output cluster - { 0x0010, 0x0004, "BinaryOutActiveText", &Z_Copy }, - { 0x0010, 0x001C, "BinaryOutDescription", &Z_Copy }, - { 0x0010, 0x002E, "BinaryOutInactiveText",&Z_Copy }, - { 0x0010, 0x0042, "BinaryOutMinimumOffTime",&Z_Copy }, - { 0x0010, 0x0043, "BinaryOutMinimumOnTime",&Z_Copy }, - { 0x0010, 0x0051, "BinaryOutOutOfService",&Z_Copy }, - { 0x0010, 0x0054, "BinaryOutPolarity", &Z_Copy }, - { 0x0010, 0x0055, "BinaryOutValue", &Z_Copy }, - { 0x0010, 0x0057, "BinaryOutPriorityArray",&Z_Copy }, - { 0x0010, 0x0067, "BinaryOutReliability", &Z_Copy }, - { 0x0010, 0x0068, "BinaryOutRelinquishDefault",&Z_Copy }, - { 0x0010, 0x006F, "BinaryOutStatusFlags", &Z_Copy }, - { 0x0010, 0x0100, "BinaryOutApplicationType",&Z_Copy }, + { 0x0010, 0x0004, Z(BinaryOutActiveText), &Z_Copy }, + { 0x0010, 0x001C, Z(BinaryOutDescription), &Z_Copy }, + { 0x0010, 0x002E, Z(BinaryOutInactiveText),&Z_Copy }, + { 0x0010, 0x0042, Z(BinaryOutMinimumOffTime),&Z_Copy }, + { 0x0010, 0x0043, Z(BinaryOutMinimumOnTime),&Z_Copy }, + { 0x0010, 0x0051, Z(BinaryOutOutOfService),&Z_Copy }, + { 0x0010, 0x0054, Z(BinaryOutPolarity), &Z_Copy }, + { 0x0010, 0x0055, Z(BinaryOutValue), &Z_Copy }, + { 0x0010, 0x0057, Z(BinaryOutPriorityArray),&Z_Copy }, + { 0x0010, 0x0067, Z(BinaryOutReliability), &Z_Copy }, + { 0x0010, 0x0068, Z(BinaryOutRelinquishDefault),&Z_Copy }, + { 0x0010, 0x006F, Z(BinaryOutStatusFlags), &Z_Copy }, + { 0x0010, 0x0100, Z(BinaryOutApplicationType),&Z_Copy }, // Binary Value cluster - { 0x0011, 0x0004, "BinaryActiveText", &Z_Copy }, - { 0x0011, 0x001C, "BinaryDescription", &Z_Copy }, - { 0x0011, 0x002E, "BinaryInactiveText", &Z_Copy }, - { 0x0011, 0x0042, "BinaryMinimumOffTime", &Z_Copy }, - { 0x0011, 0x0043, "BinaryMinimumOnTime", &Z_Copy }, - { 0x0011, 0x0051, "BinaryOutOfService", &Z_Copy }, - { 0x0011, 0x0055, "BinaryValue", &Z_Copy }, - { 0x0011, 0x0057, "BinaryPriorityArray", &Z_Copy }, - { 0x0011, 0x0067, "BinaryReliability", &Z_Copy }, - { 0x0011, 0x0068, "BinaryRelinquishDefault",&Z_Copy }, - { 0x0011, 0x006F, "BinaryStatusFlags", &Z_Copy }, - { 0x0011, 0x0100, "BinaryApplicationType",&Z_Copy }, + { 0x0011, 0x0004, Z(BinaryActiveText), &Z_Copy }, + { 0x0011, 0x001C, Z(BinaryDescription), &Z_Copy }, + { 0x0011, 0x002E, Z(BinaryInactiveText), &Z_Copy }, + { 0x0011, 0x0042, Z(BinaryMinimumOffTime), &Z_Copy }, + { 0x0011, 0x0043, Z(BinaryMinimumOnTime), &Z_Copy }, + { 0x0011, 0x0051, Z(BinaryOutOfService), &Z_Copy }, + { 0x0011, 0x0055, Z(BinaryValue), &Z_Copy }, + { 0x0011, 0x0057, Z(BinaryPriorityArray), &Z_Copy }, + { 0x0011, 0x0067, Z(BinaryReliability), &Z_Copy }, + { 0x0011, 0x0068, Z(BinaryRelinquishDefault),&Z_Copy }, + { 0x0011, 0x006F, Z(BinaryStatusFlags), &Z_Copy }, + { 0x0011, 0x0100, Z(BinaryApplicationType),&Z_Copy }, // Multistate Input cluster - { 0x0012, 0x000E, "MultiInStateText", &Z_Copy }, - { 0x0012, 0x001C, "MultiInDescription", &Z_Copy }, - { 0x0012, 0x004A, "MultiInNumberOfStates",&Z_Copy }, - { 0x0012, 0x0051, "MultiInOutOfService", &Z_Copy }, - { 0x0012, 0x0055, "MultiInValue", &Z_AqaraCube }, - { 0x0012, 0x0067, "MultiInReliability", &Z_Copy }, - { 0x0012, 0x006F, "MultiInStatusFlags", &Z_Copy }, - { 0x0012, 0x0100, "MultiInApplicationType",&Z_Copy }, + { 0x0012, 0x000E, Z(MultiInStateText), &Z_Copy }, + { 0x0012, 0x001C, Z(MultiInDescription), &Z_Copy }, + { 0x0012, 0x004A, Z(MultiInNumberOfStates),&Z_Copy }, + { 0x0012, 0x0051, Z(MultiInOutOfService), &Z_Copy }, + { 0x0012, 0x0055, Z(MultiInValue), &Z_AqaraCube }, + { 0x0012, 0x0067, Z(MultiInReliability), &Z_Copy }, + { 0x0012, 0x006F, Z(MultiInStatusFlags), &Z_Copy }, + { 0x0012, 0x0100, Z(MultiInApplicationType),&Z_Copy }, // Multistate output - { 0x0013, 0x000E, "MultiOutStateText", &Z_Copy }, - { 0x0013, 0x001C, "MultiOutDescription", &Z_Copy }, - { 0x0013, 0x004A, "MultiOutNumberOfStates",&Z_Copy }, - { 0x0013, 0x0051, "MultiOutOutOfService", &Z_Copy }, - { 0x0013, 0x0055, "MultiOutValue", &Z_Copy }, - { 0x0013, 0x0057, "MultiOutPriorityArray",&Z_Copy }, - { 0x0013, 0x0067, "MultiOutReliability", &Z_Copy }, - { 0x0013, 0x0068, "MultiOutRelinquishDefault",&Z_Copy }, - { 0x0013, 0x006F, "MultiOutStatusFlags", &Z_Copy }, - { 0x0013, 0x0100, "MultiOutApplicationType",&Z_Copy }, + { 0x0013, 0x000E, Z(MultiOutStateText), &Z_Copy }, + { 0x0013, 0x001C, Z(MultiOutDescription), &Z_Copy }, + { 0x0013, 0x004A, Z(MultiOutNumberOfStates),&Z_Copy }, + { 0x0013, 0x0051, Z(MultiOutOutOfService), &Z_Copy }, + { 0x0013, 0x0055, Z(MultiOutValue), &Z_Copy }, + { 0x0013, 0x0057, Z(MultiOutPriorityArray),&Z_Copy }, + { 0x0013, 0x0067, Z(MultiOutReliability), &Z_Copy }, + { 0x0013, 0x0068, Z(MultiOutRelinquishDefault),&Z_Copy }, + { 0x0013, 0x006F, Z(MultiOutStatusFlags), &Z_Copy }, + { 0x0013, 0x0100, Z(MultiOutApplicationType),&Z_Copy }, // Multistate Value cluster - { 0x0014, 0x000E, "MultiStateText", &Z_Copy }, - { 0x0014, 0x001C, "MultiDescription", &Z_Copy }, - { 0x0014, 0x004A, "MultiNumberOfStates", &Z_Copy }, - { 0x0014, 0x0051, "MultiOutOfService", &Z_Copy }, - { 0x0014, 0x0055, "MultiValue", &Z_Copy }, - { 0x0014, 0x0067, "MultiReliability", &Z_Copy }, - { 0x0014, 0x0068, "MultiRelinquishDefault",&Z_Copy }, - { 0x0014, 0x006F, "MultiStatusFlags", &Z_Copy }, - { 0x0014, 0x0100, "MultiApplicationType", &Z_Copy }, + { 0x0014, 0x000E, Z(MultiStateText), &Z_Copy }, + { 0x0014, 0x001C, Z(MultiDescription), &Z_Copy }, + { 0x0014, 0x004A, Z(MultiNumberOfStates), &Z_Copy }, + { 0x0014, 0x0051, Z(MultiOutOfService), &Z_Copy }, + { 0x0014, 0x0055, Z(MultiValue), &Z_Copy }, + { 0x0014, 0x0067, Z(MultiReliability), &Z_Copy }, + { 0x0014, 0x0068, Z(MultiRelinquishDefault),&Z_Copy }, + { 0x0014, 0x006F, Z(MultiStatusFlags), &Z_Copy }, + { 0x0014, 0x0100, Z(MultiApplicationType), &Z_Copy }, // Power Profile cluster - { 0x001A, 0x0000, "TotalProfileNum", &Z_Copy }, - { 0x001A, 0x0001, "MultipleScheduling", &Z_Copy }, - { 0x001A, 0x0002, "EnergyFormatting", &Z_Copy }, - { 0x001A, 0x0003, "EnergyRemote", &Z_Copy }, - { 0x001A, 0x0004, "ScheduleMode", &Z_Copy }, + { 0x001A, 0x0000, Z(TotalProfileNum), &Z_Copy }, + { 0x001A, 0x0001, Z(MultipleScheduling), &Z_Copy }, + { 0x001A, 0x0002, Z(EnergyFormatting), &Z_Copy }, + { 0x001A, 0x0003, Z(EnergyRemote), &Z_Copy }, + { 0x001A, 0x0004, Z(ScheduleMode), &Z_Copy }, // Poll Control cluster - { 0x0020, 0x0000, "CheckinInterval", &Z_Copy }, - { 0x0020, 0x0001, "LongPollInterval", &Z_Copy }, - { 0x0020, 0x0002, "ShortPollInterval", &Z_Copy }, - { 0x0020, 0x0003, "FastPollTimeout", &Z_Copy }, - { 0x0020, 0x0004, "CheckinIntervalMin", &Z_Copy }, - { 0x0020, 0x0005, "LongPollIntervalMin", &Z_Copy }, - { 0x0020, 0x0006, "FastPollTimeoutMax", &Z_Copy }, + { 0x0020, 0x0000, Z(CheckinInterval), &Z_Copy }, + { 0x0020, 0x0001, Z(LongPollInterval), &Z_Copy }, + { 0x0020, 0x0002, Z(ShortPollInterval), &Z_Copy }, + { 0x0020, 0x0003, Z(FastPollTimeout), &Z_Copy }, + { 0x0020, 0x0004, Z(CheckinIntervalMin), &Z_Copy }, + { 0x0020, 0x0005, Z(LongPollIntervalMin), &Z_Copy }, + { 0x0020, 0x0006, Z(FastPollTimeoutMax), &Z_Copy }, // Shade Configuration cluster - { 0x0100, 0x0000, "PhysicalClosedLimit", &Z_Copy }, - { 0x0100, 0x0001, "MotorStepSize", &Z_Copy }, - { 0x0100, 0x0002, "Status", &Z_Copy }, - { 0x0100, 0x0010, "ClosedLimit", &Z_Copy }, - { 0x0100, 0x0011, "Mode", &Z_Copy }, + { 0x0100, 0x0000, Z(PhysicalClosedLimit), &Z_Copy }, + { 0x0100, 0x0001, Z(MotorStepSize), &Z_Copy }, + { 0x0100, 0x0002, Z(Status), &Z_Copy }, + { 0x0100, 0x0010, Z(ClosedLimit), &Z_Copy }, + { 0x0100, 0x0011, Z(Mode), &Z_Copy }, // Door Lock cluster - { 0x0101, 0x0000, "LockState", &Z_Copy }, - { 0x0101, 0x0001, "LockType", &Z_Copy }, - { 0x0101, 0x0002, "ActuatorEnabled", &Z_Copy }, - { 0x0101, 0x0003, "DoorState", &Z_Copy }, - { 0x0101, 0x0004, "DoorOpenEvents", &Z_Copy }, - { 0x0101, 0x0005, "DoorClosedEvents", &Z_Copy }, - { 0x0101, 0x0006, "OpenPeriod", &Z_Copy }, + { 0x0101, 0x0000, Z(LockState), &Z_Copy }, + { 0x0101, 0x0001, Z(LockType), &Z_Copy }, + { 0x0101, 0x0002, Z(ActuatorEnabled), &Z_Copy }, + { 0x0101, 0x0003, Z(DoorState), &Z_Copy }, + { 0x0101, 0x0004, Z(DoorOpenEvents), &Z_Copy }, + { 0x0101, 0x0005, Z(DoorClosedEvents), &Z_Copy }, + { 0x0101, 0x0006, Z(OpenPeriod), &Z_Copy }, // Aqara Lumi Vibration Sensor - { 0x0101, 0x0055, "AqaraVibrationMode", &Z_AqaraVibration }, - { 0x0101, 0x0503, "AqaraVibrationsOrAngle", &Z_Copy }, - { 0x0101, 0x0505, "AqaraVibration505", &Z_Copy }, - { 0x0101, 0x0508, "AqaraAccelerometer", &Z_AqaraVibration }, + { 0x0101, 0x0055, Z(AqaraVibrationMode), &Z_AqaraVibration }, + { 0x0101, 0x0503, Z(AqaraVibrationsOrAngle), &Z_Copy }, + { 0x0101, 0x0505, Z(AqaraVibration505), &Z_Copy }, + { 0x0101, 0x0508, Z(AqaraAccelerometer), &Z_AqaraVibration }, // Window Covering cluster - { 0x0102, 0x0000, "WindowCoveringType", &Z_Copy }, - { 0x0102, 0x0001, "PhysicalClosedLimitLift",&Z_Copy }, - { 0x0102, 0x0002, "PhysicalClosedLimitTilt",&Z_Copy }, - { 0x0102, 0x0003, "CurrentPositionLift", &Z_Copy }, - { 0x0102, 0x0004, "CurrentPositionTilt", &Z_Copy }, - { 0x0102, 0x0005, "NumberofActuationsLift",&Z_Copy }, - { 0x0102, 0x0006, "NumberofActuationsTilt",&Z_Copy }, - { 0x0102, 0x0007, "ConfigStatus", &Z_Copy }, - { 0x0102, 0x0008, "CurrentPositionLiftPercentage",&Z_Copy }, - { 0x0102, 0x0009, "CurrentPositionTiltPercentage",&Z_Copy }, - { 0x0102, 0x0010, "InstalledOpenLimitLift",&Z_Copy }, - { 0x0102, 0x0011, "InstalledClosedLimitLift",&Z_Copy }, - { 0x0102, 0x0012, "InstalledOpenLimitTilt",&Z_Copy }, - { 0x0102, 0x0013, "InstalledClosedLimitTilt",&Z_Copy }, - { 0x0102, 0x0014, "VelocityLift", &Z_Copy }, - { 0x0102, 0x0015, "AccelerationTimeLift",&Z_Copy }, - { 0x0102, 0x0016, "DecelerationTimeLift", &Z_Copy }, - { 0x0102, 0x0017, "Mode", &Z_Copy }, - { 0x0102, 0x0018, "IntermediateSetpointsLift",&Z_Copy }, - { 0x0102, 0x0019, "IntermediateSetpointsTilt",&Z_Copy }, + { 0x0102, 0x0000, Z(WindowCoveringType), &Z_Copy }, + { 0x0102, 0x0001, Z(PhysicalClosedLimitLift),&Z_Copy }, + { 0x0102, 0x0002, Z(PhysicalClosedLimitTilt),&Z_Copy }, + { 0x0102, 0x0003, Z(CurrentPositionLift), &Z_Copy }, + { 0x0102, 0x0004, Z(CurrentPositionTilt), &Z_Copy }, + { 0x0102, 0x0005, Z(NumberofActuationsLift),&Z_Copy }, + { 0x0102, 0x0006, Z(NumberofActuationsTilt),&Z_Copy }, + { 0x0102, 0x0007, Z(ConfigStatus), &Z_Copy }, + { 0x0102, 0x0008, Z(CurrentPositionLiftPercentage),&Z_Copy }, + { 0x0102, 0x0009, Z(CurrentPositionTiltPercentage),&Z_Copy }, + { 0x0102, 0x0010, Z(InstalledOpenLimitLift),&Z_Copy }, + { 0x0102, 0x0011, Z(InstalledClosedLimitLift),&Z_Copy }, + { 0x0102, 0x0012, Z(InstalledOpenLimitTilt),&Z_Copy }, + { 0x0102, 0x0013, Z(InstalledClosedLimitTilt),&Z_Copy }, + { 0x0102, 0x0014, Z(VelocityLift), &Z_Copy }, + { 0x0102, 0x0015, Z(AccelerationTimeLift),&Z_Copy }, + { 0x0102, 0x0016, Z(DecelerationTimeLift), &Z_Copy }, + { 0x0102, 0x0017, Z(Mode), &Z_Copy }, + { 0x0102, 0x0018, Z(IntermediateSetpointsLift),&Z_Copy }, + { 0x0102, 0x0019, Z(IntermediateSetpointsTilt),&Z_Copy }, // Color Control cluster - { 0x0300, 0x0000, "Hue", &Z_Copy }, - { 0x0300, 0x0001, "Sat", &Z_Copy }, - { 0x0300, 0x0002, "RemainingTime", &Z_Copy }, - { 0x0300, 0x0003, "X", &Z_Copy }, - { 0x0300, 0x0004, "Y", &Z_Copy }, - { 0x0300, 0x0005, "DriftCompensation", &Z_Copy }, - { 0x0300, 0x0006, "CompensationText", &Z_Copy }, - { 0x0300, 0x0007, "CT", &Z_Copy }, - { 0x0300, 0x0008, "ColorMode", &Z_Copy }, - { 0x0300, 0x0010, "NumberOfPrimaries", &Z_Copy }, - { 0x0300, 0x0011, "Primary1X", &Z_Copy }, - { 0x0300, 0x0012, "Primary1Y", &Z_Copy }, - { 0x0300, 0x0013, "Primary1Intensity", &Z_Copy }, - { 0x0300, 0x0015, "Primary2X", &Z_Copy }, - { 0x0300, 0x0016, "Primary2Y", &Z_Copy }, - { 0x0300, 0x0017, "Primary2Intensity", &Z_Copy }, - { 0x0300, 0x0019, "Primary3X", &Z_Copy }, - { 0x0300, 0x001A, "Primary3Y", &Z_Copy }, - { 0x0300, 0x001B, "Primary3Intensity", &Z_Copy }, - { 0x0300, 0x0030, "WhitePointX", &Z_Copy }, - { 0x0300, 0x0031, "WhitePointY", &Z_Copy }, - { 0x0300, 0x0032, "ColorPointRX", &Z_Copy }, - { 0x0300, 0x0033, "ColorPointRY", &Z_Copy }, - { 0x0300, 0x0034, "ColorPointRIntensity", &Z_Copy }, - { 0x0300, 0x0036, "ColorPointGX", &Z_Copy }, - { 0x0300, 0x0037, "ColorPointGY", &Z_Copy }, - { 0x0300, 0x0038, "ColorPointGIntensity", &Z_Copy }, - { 0x0300, 0x003A, "ColorPointBX", &Z_Copy }, - { 0x0300, 0x003B, "ColorPointBY", &Z_Copy }, - { 0x0300, 0x003C, "ColorPointBIntensity", &Z_Copy }, + { 0x0300, 0x0000, Z(Hue), &Z_Copy }, + { 0x0300, 0x0001, Z(Sat), &Z_Copy }, + { 0x0300, 0x0002, Z(RemainingTime), &Z_Copy }, + { 0x0300, 0x0003, Z(X), &Z_Copy }, + { 0x0300, 0x0004, Z(Y), &Z_Copy }, + { 0x0300, 0x0005, Z(DriftCompensation), &Z_Copy }, + { 0x0300, 0x0006, Z(CompensationText), &Z_Copy }, + { 0x0300, 0x0007, Z(CT), &Z_Copy }, + { 0x0300, 0x0008, Z(ColorMode), &Z_Copy }, + { 0x0300, 0x0010, Z(NumberOfPrimaries), &Z_Copy }, + { 0x0300, 0x0011, Z(Primary1X), &Z_Copy }, + { 0x0300, 0x0012, Z(Primary1Y), &Z_Copy }, + { 0x0300, 0x0013, Z(Primary1Intensity), &Z_Copy }, + { 0x0300, 0x0015, Z(Primary2X), &Z_Copy }, + { 0x0300, 0x0016, Z(Primary2Y), &Z_Copy }, + { 0x0300, 0x0017, Z(Primary2Intensity), &Z_Copy }, + { 0x0300, 0x0019, Z(Primary3X), &Z_Copy }, + { 0x0300, 0x001A, Z(Primary3Y), &Z_Copy }, + { 0x0300, 0x001B, Z(Primary3Intensity), &Z_Copy }, + { 0x0300, 0x0030, Z(WhitePointX), &Z_Copy }, + { 0x0300, 0x0031, Z(WhitePointY), &Z_Copy }, + { 0x0300, 0x0032, Z(ColorPointRX), &Z_Copy }, + { 0x0300, 0x0033, Z(ColorPointRY), &Z_Copy }, + { 0x0300, 0x0034, Z(ColorPointRIntensity), &Z_Copy }, + { 0x0300, 0x0036, Z(ColorPointGX), &Z_Copy }, + { 0x0300, 0x0037, Z(ColorPointGY), &Z_Copy }, + { 0x0300, 0x0038, Z(ColorPointGIntensity), &Z_Copy }, + { 0x0300, 0x003A, Z(ColorPointBX), &Z_Copy }, + { 0x0300, 0x003B, Z(ColorPointBY), &Z_Copy }, + { 0x0300, 0x003C, Z(ColorPointBIntensity), &Z_Copy }, // Illuminance Measurement cluster - { 0x0400, 0x0000, D_JSON_ILLUMINANCE, &Z_Copy }, // Illuminance (in Lux) - { 0x0400, 0x0001, "IlluminanceMinMeasuredValue", &Z_Copy }, // - { 0x0400, 0x0002, "IlluminanceMaxMeasuredValue", &Z_Copy }, // - { 0x0400, 0x0003, "IlluminanceTolerance", &Z_Copy }, // - { 0x0400, 0x0004, "IlluminanceLightSensorType", &Z_Copy }, // + { 0x0400, 0x0000, Z(Illuminance), &Z_Copy }, // Illuminance (in Lux) + { 0x0400, 0x0001, Z(IlluminanceMinMeasuredValue), &Z_Copy }, // + { 0x0400, 0x0002, Z(IlluminanceMaxMeasuredValue), &Z_Copy }, // + { 0x0400, 0x0003, Z(IlluminanceTolerance), &Z_Copy }, // + { 0x0400, 0x0004, Z(IlluminanceLightSensorType), &Z_Copy }, // { 0x0400, 0xFFFF, nullptr, &Z_Remove }, // Remove all other values // Illuminance Level Sensing cluster - { 0x0401, 0x0000, "IlluminanceLevelStatus", &Z_Copy }, // Illuminance (in Lux) - { 0x0401, 0x0001, "IlluminanceLightSensorType", &Z_Copy }, // LightSensorType + { 0x0401, 0x0000, Z(IlluminanceLevelStatus), &Z_Copy }, // Illuminance (in Lux) + { 0x0401, 0x0001, Z(IlluminanceLightSensorType), &Z_Copy }, // LightSensorType { 0x0401, 0xFFFF, nullptr, &Z_Remove }, // Remove all other values // Temperature Measurement cluster - { 0x0402, 0x0000, D_JSON_TEMPERATURE, &Z_FloatDiv100 }, // Temperature - { 0x0402, 0x0001, "TemperatureMinMeasuredValue", &Z_FloatDiv100 }, // - { 0x0402, 0x0002, "TemperatureMaxMeasuredValue", &Z_FloatDiv100 }, // - { 0x0402, 0x0003, "TemperatureTolerance", &Z_FloatDiv100 }, // + { 0x0402, 0x0000, Z(Temperature), &Z_FloatDiv100 }, // Temperature + { 0x0402, 0x0001, Z(TemperatureMinMeasuredValue), &Z_FloatDiv100 }, // + { 0x0402, 0x0002, Z(TemperatureMaxMeasuredValue), &Z_FloatDiv100 }, // + { 0x0402, 0x0003, Z(TemperatureTolerance), &Z_FloatDiv100 }, // { 0x0402, 0xFFFF, nullptr, &Z_Remove }, // Remove all other values // Pressure Measurement cluster - { 0x0403, 0x0000, D_JSON_PRESSURE_UNIT, &Z_AddPressureUnit }, // Pressure Unit - { 0x0403, 0x0000, D_JSON_PRESSURE, &Z_Copy }, // Pressure - { 0x0403, 0x0001, "PressureMinMeasuredValue", &Z_Copy }, // - { 0x0403, 0x0002, "PressureMaxMeasuredValue", &Z_Copy }, // - { 0x0403, 0x0003, "PressureTolerance", &Z_Copy }, // - { 0x0403, 0x0010, "PressureScaledValue", &Z_Copy }, // - { 0x0403, 0x0011, "PressureMinScaledValue", &Z_Copy }, // - { 0x0403, 0x0012, "PressureMaxScaledValue", &Z_Copy }, // - { 0x0403, 0x0013, "PressureScaledTolerance", &Z_Copy }, // - { 0x0403, 0x0014, "PressureScale", &Z_Copy }, // + { 0x0403, 0x0000, Z(PressureUnit), &Z_AddPressureUnit }, // Pressure Unit + { 0x0403, 0x0000, Z(Pressure), &Z_Copy }, // Pressure + { 0x0403, 0x0001, Z(PressureMinMeasuredValue), &Z_Copy }, // + { 0x0403, 0x0002, Z(PressureMaxMeasuredValue), &Z_Copy }, // + { 0x0403, 0x0003, Z(PressureTolerance), &Z_Copy }, // + { 0x0403, 0x0010, Z(PressureScaledValue), &Z_Copy }, // + { 0x0403, 0x0011, Z(PressureMinScaledValue), &Z_Copy }, // + { 0x0403, 0x0012, Z(PressureMaxScaledValue), &Z_Copy }, // + { 0x0403, 0x0013, Z(PressureScaledTolerance), &Z_Copy }, // + { 0x0403, 0x0014, Z(PressureScale), &Z_Copy }, // { 0x0403, 0xFFFF, nullptr, &Z_Remove }, // Remove all other Pressure values // Flow Measurement cluster - { 0x0404, 0x0000, D_JSON_FLOWRATE, &Z_FloatDiv10 }, // Flow (in m3/h) - { 0x0404, 0x0001, "FlowMinMeasuredValue", &Z_Copy }, // - { 0x0404, 0x0002, "FlowMaxMeasuredValue", &Z_Copy }, // - { 0x0404, 0x0003, "FlowTolerance", &Z_Copy }, // + { 0x0404, 0x0000, Z(FlowRate), &Z_FloatDiv10 }, // Flow (in m3/h) + { 0x0404, 0x0001, Z(FlowMinMeasuredValue), &Z_Copy }, // + { 0x0404, 0x0002, Z(FlowMaxMeasuredValue), &Z_Copy }, // + { 0x0404, 0x0003, Z(FlowTolerance), &Z_Copy }, // { 0x0404, 0xFFFF, nullptr, &Z_Remove }, // Remove all other values // Relative Humidity Measurement cluster - { 0x0405, 0x0000, D_JSON_HUMIDITY, &Z_FloatDiv100 }, // Humidity - { 0x0405, 0x0001, "HumidityMinMeasuredValue", &Z_Copy }, // - { 0x0405, 0x0002, "HumidityMaxMeasuredValue", &Z_Copy }, // - { 0x0405, 0x0003, "HumidityTolerance", &Z_Copy }, // + { 0x0405, 0x0000, Z(Humidity), &Z_FloatDiv100 }, // Humidity + { 0x0405, 0x0001, Z(HumidityMinMeasuredValue), &Z_Copy }, // + { 0x0405, 0x0002, Z(HumidityMaxMeasuredValue), &Z_Copy }, // + { 0x0405, 0x0003, Z(HumidityTolerance), &Z_Copy }, // { 0x0405, 0xFFFF, nullptr, &Z_Remove }, // Remove all other values // Occupancy Sensing cluster - { 0x0406, 0x0000, OCCUPANCY, &Z_Copy }, // Occupancy (map8) - { 0x0406, 0x0001, "OccupancySensorType", &Z_Copy }, // OccupancySensorType + { 0x0406, 0x0000, Z(Occupancy), &Z_Copy }, // Occupancy (map8) + { 0x0406, 0x0001, Z(OccupancySensorType), &Z_Copy }, // OccupancySensorType { 0x0406, 0xFFFF, nullptr, &Z_Remove }, // Remove all other values // Meter Identification cluster - { 0x0B01, 0x0000, "CompanyName", &Z_Copy }, - { 0x0B01, 0x0001, "MeterTypeID", &Z_Copy }, - { 0x0B01, 0x0004, "DataQualityID", &Z_Copy }, - { 0x0B01, 0x0005, "CustomerName", &Z_Copy }, - { 0x0B01, 0x0006, "Model", &Z_Copy }, - { 0x0B01, 0x0007, "PartNumber", &Z_Copy }, - { 0x0B01, 0x000A, "SoftwareRevision", &Z_Copy }, - { 0x0B01, 0x000C, "POD", &Z_Copy }, - { 0x0B01, 0x000D, "AvailablePower", &Z_Copy }, - { 0x0B01, 0x000E, "PowerThreshold", &Z_Copy }, + { 0x0B01, 0x0000, Z(CompanyName), &Z_Copy }, + { 0x0B01, 0x0001, Z(MeterTypeID), &Z_Copy }, + { 0x0B01, 0x0004, Z(DataQualityID), &Z_Copy }, + { 0x0B01, 0x0005, Z(CustomerName), &Z_Copy }, + { 0x0B01, 0x0006, Z(Model), &Z_Copy }, + { 0x0B01, 0x0007, Z(PartNumber), &Z_Copy }, + { 0x0B01, 0x000A, Z(SoftwareRevision), &Z_Copy }, + { 0x0B01, 0x000C, Z(POD), &Z_Copy }, + { 0x0B01, 0x000D, Z(AvailablePower), &Z_Copy }, + { 0x0B01, 0x000E, Z(PowerThreshold), &Z_Copy }, // Diagnostics cluster - { 0x0B05, 0x0000, "NumberOfResets", &Z_Copy }, - { 0x0B05, 0x0001, "PersistentMemoryWrites",&Z_Copy }, - { 0x0B05, 0x011C, "LastMessageLQI", &Z_Copy }, - { 0x0B05, 0x011D, "LastMessageRSSI", &Z_Copy }, + { 0x0B05, 0x0000, Z(NumberOfResets), &Z_Copy }, + { 0x0B05, 0x0001, Z(PersistentMemoryWrites),&Z_Copy }, + { 0x0B05, 0x011C, Z(LastMessageLQI), &Z_Copy }, + { 0x0B05, 0x011D, Z(LastMessageRSSI), &Z_Copy }, }; @@ -1164,7 +1252,7 @@ void ZCLFrame::postProcessAttributes(uint16_t shortaddr, JsonObject& json) { if ((conv_cluster == cluster) && ((conv_attribute == attribute) || (conv_attribute == 0xFFFF)) ) { - String new_name_str = converter->name; + String new_name_str = (const __FlashStringHelper*) converter->name; if (suffix > 1) { new_name_str += suffix; } // append suffix number int32_t drop = (*converter->func)(this, shortaddr, json, key, value, new_name_str, conv_cluster, conv_attribute); if (drop) { diff --git a/tasmota/xdrv_23_zigbee_6_commands.ino b/tasmota/xdrv_23_zigbee_6_commands.ino index a61270a9c..299021693 100644 --- a/tasmota/xdrv_23_zigbee_6_commands.ino +++ b/tasmota/xdrv_23_zigbee_6_commands.ino @@ -36,6 +36,23 @@ typedef struct Z_XYZ_Var { // Holds values for vairables X, Y and Z uint8_t z_type = 0; } Z_XYZ_Var; +ZF(AddGroup) ZF(ViewGroup) ZF(GetGroup) ZF(GetAllGroups) ZF(RemoveGroup) ZF(RemoveAllGroups) +ZF(AddScene) ZF(ViewScene) ZF(RemoveScene) ZF(RemoveAllScenes) ZF(RecallScene) ZF(StoreScene) ZF(GetSceneMembership) +//ZF(Power) ZF(Dimmer) +ZF(DimmerUp) ZF(DimmerDown) ZF(DimmerStop) +ZF(ResetAlarm) ZF(ResetAllAlarms) +//ZF(Hue) ZF(Sat) ZF(CT) +ZF(HueSat) ZF(Color) +ZF(ShutterOpen) ZF(ShutterClose) ZF(ShutterStop) ZF(ShutterLift) ZF(ShutterTilt) ZF(Shutter) +//ZF(Occupancy) +ZF(DimmerMove) ZF(DimmerStep) +ZF(HueMove) ZF(HueStep) ZF(SatMove) ZF(SatStep) ZF(ColorMove) ZF(ColorStep) +ZF(ArrowClick) ZF(ArrowHold) ZF(ArrowRelease) ZF(ZoneStatusChange) + +ZF(xxxx00) ZF(xxxx) ZF(01xxxx) ZF(00) ZF(01) ZF() ZF(xxxxyy) ZF(001902) ZF(011902) ZF(xxyyyy) ZF(xx) +ZF(xx000A00) ZF(xx0A00) ZF(xxyy0A00) ZF(xxxxyyyy0A00) ZF(xxxx0A00) ZF(xx0A) +ZF(xx190A00) ZF(xx19) ZF(xx190A) ZF(xxxxyyyy) ZF(xxxxyyzz) ZF(xxyyzzzz) ZF(xxyyyyzz) + // Cluster specific commands // Note: the table is both for sending commands, but also displaying received commands // - tasmota_cmd: the human-readable name of the command as entered or displayed, use '|' to split into multiple commands when displayed @@ -45,72 +62,72 @@ typedef struct Z_XYZ_Var { // Holds values for vairables X, Y and Z // - param: the paylod template, x/y/z are substituted with arguments, little endian. For command display, payload must match until x/y/z character or until the end of the paylod. '??' means ignore. const Z_CommandConverter Z_Commands[] PROGMEM = { // Group adress commands - { "AddGroup", 0x0004, 0x00, 0x01, "xxxx00" }, // Add group id, group name is not supported - { "ViewGroup", 0x0004, 0x01, 0x01, "xxxx" }, // Ask for the group name - { "GetGroup", 0x0004, 0x02, 0x01, "01xxxx" }, // Get one group membership - { "GetAllGroups", 0x0004, 0x02, 0x01, "00" }, // Get all groups membership - { "RemoveGroup", 0x0004, 0x03, 0x01, "xxxx" }, // Remove one group - { "RemoveAllGroups",0x0004, 0x04, 0x01, "" }, // Remove all groups + { Z(AddGroup), 0x0004, 0x00, 0x01, Z(xxxx00) }, // Add group id, group name is not supported + { Z(ViewGroup), 0x0004, 0x01, 0x01, Z(xxxx) }, // Ask for the group name + { Z(GetGroup), 0x0004, 0x02, 0x01, Z(01xxxx) }, // Get one group membership + { Z(GetAllGroups), 0x0004, 0x02, 0x01, Z(00) }, // Get all groups membership + { Z(RemoveGroup), 0x0004, 0x03, 0x01, Z(xxxx) }, // Remove one group + { Z(RemoveAllGroups),0x0004, 0x04, 0x01, Z() }, // Remove all groups // Scenes //{ "AddScene", 0x0005, 0x00, 0x01, "xxxxyy0100" }, - { "ViewScene", 0x0005, 0x01, 0x01, "xxxxyy" }, - { "RemoveScene", 0x0005, 0x02, 0x01, "xxxxyy" }, - { "RemoveAllScenes",0x0005, 0x03, 0x01, "xxxx" }, - { "RecallScene", 0x0005, 0x05, 0x01, "xxxxyy" }, - { "GetSceneMembership",0x0005, 0x06, 0x01, "xxxx" }, + { Z(ViewScene), 0x0005, 0x01, 0x01, Z(xxxxyy) }, + { Z(RemoveScene), 0x0005, 0x02, 0x01, Z(xxxxyy) }, + { Z(RemoveAllScenes),0x0005, 0x03, 0x01, Z(xxxx) }, + { Z(RecallScene), 0x0005, 0x05, 0x01, Z(xxxxyy) }, + { Z(GetSceneMembership),0x0005, 0x06, 0x01, Z(xxxx) }, // Light & Shutter commands - { "Power", 0x0006, 0xFF, 0x01, "" }, // 0=Off, 1=On, 2=Toggle - { "Dimmer", 0x0008, 0x04, 0x01, "xx0A00" }, // Move to Level with On/Off, xx=0..254 (255 is invalid) - { "Dimmer+", 0x0008, 0x06, 0x01, "001902" }, // Step up by 10%, 0.2 secs - { "Dimmer-", 0x0008, 0x06, 0x01, "011902" }, // Step down by 10%, 0.2 secs - { "DimmerStop", 0x0008, 0x03, 0x01, "" }, // Stop any Dimmer animation - { "ResetAlarm", 0x0009, 0x00, 0x01, "xxyyyy" }, // Reset alarm (alarm code + cluster identifier) - { "ResetAllAlarms", 0x0009, 0x01, 0x01, "" }, // Reset all alarms - { "Hue", 0x0300, 0x00, 0x01, "xx000A00" }, // Move to Hue, shortest time, 1s - { "Sat", 0x0300, 0x03, 0x01, "xx0A00" }, // Move to Sat - { "HueSat", 0x0300, 0x06, 0x01, "xxyy0A00" }, // Hue, Sat - { "Color", 0x0300, 0x07, 0x01, "xxxxyyyy0A00" }, // x, y (uint16) - { "CT", 0x0300, 0x0A, 0x01, "xxxx0A00" }, // Color Temperature Mireds (uint16) - { "ShutterOpen", 0x0102, 0x00, 0x01, "" }, - { "ShutterClose", 0x0102, 0x01, 0x01, "" }, - { "ShutterStop", 0x0102, 0x02, 0x01, "" }, - { "ShutterLift", 0x0102, 0x05, 0x01, "xx" }, // Lift percentage, 0%=open, 100%=closed - { "ShutterTilt", 0x0102, 0x08, 0x01, "xx" }, // Tilt percentage - { "Shutter", 0x0102, 0xFF, 0x01, "" }, + { Z(Power), 0x0006, 0xFF, 0x01, Z() }, // 0=Off, 1=On, 2=Toggle + { Z(Dimmer), 0x0008, 0x04, 0x01, Z(xx0A00) }, // Move to Level with On/Off, xx=0..254 (255 is invalid) + { Z(DimmerUp), 0x0008, 0x06, 0x01, Z(001902) }, // Step up by 10%, 0.2 secs + { Z(DimmerDown), 0x0008, 0x06, 0x01, Z(011902) }, // Step down by 10%, 0.2 secs + { Z(DimmerStop), 0x0008, 0x03, 0x01, Z() }, // Stop any Dimmer animation + { Z(ResetAlarm), 0x0009, 0x00, 0x01, Z(xxyyyy) }, // Reset alarm (alarm code + cluster identifier) + { Z(ResetAllAlarms), 0x0009, 0x01, 0x01, Z() }, // Reset all alarms + { Z(Hue), 0x0300, 0x00, 0x01, Z(xx000A00) }, // Move to Hue, shortest time, 1s + { Z(Sat), 0x0300, 0x03, 0x01, Z(xx0A00) }, // Move to Sat + { Z(HueSat), 0x0300, 0x06, 0x01, Z(xxyy0A00) }, // Hue, Sat + { Z(Color), 0x0300, 0x07, 0x01, Z(xxxxyyyy0A00) }, // x, y (uint16) + { Z(CT), 0x0300, 0x0A, 0x01, Z(xxxx0A00) }, // Color Temperature Mireds (uint16) + { Z(ShutterOpen), 0x0102, 0x00, 0x01, Z() }, + { Z(ShutterClose), 0x0102, 0x01, 0x01, Z() }, + { Z(ShutterStop), 0x0102, 0x02, 0x01, Z() }, + { Z(ShutterLift), 0x0102, 0x05, 0x01, Z(xx) }, // Lift percentage, 0%=open, 100%=closed + { Z(ShutterTilt), 0x0102, 0x08, 0x01, Z(xx) }, // Tilt percentage + { Z(Shutter), 0x0102, 0xFF, 0x01, Z() }, // Blitzwolf PIR - { "Occupancy", 0xEF00, 0x01, 0x82, ""}, // Specific decoder for Blitzwolf PIR, empty name means special treatment + { Z(Occupancy), 0xEF00, 0x01, 0x82, Z()}, // Specific decoder for Blitzwolf PIR, empty name means special treatment // Decoders only - normally not used to send, and names may be masked by previous definitions - { "Dimmer", 0x0008, 0x00, 0x01, "xx" }, - { "DimmerMove", 0x0008, 0x01, 0x01, "xx0A" }, - { "DimmerStep", 0x0008, 0x02, 0x01, "xx190A00" }, - { "DimmerMove", 0x0008, 0x05, 0x01, "xx0A" }, - { "Dimmer+", 0x0008, 0x06, 0x01, "00" }, - { "Dimmer-", 0x0008, 0x06, 0x01, "01" }, - { "DimmerStop", 0x0008, 0x07, 0x01, "" }, - { "HueMove", 0x0300, 0x01, 0x01, "xx19" }, - { "HueStep", 0x0300, 0x02, 0x01, "xx190A00" }, - { "SatMove", 0x0300, 0x04, 0x01, "xx19" }, - { "SatStep", 0x0300, 0x05, 0x01, "xx190A" }, - { "ColorMove", 0x0300, 0x08, 0x01, "xxxxyyyy" }, - { "ColorStep", 0x0300, 0x09, 0x01, "xxxxyyyy0A00" }, + { Z(Dimmer), 0x0008, 0x00, 0x01, Z(xx) }, + { Z(DimmerMove), 0x0008, 0x01, 0x01, Z(xx0A) }, + { Z(DimmerStep), 0x0008, 0x02, 0x01, Z(xx190A00) }, + { Z(DimmerMove), 0x0008, 0x05, 0x01, Z(xx0A) }, + { Z(DimmerUp), 0x0008, 0x06, 0x01, Z(00) }, + { Z(DimmerDown), 0x0008, 0x06, 0x01, Z(01) }, + { Z(DimmerStop), 0x0008, 0x07, 0x01, Z() }, + { Z(HueMove), 0x0300, 0x01, 0x01, Z(xx19) }, + { Z(HueStep), 0x0300, 0x02, 0x01, Z(xx190A00) }, + { Z(SatMove), 0x0300, 0x04, 0x01, Z(xx19) }, + { Z(SatStep), 0x0300, 0x05, 0x01, Z(xx190A) }, + { Z(ColorMove), 0x0300, 0x08, 0x01, Z(xxxxyyyy) }, + { Z(ColorStep), 0x0300, 0x09, 0x01, Z(xxxxyyyy0A00) }, // Tradfri - { "ArrowClick", 0x0005, 0x07, 0x01, "xx" }, // xx == 0x01 = left, 0x00 = right - { "ArrowHold", 0x0005, 0x08, 0x01, "xx" }, // xx == 0x01 = left, 0x00 = right - { "ArrowRelease", 0x0005, 0x09, 0x01, "" }, + { Z(ArrowClick), 0x0005, 0x07, 0x01, Z(xx) }, // xx == 0x01 = left, 0x00 = right + { Z(ArrowHold), 0x0005, 0x08, 0x01, Z(xx) }, // xx == 0x01 = left, 0x00 = right + { Z(ArrowRelease), 0x0005, 0x09, 0x01, Z() }, // IAS - Intruder Alarm System + leak/fire detection - { "ZoneStatusChange",0x0500, 0x00, 0x82, "xxxxyyzz" }, // xxxx = zone status, yy = extended status, zz = zone id, Delay is ignored + { Z(ZoneStatusChange),0x0500, 0x00, 0x82, Z(xxxxyyzz) }, // xxxx = zone status, yy = extended status, zz = zone id, Delay is ignored // responses for Group cluster commands - { "AddGroup", 0x0004, 0x00, 0x82, "xxyyyy" }, // xx = status, yy = group id - { "ViewGroup", 0x0004, 0x01, 0x82, "xxyyyy" }, // xx = status, yy = group id, name ignored - { "GetGroup", 0x0004, 0x02, 0x82, "xxyyzzzz" }, // xx = capacity, yy = count, zzzz = first group id, following groups ignored - { "RemoveGroup", 0x0004, 0x03, 0x82, "xxyyyy" }, // xx = status, yy = group id + { Z(AddGroup), 0x0004, 0x00, 0x82, Z(xxyyyy) }, // xx = status, yy = group id + { Z(ViewGroup), 0x0004, 0x01, 0x82, Z(xxyyyy) }, // xx = status, yy = group id, name ignored + { Z(GetGroup), 0x0004, 0x02, 0x82, Z(xxyyzzzz) }, // xx = capacity, yy = count, zzzz = first group id, following groups ignored + { Z(RemoveGroup), 0x0004, 0x03, 0x82, Z(xxyyyy) }, // xx = status, yy = group id // responses for Scene cluster commands - { "AddScene", 0x0005, 0x00, 0x82, "xxyyyyzz" }, // xx = status, yyyy = group id, zz = scene id - { "ViewScene", 0x0005, 0x01, 0x82, "xxyyyyzz" }, // xx = status, yyyy = group id, zz = scene id - { "RemoveScene", 0x0005, 0x02, 0x82, "xxyyyyzz" }, // xx = status, yyyy = group id, zz = scene id - { "RemoveAllScenes",0x0005, 0x03, 0x82, "xxyyyy" }, // xx = status, yyyy = group id - { "StoreScene", 0x0005, 0x04, 0x82, "xxyyyyzz" }, // xx = status, yyyy = group id, zz = scene id - { "GetSceneMembership",0x0005, 0x06, 0x82, "" }, // specific + { Z(AddScene), 0x0005, 0x00, 0x82, Z(xxyyyyzz) }, // xx = status, yyyy = group id, zz = scene id + { Z(ViewScene), 0x0005, 0x01, 0x82, Z(xxyyyyzz) }, // xx = status, yyyy = group id, zz = scene id + { Z(RemoveScene), 0x0005, 0x02, 0x82, Z(xxyyyyzz) }, // xx = status, yyyy = group id, zz = scene id + { Z(RemoveAllScenes),0x0005, 0x03, 0x82, Z(xxyyyy) }, // xx = status, yyyy = group id + { Z(StoreScene), 0x0005, 0x04, 0x82, Z(xxyyyyzz) }, // xx = status, yyyy = group id, zz = scene id + { Z(GetSceneMembership),0x0005, 0x06, 0x82, Z() }, // specific }; #define ZLE(x) ((x) & 0xFF), ((x) >> 8) // Little Endian @@ -363,17 +380,17 @@ void convertClusterSpecific(JsonObject& json, uint16_t cluster, uint8_t cmd, boo if ((cluster == 0x0500) && (cmd == 0x00)) { // "ZoneStatusChange" json[command_name] = xyz.x; - json[command_name2 + "Ext"] = xyz.y; - json[command_name2 + "Zone"] = xyz.z; + json[command_name2 + F("Ext")] = xyz.y; + json[command_name2 + F("Zone")] = xyz.z; } else if ((cluster == 0x0004) && ((cmd == 0x00) || (cmd == 0x01) || (cmd == 0x03))) { // AddGroupResp or ViewGroupResp (group name ignored) or RemoveGroup json[command_name] = xyz.y; - json[command_name2 + "Status"] = xyz.x; - json[command_name2 + "StatusMsg"] = getZigbeeStatusMessage(xyz.x); + json[command_name2 + F("Status")] = xyz.x; + json[command_name2 + F("StatusMsg")] = getZigbeeStatusMessage(xyz.x); } else if ((cluster == 0x0004) && (cmd == 0x02)) { // GetGroupResp - json[command_name2 + "Capacity"] = xyz.x; - json[command_name2 + "Count"] = xyz.y; + json[command_name2 + F("Capacity")] = xyz.x; + json[command_name2 + F("Count")] = xyz.y; JsonArray &arr = json.createNestedArray(command_name); for (uint32_t i = 0; i < xyz.y; i++) { arr.add(payload.get16(2 + 2*i)); diff --git a/tasmota/xdrv_23_zigbee_7_statemachine.ino b/tasmota/xdrv_23_zigbee_7_statemachine.ino index 4f54c1b9c..a703a8349 100644 --- a/tasmota/xdrv_23_zigbee_7_statemachine.ino +++ b/tasmota/xdrv_23_zigbee_7_statemachine.ino @@ -496,6 +496,7 @@ void ZigbeeStateMachine_Run(void) { zigbee.recv_until = false; zigbee.state_no_timeout = false; // reset the no_timeout for next instruction +// AddLog_P2(LOG_LEVEL_INFO, PSTR("ZigbeeStateMachine_Run PC = %d, Mem1 = %d"), zigbee.pc, ESP.getFreeHeap()); if (zigbee.pc > (sizeof(zb_prog)/sizeof(zb_prog[0]))) { AddLog_P2(LOG_LEVEL_ERROR, PSTR(D_LOG_ZIGBEE "Invalid pc: %d, aborting"), zigbee.pc); zigbee.pc = -1; diff --git a/tasmota/xdrv_23_zigbee_9_impl.ino b/tasmota/xdrv_23_zigbee_9_impl.ino index a42beb7c7..7fe42f2c4 100644 --- a/tasmota/xdrv_23_zigbee_9_impl.ino +++ b/tasmota/xdrv_23_zigbee_9_impl.ino @@ -219,6 +219,7 @@ void ZigbeeInput(void) void ZigbeeInit(void) { +// AddLog_P2(LOG_LEVEL_INFO, PSTR("ZigbeeInit Mem1 = %d"), ESP.getFreeHeap()); zigbee.active = false; if ((pin[GPIO_ZIGBEE_RX] < 99) && (pin[GPIO_ZIGBEE_TX] < 99)) { AddLog_P2(LOG_LEVEL_DEBUG_MORE, PSTR(D_LOG_ZIGBEE "GPIOs Rx:%d Tx:%d"), pin[GPIO_ZIGBEE_RX], pin[GPIO_ZIGBEE_TX]); @@ -230,13 +231,16 @@ void ZigbeeInit(void) uint32_t aligned_buffer = ((uint32_t)serial_in_buffer + 3) & ~3; zigbee_buffer = new PreAllocatedSBuffer(sizeof(serial_in_buffer) - 3, (char*) aligned_buffer); } else { +// AddLog_P2(LOG_LEVEL_INFO, PSTR("ZigbeeInit Mem2 = %d"), ESP.getFreeHeap()); zigbee_buffer = new SBuffer(ZIGBEE_BUFFER_SIZE); +// AddLog_P2(LOG_LEVEL_INFO, PSTR("ZigbeeInit Mem3 = %d"), ESP.getFreeHeap()); } zigbee.active = true; zigbee.init_phase = true; // start the state machine zigbee.state_machine = true; // start the state machine ZigbeeSerial->flush(); } +// AddLog_P2(LOG_LEVEL_INFO, PSTR("ZigbeeInit Mem9 = %d"), ESP.getFreeHeap()); } /*********************************************************************************************\ From 6cc4f224cfad7d36a1e4f6709e34d4d7c78ff4c7 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sun, 15 Mar 2020 14:53:05 +0100 Subject: [PATCH 2/2] Fix compile error when hue emulation disabled --- tasmota/xdrv_23_zigbee_3_hue.ino | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tasmota/xdrv_23_zigbee_3_hue.ino b/tasmota/xdrv_23_zigbee_3_hue.ino index bb3fce2dd..baab88d8f 100644 --- a/tasmota/xdrv_23_zigbee_3_hue.ino +++ b/tasmota/xdrv_23_zigbee_3_hue.ino @@ -18,6 +18,7 @@ */ #ifdef USE_ZIGBEE +#if defined(USE_WEBSERVER) && defined(USE_EMULATION) && defined(USE_EMULATION_HUE) && defined(USE_LIGHT) // Add global functions for Hue Emulation @@ -296,4 +297,5 @@ void ZigbeeHandleHue(uint16_t shortaddr, uint32_t device_id, String &response) { free(buf); } -#endif // USE_ZIGBEE +#endif // USE_WEBSERVER && USE_EMULATION && USE_EMULATION_HUE +#endif // USE_ZIGBEE