Merge pull request #16590 from s-hadinger/zigbee_gp_2

Zigbee basic support for Green Power
This commit is contained in:
s-hadinger 2022-09-19 22:57:31 +02:00 committed by GitHub
commit a96274003f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 966 additions and 418 deletions

View File

@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file.
- Command ``SetOption46 0..255`` to add 0..255 * 10 milliseconds power on delay before initializing I/O (#15438)
- Zigbee support for decimal Voltage/Current/Power on power metering plugs
- Command ``UrlFetch <url>`` to download a file to filesystem
- Zigbee basic support for Green Power
### Changed
- ESP32 Increase number of button GPIOs from 8 to 28 (#16518)

View File

@ -619,6 +619,7 @@
#define D_JSON_ZIGBEE_EZSP_SENT "ZbEZSPSent"
#define D_JSON_ZIGBEE_EZSP_SENT_RAW "ZbEZSPSentRaw"
#define D_JSON_ZIGBEEZCL_RECEIVED "ZbZCLReceived"
#define D_JSON_ZIGBEEGP_RECEIVED "ZbGPReceived"
#define D_JSON_ZIGBEEZCL_RAW_RECEIVED "ZbZCLRawReceived"
#define D_JSON_ZIGBEE_DEVICE "Device"
#define D_JSON_ZIGBEE_NAME "Name"

View File

@ -1131,6 +1131,46 @@ enum ZCL_Global_Commands {
ZCL_DISCOVER_ATTRIBUTES_RESPONSE = 0x0d
};
enum ZCL_GP_Commands_Received {
ZGP_NOTIFICATION = 0x00,
ZGP_PAIRING_SEARCH = 0x01,
ZGP_TUNNELING_STOP = 0x03,
ZGP_COMMISSIONING_NOTIFICATION = 0x04,
ZGP_TRANSLATION_TABLE_UPDATE = 0x07,
ZGP_TRANSLATION_TABLE_REQUEST = 0x08,
ZGP_PAIRING_CONFIGURATION = 0x09,
};
enum ZCL_GP_Commands_Generated {
ZGP_NOTIFICATION_RESPONSE = 0x00,
ZGP_PAIRING = 0x01,
ZGP_PROXY_COMMISSIONING_MODE = 0x02,
ZGP_RESPONSE = 0x06,
ZGP_TRANSLATION_TABLE_RESPONSE = 0x08,
};
enum ZCL_GPDF_Cmd {
ZGP_IDENTIFY = 0x00,
ZGP_SCENE_0 = 0x10,
// ...
ZGP_OFF = 0x20,
ZGP_ON = 0x21,
ZGP_TOGGLE = 0x22,
ZGP_RELEASE = 0x23,
ZGP_MOVE_UP = 0x30,
ZGP_MOVE_DOWN = 0x31,
//
//TODO
ZGP_COMMISSIONING = 0xE0,
ZGP_CHANNEL_REQUEST = 0xE3,
// Commands sent to GPD
ZGP_COMMISSIONING_REPLY = 0xF0,
ZGP_WRITE_ATTRIBUTES = 0xF1,
ZGP_READ_ATTRIBUTES = 0xF2,
ZGP_CHANNEL_CONFIGURATION = 0xF3,
};
#define Z_(s) Zo_ ## s
// ZDP Enumeration, see Zigbee spec 2.4.5

View File

@ -369,6 +369,59 @@ const char Z_strings[] PROGMEM =
"FlowMinMeasuredValue" "\x00"
"FlowRate" "\x00"
"FlowTolerance" "\x00"
"GPHueStop" "\x00"
"GPIdentify" "\x00"
"GPLevelStop" "\x00"
"GPLockDoor" "\x00"
"GPMoveColor" "\x00"
"GPMoveDown" "\x00"
"GPMoveDownOnOff" "\x00"
"GPMoveHueDown" "\x00"
"GPMoveHueUp" "\x00"
"GPMoveSatDown" "\x00"
"GPMoveSatUp" "\x00"
"GPMoveUp" "\x00"
"GPMoveUpOnOff" "\x00"
"GPOff" "\x00"
"GPOn" "\x00"
"GPPress1of1" "\x00"
"GPPress1of2" "\x00"
"GPPress2of2" "\x00"
"GPRelease" "\x00"
"GPRelease1of1" "\x00"
"GPRelease1of2" "\x00"
"GPRelease2of2" "\x00"
"GPSatStop" "\x00"
"GPScene0" "\x00"
"GPScene1" "\x00"
"GPScene10" "\x00"
"GPScene11" "\x00"
"GPScene12" "\x00"
"GPScene13" "\x00"
"GPScene14" "\x00"
"GPScene15" "\x00"
"GPScene2" "\x00"
"GPScene3" "\x00"
"GPScene4" "\x00"
"GPScene5" "\x00"
"GPScene6" "\x00"
"GPScene7" "\x00"
"GPScene8" "\x00"
"GPScene9" "\x00"
"GPShortPress1of1" "\x00"
"GPShortPress1of2" "\x00"
"GPShortPress2of2" "\x00"
"GPStepColor" "\x00"
"GPStepDown" "\x00"
"GPStepDownOnOff" "\x00"
"GPStepHueDown" "\x00"
"GPStepHueUp" "\x00"
"GPStepSatDown" "\x00"
"GPStepSatUp" "\x00"
"GPStepUp" "\x00"
"GPStepUpOnOff" "\x00"
"GPToggle" "\x00"
"GPUnlockDoor" "\x00"
"GenericDeviceClass" "\x00"
"GenericDeviceType" "\x00"
"GetAllGroups" "\x00"
@ -1076,416 +1129,469 @@ enum Z_offsets {
Zo_FlowMinMeasuredValue = 5197,
Zo_FlowRate = 5218,
Zo_FlowTolerance = 5227,
Zo_GenericDeviceClass = 5241,
Zo_GenericDeviceType = 5260,
Zo_GetAllGroups = 5278,
Zo_GetGroup = 5291,
Zo_GetSceneMembership = 5300,
Zo_GlassBreak = 5319,
Zo_GroupNameSupport = 5330,
Zo_HVACSystemTypeConfiguration = 5347,
Zo_HWVersion = 5375,
Zo_HarmonicCurrentMultiplier = 5385,
Zo_HighTempDwellTripPoint = 5411,
Zo_HighTempThreshold = 5434,
Zo_Hue = 5452,
Zo_HueMove = 5456,
Zo_HueSat = 5464,
Zo_HueStep = 5471,
Zo_HueStepDown = 5479,
Zo_HueStepUp = 5491,
Zo_Humidity = 5501,
Zo_HumidityMaxMeasuredValue = 5510,
Zo_HumidityMinMeasuredValue = 5535,
Zo_HumidityTolerance = 5560,
Zo_IASCIEAddress = 5578,
Zo_Identify = 5592,
Zo_IdentifyQuery = 5601,
Zo_IdentifyTime = 5615,
Zo_Illuminance = 5628,
Zo_IlluminanceLevelStatus = 5640,
Zo_IlluminanceLightSensorType = 5663,
Zo_IlluminanceMaxMeasuredValue = 5690,
Zo_IlluminanceMinMeasuredValue = 5718,
Zo_IlluminanceTargetLevel = 5746,
Zo_IlluminanceTolerance = 5769,
Zo_InstalledClosedLimitLift = 5790,
Zo_InstalledClosedLimitTilt = 5815,
Zo_InstalledOpenLimitLift = 5840,
Zo_InstalledOpenLimitTilt = 5863,
Zo_IntermediateSetpointsLift = 5886,
Zo_IntermediateSetpointsTilt = 5912,
Zo_IntrinsicBallastFactor = 5938,
Zo_LampAlarmMode = 5961,
Zo_LampBurnHours = 5975,
Zo_LampBurnHoursTripPoint = 5989,
Zo_LampManufacturer = 6012,
Zo_LampRatedHours = 6029,
Zo_LampType = 6044,
Zo_LastConfiguredBy = 6053,
Zo_LastMessageLQI = 6070,
Zo_LastMessageRSSI = 6085,
Zo_LastSetTime = 6101,
Zo_LegrandHeatingMode = 6113,
Zo_LegrandMode = 6132,
Zo_LegrandOpt1 = 6144,
Zo_LegrandOpt2 = 6156,
Zo_LegrandOpt3 = 6168,
Zo_LidlPower = 6180,
Zo_LineCurrent = 6190,
Zo_LineCurrentPhB = 6202,
Zo_LineCurrentPhC = 6217,
Zo_LinkKey = 6232,
Zo_LocalTemperature = 6240,
Zo_LocalTemperatureCalibration = 6257,
Zo_LocalTime = 6285,
Zo_LocationAge = 6295,
Zo_LocationDescription = 6307,
Zo_LocationMethod = 6327,
Zo_LocationPower = 6342,
Zo_LocationType = 6356,
Zo_LockAlarmMask = 6369,
Zo_LockDefaultConfigurationRegister = 6383,
Zo_LockEnableInsideStatusLED = 6416,
Zo_LockEnableLocalProgramming = 6442,
Zo_LockEnableLogging = 6469,
Zo_LockEnableOneTouchLocking = 6487,
Zo_LockEnablePrivacyModeButton = 6513,
Zo_LockKeypadOperationEventMask = 6541,
Zo_LockKeypadProgrammingEventMask = 6570,
Zo_LockLEDSettings = 6601,
Zo_LockLanguage = 6617,
Zo_LockManualOperationEventMask = 6630,
Zo_LockOperatingMode = 6659,
Zo_LockRFIDOperationEventMask = 6677,
Zo_LockRFIDProgrammingEventMask = 6704,
Zo_LockRFOperationEventMask = 6733,
Zo_LockRFProgrammingEventMask = 6758,
Zo_LockSoundVolume = 6785,
Zo_LockState = 6801,
Zo_LockSupportedOperatingModes = 6811,
Zo_LockType = 6839,
Zo_LongPollInterval = 6848,
Zo_LongPollIntervalMin = 6865,
Zo_LowTempDwellTripPoint = 6885,
Zo_LowTempThreshold = 6907,
Zo_MainsAlarmMask = 6924,
Zo_MainsFrequency = 6939,
Zo_MainsVoltage = 6954,
Zo_MainsVoltageDwellTripPoint = 6967,
Zo_MainsVoltageMaxThreshold = 6994,
Zo_MainsVoltageMinThreshold = 7019,
Zo_Manufacturer = 7044,
Zo_MaxCoolSetpointLimit = 7057,
Zo_MaxHeatSetpointLimit = 7078,
Zo_MaxPINCodeLength = 7099,
Zo_MaxProxyTableEntries = 7116,
Zo_MaxRFIDCodeLength = 7137,
Zo_MaxSearchCounter = 7155,
Zo_MaxSinkTableEntries = 7172,
Zo_MaxTempExperienced = 7192,
Zo_Measured11thHarmonicCurrent = 7211,
Zo_Measured1stHarmonicCurrent = 7239,
Zo_Measured3rdHarmonicCurrent = 7266,
Zo_Measured5thHarmonicCurrent = 7293,
Zo_Measured7thHarmonicCurrent = 7320,
Zo_Measured9thHarmonicCurrent = 7347,
Zo_MeasuredPhase11thHarmonicCurrent = 7374,
Zo_MeasuredPhase1stHarmonicCurrent = 7407,
Zo_MeasuredPhase3rdHarmonicCurrent = 7439,
Zo_MeasuredPhase5thHarmonicCurrent = 7471,
Zo_MeasuredPhase7thHarmonicCurrent = 7503,
Zo_MeasuredPhase9thHarmonicCurrent = 7535,
Zo_MeterTypeID = 7567,
Zo_MinCoolSetpointLimit = 7579,
Zo_MinHeatSetpointLimit = 7600,
Zo_MinPINCodeLength = 7621,
Zo_MinRFIDCodeLength = 7638,
Zo_MinSetpointDeadBand = 7656,
Zo_MinTempExperienced = 7676,
Zo_Mode = 7695,
Zo_Model = 7700,
Zo_ModelId = 7706,
Zo_MotorStepSize = 7714,
Zo_Movement = 7728,
Zo_MullerLightMode = 7737,
Zo_MultiApplicationType = 7753,
Zo_MultiDescription = 7774,
Zo_MultiInApplicationType = 7791,
Zo_MultiInDescription = 7814,
Zo_MultiInNumberOfStates = 7833,
Zo_MultiInOutOfService = 7855,
Zo_MultiInReliability = 7875,
Zo_MultiInStatusFlags = 7894,
Zo_MultiInValue = 7913,
Zo_MultiNumberOfStates = 7926,
Zo_MultiOutApplicationType = 7946,
Zo_MultiOutDescription = 7970,
Zo_MultiOutNumberOfStates = 7990,
Zo_MultiOutOfService = 8013,
Zo_MultiOutOutOfService = 8031,
Zo_MultiOutReliability = 8052,
Zo_MultiOutRelinquishDefault = 8072,
Zo_MultiOutStatusFlags = 8098,
Zo_MultiOutValue = 8118,
Zo_MultiReliability = 8132,
Zo_MultiRelinquishDefault = 8149,
Zo_MultiStatusFlags = 8172,
Zo_MultiValue = 8189,
Zo_MultipleScheduling = 8200,
Zo_NeutralCurrent = 8219,
Zo_NotificationRetryNumber = 8234,
Zo_NotificationRetryTimer = 8258,
Zo_NumberOfDevices = 8281,
Zo_NumberOfHolidaySchedulesSupported = 8297,
Zo_NumberOfLogRecordsSupported = 8331,
Zo_NumberOfPINUsersSupported = 8359,
Zo_NumberOfPrimaries = 8385,
Zo_NumberOfRFIDUsersSupported = 8403,
Zo_NumberOfResets = 8430,
Zo_NumberOfTotalUsersSupported = 8445,
Zo_NumberOfWeekDaySchedulesSupportedPerUser = 8473,
Zo_NumberOfYearDaySchedulesSupportedPerUser = 8514,
Zo_NumberOfZoneSensitivityLevelsSupported = 8555,
Zo_NumberRSSIMeasurements = 8594,
Zo_NumberofActuationsLift = 8617,
Zo_NumberofActuationsTilt = 8640,
Zo_Occupancy = 8663,
Zo_OccupancySensorType = 8673,
Zo_OccupiedCoolingSetpoint = 8693,
Zo_OccupiedHeatingSetpoint = 8717,
Zo_OffTransitionTime = 8741,
Zo_OffWaitTime = 8759,
Zo_OnLevel = 8771,
Zo_OnOff = 8779,
Zo_OnOffTransitionTime = 8785,
Zo_OnTime = 8805,
Zo_OnTransitionTime = 8812,
Zo_OpenPeriod = 8829,
Zo_OppleMode = 8840,
Zo_OutdoorTemperature = 8850,
Zo_OverTempTotalDwell = 8869,
Zo_PICoolingDemand = 8888,
Zo_PIHeatingDemand = 8904,
Zo_PIROccupiedToUnoccupiedDelay = 8920,
Zo_PIRUnoccupiedToOccupiedDelay = 8949,
Zo_PIRUnoccupiedToOccupiedThreshold = 8978,
Zo_POD = 9011,
Zo_Panic = 9015,
Zo_PartNumber = 9021,
Zo_PathLossExponent = 9032,
Zo_PersistentMemoryWrites = 9049,
Zo_PersonalAlarm = 9072,
Zo_PhaseHarmonicCurrentMultiplier = 9086,
Zo_PhysicalClosedLimit = 9117,
Zo_PhysicalClosedLimitLift = 9137,
Zo_PhysicalClosedLimitTilt = 9161,
Zo_PhysicalEnvironment = 9185,
Zo_Power = 9205,
Zo_PowerDivisor = 9211,
Zo_PowerFactor = 9224,
Zo_PowerFactorPhB = 9236,
Zo_PowerFactorPhC = 9251,
Zo_PowerMultiplier = 9266,
Zo_PowerOffEffect = 9282,
Zo_PowerOnRecall = 9297,
Zo_PowerOnTimer = 9311,
Zo_PowerSource = 9324,
Zo_PowerThreshold = 9336,
Zo_Pressure = 9351,
Zo_PressureMaxMeasuredValue = 9360,
Zo_PressureMaxScaledValue = 9385,
Zo_PressureMinMeasuredValue = 9408,
Zo_PressureMinScaledValue = 9433,
Zo_PressureScale = 9456,
Zo_PressureScaledTolerance = 9470,
Zo_PressureScaledValue = 9494,
Zo_PressureTolerance = 9514,
Zo_Primary1Intensity = 9532,
Zo_Primary1X = 9550,
Zo_Primary1Y = 9560,
Zo_Primary2Intensity = 9570,
Zo_Primary2X = 9588,
Zo_Primary2Y = 9598,
Zo_Primary3Intensity = 9608,
Zo_Primary3X = 9626,
Zo_Primary3Y = 9636,
Zo_Primary4Intensity = 9646,
Zo_Primary4X = 9664,
Zo_Primary4Y = 9674,
Zo_Primary5Intensity = 9684,
Zo_Primary5X = 9702,
Zo_Primary5Y = 9712,
Zo_Primary6Intensity = 9722,
Zo_Primary6X = 9740,
Zo_Primary6Y = 9750,
Zo_ProductCode = 9760,
Zo_ProductRevision = 9772,
Zo_ProductURL = 9788,
Zo_ProxyTable = 9799,
Zo_QualityMeasure = 9810,
Zo_RGB = 9825,
Zo_RHDehumidificationSetpoint = 9829,
Zo_RMSCurrent = 9856,
Zo_RMSCurrentMax = 9867,
Zo_RMSCurrentMaxPhB = 9881,
Zo_RMSCurrentMaxPhC = 9898,
Zo_RMSCurrentMin = 9915,
Zo_RMSCurrentMinPhB = 9929,
Zo_RMSCurrentMinPhC = 9946,
Zo_RMSCurrentPhB = 9963,
Zo_RMSCurrentPhC = 9977,
Zo_RMSExtremeOverVoltage = 9991,
Zo_RMSExtremeOverVoltagePeriod = 10013,
Zo_RMSExtremeOverVoltagePeriodPhB = 10041,
Zo_RMSExtremeOverVoltagePeriodPhC = 10072,
Zo_RMSExtremeUnderVoltage = 10103,
Zo_RMSExtremeUnderVoltagePeriod = 10126,
Zo_RMSExtremeUnderVoltagePeriodPhB = 10155,
Zo_RMSExtremeUnderVoltagePeriodPhC = 10187,
Zo_RMSVoltage = 10219,
Zo_RMSVoltageMax = 10230,
Zo_RMSVoltageMaxPhB = 10244,
Zo_RMSVoltageMaxPhC = 10261,
Zo_RMSVoltageMin = 10278,
Zo_RMSVoltageMinPhB = 10292,
Zo_RMSVoltageMinPhC = 10309,
Zo_RMSVoltagePhB = 10326,
Zo_RMSVoltagePhC = 10340,
Zo_RMSVoltageSag = 10354,
Zo_RMSVoltageSagPeriod = 10368,
Zo_RMSVoltageSagPeriodPhB = 10388,
Zo_RMSVoltageSagPeriodPhC = 10411,
Zo_RMSVoltageSwell = 10434,
Zo_RMSVoltageSwellPeriod = 10450,
Zo_RMSVoltageSwellPeriodPhB = 10472,
Zo_RMSVoltageSwellPeriodPhC = 10497,
Zo_ReactiveCurrent = 10522,
Zo_ReactiveCurrentPhB = 10538,
Zo_ReactiveCurrentPhC = 10557,
Zo_ReactivePower = 10576,
Zo_ReactivePowerPhB = 10590,
Zo_ReactivePowerPhC = 10607,
Zo_RecallScene = 10624,
Zo_RelativeHumidity = 10636,
Zo_RelativeHumidityDisplay = 10653,
Zo_RelativeHumidityMode = 10677,
Zo_RemainingTime = 10698,
Zo_RemoteSensing = 10712,
Zo_RemoveAllGroups = 10726,
Zo_RemoveAllScenes = 10742,
Zo_RemoveGroup = 10758,
Zo_RemoveScene = 10770,
Zo_ReportingPeriod = 10782,
Zo_ResetAlarm = 10798,
Zo_ResetAllAlarms = 10809,
Zo_SWBuildID = 10824,
Zo_Sat = 10834,
Zo_SatMove = 10838,
Zo_SatStep = 10846,
Zo_SceneCount = 10854,
Zo_SceneNameSupport = 10865,
Zo_SceneValid = 10882,
Zo_ScheduleMode = 10893,
Zo_SeaPressure = 10906,
Zo_SecurityLevel = 10918,
Zo_ServerActiveFunctionality = 10932,
Zo_ServerFunctionality = 10958,
Zo_SharedSecurityKey = 10978,
Zo_SharedSecurityKeyType = 10996,
Zo_ShortPollInterval = 11018,
Zo_Shutter = 11036,
Zo_ShutterClose = 11044,
Zo_ShutterLift = 11057,
Zo_ShutterOpen = 11069,
Zo_ShutterStop = 11081,
Zo_ShutterTilt = 11093,
Zo_SinkTable = 11105,
Zo_SoftwareRevision = 11115,
Zo_StackVersion = 11132,
Zo_StandardTime = 11145,
Zo_StartUpOnOff = 11158,
Zo_Status = 11171,
Zo_StoreScene = 11178,
Zo_SwitchActions = 11189,
Zo_SwitchType = 11203,
Zo_SystemMode = 11214,
Zo_TRVBoost = 11225,
Zo_TRVChildProtection = 11234,
Zo_TRVMirrorDisplay = 11253,
Zo_TRVMode = 11270,
Zo_TRVWindowOpen = 11278,
Zo_TempTarget = 11292,
Zo_Temperature = 11303,
Zo_TemperatureDisplayMode = 11315,
Zo_TemperatureMaxMeasuredValue = 11338,
Zo_TemperatureMinMeasuredValue = 11366,
Zo_TemperatureTolerance = 11394,
Zo_TerncyDuration = 11415,
Zo_TerncyRotate = 11430,
Zo_ThSetpoint = 11443,
Zo_ThermostatAlarmMask = 11454,
Zo_ThermostatKeypadLockout = 11474,
Zo_ThermostatOccupancy = 11498,
Zo_ThermostatRunningMode = 11518,
Zo_ThermostatScheduleProgrammingVisibility = 11540,
Zo_Time = 11580,
Zo_TimeEpoch = 11585,
Zo_TimeStatus = 11595,
Zo_TimeZone = 11606,
Zo_TotalActivePower = 11615,
Zo_TotalApparentPower = 11632,
Zo_TotalProfileNum = 11651,
Zo_TotalReactivePower = 11667,
Zo_TuyaCalibration = 11686,
Zo_TuyaCalibrationTime = 11702,
Zo_TuyaMCUVersion = 11722,
Zo_TuyaMotorReversal = 11737,
Zo_TuyaMovingState = 11755,
Zo_TuyaQuery = 11771,
Zo_UnoccupiedCoolingSetpoint = 11781,
Zo_UnoccupiedHeatingSetpoint = 11807,
Zo_UtilityName = 11833,
Zo_ValidUntilTime = 11845,
Zo_ValvePosition = 11860,
Zo_VelocityLift = 11874,
Zo_ViewGroup = 11887,
Zo_ViewScene = 11897,
Zo_Water = 11907,
Zo_WhitePointX = 11913,
Zo_WhitePointY = 11925,
Zo_WindowCoveringType = 11937,
Zo_X = 11956,
Zo_Y = 11958,
Zo_ZCLVersion = 11960,
Zo_ZoneID = 11971,
Zo_ZoneState = 11978,
Zo_ZoneStatus = 11988,
Zo_ZoneStatusChange = 11999,
Zo_ZoneType = 12016,
Zo__ = 12025,
Zo_xx = 12027,
Zo_xx000A00 = 12030,
Zo_xx0A = 12039,
Zo_xx0A00 = 12044,
Zo_xx19 = 12051,
Zo_xx190A = 12056,
Zo_xx190A00 = 12063,
Zo_xxxx = 12072,
Zo_xxxx00 = 12077,
Zo_xxxx0A00 = 12084,
Zo_xxxxyy = 12093,
Zo_xxxxyyyy = 12100,
Zo_xxxxyyyy0A00 = 12109,
Zo_xxxxyyzz = 12122,
Zo_xxyy = 12131,
Zo_xxyy0A00 = 12136,
Zo_xxyyyy = 12145,
Zo_xxyyyy000000000000 = 12152,
Zo_xxyyyy0A0000000000 = 12171,
Zo_xxyyyyzz = 12190,
Zo_xxyyyyzzzz = 12199,
Zo_xxyyzzzz = 12210,
Zo_GPHueStop = 5241,
Zo_GPIdentify = 5251,
Zo_GPLevelStop = 5262,
Zo_GPLockDoor = 5274,
Zo_GPMoveColor = 5285,
Zo_GPMoveDown = 5297,
Zo_GPMoveDownOnOff = 5308,
Zo_GPMoveHueDown = 5324,
Zo_GPMoveHueUp = 5338,
Zo_GPMoveSatDown = 5350,
Zo_GPMoveSatUp = 5364,
Zo_GPMoveUp = 5376,
Zo_GPMoveUpOnOff = 5385,
Zo_GPOff = 5399,
Zo_GPOn = 5405,
Zo_GPPress1of1 = 5410,
Zo_GPPress1of2 = 5422,
Zo_GPPress2of2 = 5434,
Zo_GPRelease = 5446,
Zo_GPRelease1of1 = 5456,
Zo_GPRelease1of2 = 5470,
Zo_GPRelease2of2 = 5484,
Zo_GPSatStop = 5498,
Zo_GPScene0 = 5508,
Zo_GPScene1 = 5517,
Zo_GPScene10 = 5526,
Zo_GPScene11 = 5536,
Zo_GPScene12 = 5546,
Zo_GPScene13 = 5556,
Zo_GPScene14 = 5566,
Zo_GPScene15 = 5576,
Zo_GPScene2 = 5586,
Zo_GPScene3 = 5595,
Zo_GPScene4 = 5604,
Zo_GPScene5 = 5613,
Zo_GPScene6 = 5622,
Zo_GPScene7 = 5631,
Zo_GPScene8 = 5640,
Zo_GPScene9 = 5649,
Zo_GPShortPress1of1 = 5658,
Zo_GPShortPress1of2 = 5675,
Zo_GPShortPress2of2 = 5692,
Zo_GPStepColor = 5709,
Zo_GPStepDown = 5721,
Zo_GPStepDownOnOff = 5732,
Zo_GPStepHueDown = 5748,
Zo_GPStepHueUp = 5762,
Zo_GPStepSatDown = 5774,
Zo_GPStepSatUp = 5788,
Zo_GPStepUp = 5800,
Zo_GPStepUpOnOff = 5809,
Zo_GPToggle = 5823,
Zo_GPUnlockDoor = 5832,
Zo_GenericDeviceClass = 5845,
Zo_GenericDeviceType = 5864,
Zo_GetAllGroups = 5882,
Zo_GetGroup = 5895,
Zo_GetSceneMembership = 5904,
Zo_GlassBreak = 5923,
Zo_GroupNameSupport = 5934,
Zo_HVACSystemTypeConfiguration = 5951,
Zo_HWVersion = 5979,
Zo_HarmonicCurrentMultiplier = 5989,
Zo_HighTempDwellTripPoint = 6015,
Zo_HighTempThreshold = 6038,
Zo_Hue = 6056,
Zo_HueMove = 6060,
Zo_HueSat = 6068,
Zo_HueStep = 6075,
Zo_HueStepDown = 6083,
Zo_HueStepUp = 6095,
Zo_Humidity = 6105,
Zo_HumidityMaxMeasuredValue = 6114,
Zo_HumidityMinMeasuredValue = 6139,
Zo_HumidityTolerance = 6164,
Zo_IASCIEAddress = 6182,
Zo_Identify = 6196,
Zo_IdentifyQuery = 6205,
Zo_IdentifyTime = 6219,
Zo_Illuminance = 6232,
Zo_IlluminanceLevelStatus = 6244,
Zo_IlluminanceLightSensorType = 6267,
Zo_IlluminanceMaxMeasuredValue = 6294,
Zo_IlluminanceMinMeasuredValue = 6322,
Zo_IlluminanceTargetLevel = 6350,
Zo_IlluminanceTolerance = 6373,
Zo_InstalledClosedLimitLift = 6394,
Zo_InstalledClosedLimitTilt = 6419,
Zo_InstalledOpenLimitLift = 6444,
Zo_InstalledOpenLimitTilt = 6467,
Zo_IntermediateSetpointsLift = 6490,
Zo_IntermediateSetpointsTilt = 6516,
Zo_IntrinsicBallastFactor = 6542,
Zo_LampAlarmMode = 6565,
Zo_LampBurnHours = 6579,
Zo_LampBurnHoursTripPoint = 6593,
Zo_LampManufacturer = 6616,
Zo_LampRatedHours = 6633,
Zo_LampType = 6648,
Zo_LastConfiguredBy = 6657,
Zo_LastMessageLQI = 6674,
Zo_LastMessageRSSI = 6689,
Zo_LastSetTime = 6705,
Zo_LegrandHeatingMode = 6717,
Zo_LegrandMode = 6736,
Zo_LegrandOpt1 = 6748,
Zo_LegrandOpt2 = 6760,
Zo_LegrandOpt3 = 6772,
Zo_LidlPower = 6784,
Zo_LineCurrent = 6794,
Zo_LineCurrentPhB = 6806,
Zo_LineCurrentPhC = 6821,
Zo_LinkKey = 6836,
Zo_LocalTemperature = 6844,
Zo_LocalTemperatureCalibration = 6861,
Zo_LocalTime = 6889,
Zo_LocationAge = 6899,
Zo_LocationDescription = 6911,
Zo_LocationMethod = 6931,
Zo_LocationPower = 6946,
Zo_LocationType = 6960,
Zo_LockAlarmMask = 6973,
Zo_LockDefaultConfigurationRegister = 6987,
Zo_LockEnableInsideStatusLED = 7020,
Zo_LockEnableLocalProgramming = 7046,
Zo_LockEnableLogging = 7073,
Zo_LockEnableOneTouchLocking = 7091,
Zo_LockEnablePrivacyModeButton = 7117,
Zo_LockKeypadOperationEventMask = 7145,
Zo_LockKeypadProgrammingEventMask = 7174,
Zo_LockLEDSettings = 7205,
Zo_LockLanguage = 7221,
Zo_LockManualOperationEventMask = 7234,
Zo_LockOperatingMode = 7263,
Zo_LockRFIDOperationEventMask = 7281,
Zo_LockRFIDProgrammingEventMask = 7308,
Zo_LockRFOperationEventMask = 7337,
Zo_LockRFProgrammingEventMask = 7362,
Zo_LockSoundVolume = 7389,
Zo_LockState = 7405,
Zo_LockSupportedOperatingModes = 7415,
Zo_LockType = 7443,
Zo_LongPollInterval = 7452,
Zo_LongPollIntervalMin = 7469,
Zo_LowTempDwellTripPoint = 7489,
Zo_LowTempThreshold = 7511,
Zo_MainsAlarmMask = 7528,
Zo_MainsFrequency = 7543,
Zo_MainsVoltage = 7558,
Zo_MainsVoltageDwellTripPoint = 7571,
Zo_MainsVoltageMaxThreshold = 7598,
Zo_MainsVoltageMinThreshold = 7623,
Zo_Manufacturer = 7648,
Zo_MaxCoolSetpointLimit = 7661,
Zo_MaxHeatSetpointLimit = 7682,
Zo_MaxPINCodeLength = 7703,
Zo_MaxProxyTableEntries = 7720,
Zo_MaxRFIDCodeLength = 7741,
Zo_MaxSearchCounter = 7759,
Zo_MaxSinkTableEntries = 7776,
Zo_MaxTempExperienced = 7796,
Zo_Measured11thHarmonicCurrent = 7815,
Zo_Measured1stHarmonicCurrent = 7843,
Zo_Measured3rdHarmonicCurrent = 7870,
Zo_Measured5thHarmonicCurrent = 7897,
Zo_Measured7thHarmonicCurrent = 7924,
Zo_Measured9thHarmonicCurrent = 7951,
Zo_MeasuredPhase11thHarmonicCurrent = 7978,
Zo_MeasuredPhase1stHarmonicCurrent = 8011,
Zo_MeasuredPhase3rdHarmonicCurrent = 8043,
Zo_MeasuredPhase5thHarmonicCurrent = 8075,
Zo_MeasuredPhase7thHarmonicCurrent = 8107,
Zo_MeasuredPhase9thHarmonicCurrent = 8139,
Zo_MeterTypeID = 8171,
Zo_MinCoolSetpointLimit = 8183,
Zo_MinHeatSetpointLimit = 8204,
Zo_MinPINCodeLength = 8225,
Zo_MinRFIDCodeLength = 8242,
Zo_MinSetpointDeadBand = 8260,
Zo_MinTempExperienced = 8280,
Zo_Mode = 8299,
Zo_Model = 8304,
Zo_ModelId = 8310,
Zo_MotorStepSize = 8318,
Zo_Movement = 8332,
Zo_MullerLightMode = 8341,
Zo_MultiApplicationType = 8357,
Zo_MultiDescription = 8378,
Zo_MultiInApplicationType = 8395,
Zo_MultiInDescription = 8418,
Zo_MultiInNumberOfStates = 8437,
Zo_MultiInOutOfService = 8459,
Zo_MultiInReliability = 8479,
Zo_MultiInStatusFlags = 8498,
Zo_MultiInValue = 8517,
Zo_MultiNumberOfStates = 8530,
Zo_MultiOutApplicationType = 8550,
Zo_MultiOutDescription = 8574,
Zo_MultiOutNumberOfStates = 8594,
Zo_MultiOutOfService = 8617,
Zo_MultiOutOutOfService = 8635,
Zo_MultiOutReliability = 8656,
Zo_MultiOutRelinquishDefault = 8676,
Zo_MultiOutStatusFlags = 8702,
Zo_MultiOutValue = 8722,
Zo_MultiReliability = 8736,
Zo_MultiRelinquishDefault = 8753,
Zo_MultiStatusFlags = 8776,
Zo_MultiValue = 8793,
Zo_MultipleScheduling = 8804,
Zo_NeutralCurrent = 8823,
Zo_NotificationRetryNumber = 8838,
Zo_NotificationRetryTimer = 8862,
Zo_NumberOfDevices = 8885,
Zo_NumberOfHolidaySchedulesSupported = 8901,
Zo_NumberOfLogRecordsSupported = 8935,
Zo_NumberOfPINUsersSupported = 8963,
Zo_NumberOfPrimaries = 8989,
Zo_NumberOfRFIDUsersSupported = 9007,
Zo_NumberOfResets = 9034,
Zo_NumberOfTotalUsersSupported = 9049,
Zo_NumberOfWeekDaySchedulesSupportedPerUser = 9077,
Zo_NumberOfYearDaySchedulesSupportedPerUser = 9118,
Zo_NumberOfZoneSensitivityLevelsSupported = 9159,
Zo_NumberRSSIMeasurements = 9198,
Zo_NumberofActuationsLift = 9221,
Zo_NumberofActuationsTilt = 9244,
Zo_Occupancy = 9267,
Zo_OccupancySensorType = 9277,
Zo_OccupiedCoolingSetpoint = 9297,
Zo_OccupiedHeatingSetpoint = 9321,
Zo_OffTransitionTime = 9345,
Zo_OffWaitTime = 9363,
Zo_OnLevel = 9375,
Zo_OnOff = 9383,
Zo_OnOffTransitionTime = 9389,
Zo_OnTime = 9409,
Zo_OnTransitionTime = 9416,
Zo_OpenPeriod = 9433,
Zo_OppleMode = 9444,
Zo_OutdoorTemperature = 9454,
Zo_OverTempTotalDwell = 9473,
Zo_PICoolingDemand = 9492,
Zo_PIHeatingDemand = 9508,
Zo_PIROccupiedToUnoccupiedDelay = 9524,
Zo_PIRUnoccupiedToOccupiedDelay = 9553,
Zo_PIRUnoccupiedToOccupiedThreshold = 9582,
Zo_POD = 9615,
Zo_Panic = 9619,
Zo_PartNumber = 9625,
Zo_PathLossExponent = 9636,
Zo_PersistentMemoryWrites = 9653,
Zo_PersonalAlarm = 9676,
Zo_PhaseHarmonicCurrentMultiplier = 9690,
Zo_PhysicalClosedLimit = 9721,
Zo_PhysicalClosedLimitLift = 9741,
Zo_PhysicalClosedLimitTilt = 9765,
Zo_PhysicalEnvironment = 9789,
Zo_Power = 9809,
Zo_PowerDivisor = 9815,
Zo_PowerFactor = 9828,
Zo_PowerFactorPhB = 9840,
Zo_PowerFactorPhC = 9855,
Zo_PowerMultiplier = 9870,
Zo_PowerOffEffect = 9886,
Zo_PowerOnRecall = 9901,
Zo_PowerOnTimer = 9915,
Zo_PowerSource = 9928,
Zo_PowerThreshold = 9940,
Zo_Pressure = 9955,
Zo_PressureMaxMeasuredValue = 9964,
Zo_PressureMaxScaledValue = 9989,
Zo_PressureMinMeasuredValue = 10012,
Zo_PressureMinScaledValue = 10037,
Zo_PressureScale = 10060,
Zo_PressureScaledTolerance = 10074,
Zo_PressureScaledValue = 10098,
Zo_PressureTolerance = 10118,
Zo_Primary1Intensity = 10136,
Zo_Primary1X = 10154,
Zo_Primary1Y = 10164,
Zo_Primary2Intensity = 10174,
Zo_Primary2X = 10192,
Zo_Primary2Y = 10202,
Zo_Primary3Intensity = 10212,
Zo_Primary3X = 10230,
Zo_Primary3Y = 10240,
Zo_Primary4Intensity = 10250,
Zo_Primary4X = 10268,
Zo_Primary4Y = 10278,
Zo_Primary5Intensity = 10288,
Zo_Primary5X = 10306,
Zo_Primary5Y = 10316,
Zo_Primary6Intensity = 10326,
Zo_Primary6X = 10344,
Zo_Primary6Y = 10354,
Zo_ProductCode = 10364,
Zo_ProductRevision = 10376,
Zo_ProductURL = 10392,
Zo_ProxyTable = 10403,
Zo_QualityMeasure = 10414,
Zo_RGB = 10429,
Zo_RHDehumidificationSetpoint = 10433,
Zo_RMSCurrent = 10460,
Zo_RMSCurrentMax = 10471,
Zo_RMSCurrentMaxPhB = 10485,
Zo_RMSCurrentMaxPhC = 10502,
Zo_RMSCurrentMin = 10519,
Zo_RMSCurrentMinPhB = 10533,
Zo_RMSCurrentMinPhC = 10550,
Zo_RMSCurrentPhB = 10567,
Zo_RMSCurrentPhC = 10581,
Zo_RMSExtremeOverVoltage = 10595,
Zo_RMSExtremeOverVoltagePeriod = 10617,
Zo_RMSExtremeOverVoltagePeriodPhB = 10645,
Zo_RMSExtremeOverVoltagePeriodPhC = 10676,
Zo_RMSExtremeUnderVoltage = 10707,
Zo_RMSExtremeUnderVoltagePeriod = 10730,
Zo_RMSExtremeUnderVoltagePeriodPhB = 10759,
Zo_RMSExtremeUnderVoltagePeriodPhC = 10791,
Zo_RMSVoltage = 10823,
Zo_RMSVoltageMax = 10834,
Zo_RMSVoltageMaxPhB = 10848,
Zo_RMSVoltageMaxPhC = 10865,
Zo_RMSVoltageMin = 10882,
Zo_RMSVoltageMinPhB = 10896,
Zo_RMSVoltageMinPhC = 10913,
Zo_RMSVoltagePhB = 10930,
Zo_RMSVoltagePhC = 10944,
Zo_RMSVoltageSag = 10958,
Zo_RMSVoltageSagPeriod = 10972,
Zo_RMSVoltageSagPeriodPhB = 10992,
Zo_RMSVoltageSagPeriodPhC = 11015,
Zo_RMSVoltageSwell = 11038,
Zo_RMSVoltageSwellPeriod = 11054,
Zo_RMSVoltageSwellPeriodPhB = 11076,
Zo_RMSVoltageSwellPeriodPhC = 11101,
Zo_ReactiveCurrent = 11126,
Zo_ReactiveCurrentPhB = 11142,
Zo_ReactiveCurrentPhC = 11161,
Zo_ReactivePower = 11180,
Zo_ReactivePowerPhB = 11194,
Zo_ReactivePowerPhC = 11211,
Zo_RecallScene = 11228,
Zo_RelativeHumidity = 11240,
Zo_RelativeHumidityDisplay = 11257,
Zo_RelativeHumidityMode = 11281,
Zo_RemainingTime = 11302,
Zo_RemoteSensing = 11316,
Zo_RemoveAllGroups = 11330,
Zo_RemoveAllScenes = 11346,
Zo_RemoveGroup = 11362,
Zo_RemoveScene = 11374,
Zo_ReportingPeriod = 11386,
Zo_ResetAlarm = 11402,
Zo_ResetAllAlarms = 11413,
Zo_SWBuildID = 11428,
Zo_Sat = 11438,
Zo_SatMove = 11442,
Zo_SatStep = 11450,
Zo_SceneCount = 11458,
Zo_SceneNameSupport = 11469,
Zo_SceneValid = 11486,
Zo_ScheduleMode = 11497,
Zo_SeaPressure = 11510,
Zo_SecurityLevel = 11522,
Zo_ServerActiveFunctionality = 11536,
Zo_ServerFunctionality = 11562,
Zo_SharedSecurityKey = 11582,
Zo_SharedSecurityKeyType = 11600,
Zo_ShortPollInterval = 11622,
Zo_Shutter = 11640,
Zo_ShutterClose = 11648,
Zo_ShutterLift = 11661,
Zo_ShutterOpen = 11673,
Zo_ShutterStop = 11685,
Zo_ShutterTilt = 11697,
Zo_SinkTable = 11709,
Zo_SoftwareRevision = 11719,
Zo_StackVersion = 11736,
Zo_StandardTime = 11749,
Zo_StartUpOnOff = 11762,
Zo_Status = 11775,
Zo_StoreScene = 11782,
Zo_SwitchActions = 11793,
Zo_SwitchType = 11807,
Zo_SystemMode = 11818,
Zo_TRVBoost = 11829,
Zo_TRVChildProtection = 11838,
Zo_TRVMirrorDisplay = 11857,
Zo_TRVMode = 11874,
Zo_TRVWindowOpen = 11882,
Zo_TempTarget = 11896,
Zo_Temperature = 11907,
Zo_TemperatureDisplayMode = 11919,
Zo_TemperatureMaxMeasuredValue = 11942,
Zo_TemperatureMinMeasuredValue = 11970,
Zo_TemperatureTolerance = 11998,
Zo_TerncyDuration = 12019,
Zo_TerncyRotate = 12034,
Zo_ThSetpoint = 12047,
Zo_ThermostatAlarmMask = 12058,
Zo_ThermostatKeypadLockout = 12078,
Zo_ThermostatOccupancy = 12102,
Zo_ThermostatRunningMode = 12122,
Zo_ThermostatScheduleProgrammingVisibility = 12144,
Zo_Time = 12184,
Zo_TimeEpoch = 12189,
Zo_TimeStatus = 12199,
Zo_TimeZone = 12210,
Zo_TotalActivePower = 12219,
Zo_TotalApparentPower = 12236,
Zo_TotalProfileNum = 12255,
Zo_TotalReactivePower = 12271,
Zo_TuyaCalibration = 12290,
Zo_TuyaCalibrationTime = 12306,
Zo_TuyaMCUVersion = 12326,
Zo_TuyaMotorReversal = 12341,
Zo_TuyaMovingState = 12359,
Zo_TuyaQuery = 12375,
Zo_UnoccupiedCoolingSetpoint = 12385,
Zo_UnoccupiedHeatingSetpoint = 12411,
Zo_UtilityName = 12437,
Zo_ValidUntilTime = 12449,
Zo_ValvePosition = 12464,
Zo_VelocityLift = 12478,
Zo_ViewGroup = 12491,
Zo_ViewScene = 12501,
Zo_Water = 12511,
Zo_WhitePointX = 12517,
Zo_WhitePointY = 12529,
Zo_WindowCoveringType = 12541,
Zo_X = 12560,
Zo_Y = 12562,
Zo_ZCLVersion = 12564,
Zo_ZoneID = 12575,
Zo_ZoneState = 12582,
Zo_ZoneStatus = 12592,
Zo_ZoneStatusChange = 12603,
Zo_ZoneType = 12620,
Zo__ = 12629,
Zo_xx = 12631,
Zo_xx000A00 = 12634,
Zo_xx0A = 12643,
Zo_xx0A00 = 12648,
Zo_xx19 = 12655,
Zo_xx190A = 12660,
Zo_xx190A00 = 12667,
Zo_xxxx = 12676,
Zo_xxxx00 = 12681,
Zo_xxxx0A00 = 12688,
Zo_xxxxyy = 12697,
Zo_xxxxyyyy = 12704,
Zo_xxxxyyyy0A00 = 12713,
Zo_xxxxyyzz = 12726,
Zo_xxyy = 12735,
Zo_xxyy0A00 = 12740,
Zo_xxyyyy = 12749,
Zo_xxyyyy000000000000 = 12756,
Zo_xxyyyy0A0000000000 = 12775,
Zo_xxyyyyzz = 12794,
Zo_xxyyyyzzzz = 12803,
Zo_xxyyzzzz = 12814,
};

View File

@ -753,6 +753,7 @@ const Z_AttributeConverter Z_PostProcess[] PROGMEM = {
{ Zuint16, Cx0020, 0x0006, Z_(FastPollTimeoutMax), Cm1, 0 },
// Green Power
// Server attributes
{ Zuint8, Cx0021, 0x0000, Z_(MaxSinkTableEntries), Cm1, 0 },
{ Zoctstr16,Cx0021, 0x0001, Z_(SinkTable), Cm1, 0 },
{ Zmap8, Cx0021, 0x0002, Z_(CommunicationMode), Cm1, 0 },
@ -769,6 +770,7 @@ const Z_AttributeConverter Z_PostProcess[] PROGMEM = {
{ Zoctstr16,Cx0021, 0x0015, Z_(BlockedGPDID), Cm1, 0 },
{ Zmap24, Cx0021, 0x0016, Z_(ClientFunctionality), Cm1, 0 },
{ Zmap24, Cx0021, 0x0017, Z_(ClientActiveFunctionality), Cm1, 0 },
// Shared by Server and Client
{ Zmap8, Cx0021, 0x0020, Z_(SharedSecurityKeyType),Cm1, 0 },
{ Zkey128, Cx0021, 0x0021, Z_(SharedSecurityKey), Cm1, 0 },
{ Zkey128, Cx0021, 0x0022, Z_(LinkKey), Cm1, 0 },

View File

@ -1127,6 +1127,14 @@ void ZCLFrame::parseClusterSpecificCommand(Z_attribute_list& attr_list) {
device.debounce_transact = transactseq;
zigbee_devices.setTimer(shortaddr, 0 /* groupaddr */, USE_ZIGBEE_DEBOUNCE_COMMANDS, 0 /*clusterid*/, srcendpoint, Z_CAT_DEBOUNCE_CMD, 0, &Z_ResetDebounce);
bool cmd_parsed = false;
if (srcendpoint == 0xF2 && dstendpoint == 0xF2 && cluster == 0x0021) {
// handle Green Power commands
cmd_parsed = convertGPSpecific(attr_list, cmd, direction, shortaddr, _wasbroadcast, payload);
}
// was it successfully parsed already?
if (!cmd_parsed) {
// handle normal commands
convertClusterSpecific(attr_list, cluster, cmd, direction, shortaddr, srcendpoint, payload);
if (!Settings->flag5.zb_disable_autoquery) {
// read attributes unless disabled
@ -1137,7 +1145,8 @@ void ZCLFrame::parseClusterSpecificCommand(Z_attribute_list& attr_list) {
}
}
}
// Send Default Response to acknowledge the attribute reporting
}
// Send Default Response to acknowledge the command
if (0 == _frame_control.b.disable_def_resp) {
// the device expects a default response
ZCLFrame zcl(2); // message is 4 bytes

View File

@ -145,6 +145,60 @@ const Z_CommandConverter Z_Commands[] PROGMEM = {
{ Z_(), 0xEF00, 0xFF, 0x83, Z_() }, // capture any command in 0xEF00 cluster
// Terncy specific
{ Z_(), 0xFCCC, 0x00, 0x82, Z_(xxyy) }, // Terncy button (multi-)press
// Green Power - for display only
{ Z_(GPIdentify), 0xF021, 0x00, 0x01, Z_() },
{ Z_(GPScene0), 0xF021, 0x10, 0x01, Z_() },
{ Z_(GPScene1), 0xF021, 0x11, 0x01, Z_() },
{ Z_(GPScene2), 0xF021, 0x12, 0x01, Z_() },
{ Z_(GPScene3), 0xF021, 0x13, 0x01, Z_() },
{ Z_(GPScene4), 0xF021, 0x14, 0x01, Z_() },
{ Z_(GPScene5), 0xF021, 0x15, 0x01, Z_() },
{ Z_(GPScene6), 0xF021, 0x16, 0x01, Z_() },
{ Z_(GPScene7), 0xF021, 0x17, 0x01, Z_() },
{ Z_(GPScene8), 0xF021, 0x18, 0x01, Z_() },
{ Z_(GPScene9), 0xF021, 0x19, 0x01, Z_() },
{ Z_(GPScene10), 0xF021, 0x1A, 0x01, Z_() },
{ Z_(GPScene11), 0xF021, 0x1B, 0x01, Z_() },
{ Z_(GPScene12), 0xF021, 0x1C, 0x01, Z_() },
{ Z_(GPScene13), 0xF021, 0x1D, 0x01, Z_() },
{ Z_(GPScene14), 0xF021, 0x1E, 0x01, Z_() },
{ Z_(GPScene15), 0xF021, 0x1F, 0x01, Z_() },
{ Z_(GPOff), 0xF021, 0x20, 0x01, Z_() },
{ Z_(GPOn), 0xF021, 0x21, 0x01, Z_() },
{ Z_(GPToggle), 0xF021, 0x22, 0x01, Z_() },
{ Z_(GPRelease), 0xF021, 0x23, 0x01, Z_() },
{ Z_(GPMoveUp), 0xF021, 0x30, 0x01, Z_(xx) },
{ Z_(GPMoveDown), 0xF021, 0x31, 0x01, Z_(xx) },
{ Z_(GPStepUp), 0xF021, 0x32, 0x01, Z_(xx) },
{ Z_(GPStepDown), 0xF021, 0x33, 0x01, Z_(xx) },
{ Z_(GPLevelStop), 0xF021, 0x34, 0x01, Z_() },
{ Z_(GPMoveUpOnOff), 0xF021, 0x35, 0x01, Z_(xx) },
{ Z_(GPMoveDownOnOff),0xF021, 0x36, 0x01, Z_(xx) },
{ Z_(GPStepUpOnOff), 0xF021, 0x37, 0x01, Z_(xx) },
{ Z_(GPStepDownOnOff),0xF021, 0x38, 0x01, Z_(xx) },
{ Z_(GPHueStop), 0xF021, 0x40, 0x01, Z_() },
{ Z_(GPMoveHueUp), 0xF021, 0x41, 0x01, Z_(xx) },
{ Z_(GPMoveHueDown), 0xF021, 0x42, 0x01, Z_(xx) },
{ Z_(GPStepHueUp), 0xF021, 0x43, 0x01, Z_(xx) },
{ Z_(GPStepHueDown), 0xF021, 0x44, 0x01, Z_(xx) },
{ Z_(GPSatStop), 0xF021, 0x45, 0x01, Z_() },
{ Z_(GPMoveSatUp), 0xF021, 0x46, 0x01, Z_(xx) },
{ Z_(GPMoveSatDown), 0xF021, 0x47, 0x01, Z_(xx) },
{ Z_(GPStepSatUp), 0xF021, 0x48, 0x01, Z_(xx) },
{ Z_(GPStepSatDown), 0xF021, 0x49, 0x01, Z_(xx) },
{ Z_(GPMoveColor), 0xF021, 0x4A, 0x01, Z_(xxxxyyyy) },
{ Z_(GPStepColor), 0xF021, 0x4B, 0x01, Z_(xxxxyyyy) },
{ Z_(GPLockDoor), 0xF021, 0x50, 0x01, Z_() },
{ Z_(GPUnlockDoor), 0xF021, 0x51, 0x01, Z_() },
{ Z_(GPPress1of1), 0xF021, 0x60, 0x01, Z_() },
{ Z_(GPRelease1of1), 0xF021, 0x61, 0x01, Z_() },
{ Z_(GPPress1of2), 0xF021, 0x62, 0x01, Z_() },
{ Z_(GPRelease1of2), 0xF021, 0x63, 0x01, Z_() },
{ Z_(GPPress2of2), 0xF021, 0x64, 0x01, Z_() },
{ Z_(GPRelease2of2), 0xF021, 0x65, 0x01, Z_() },
{ Z_(GPShortPress1of1),0xF021, 0x66, 0x01, Z_() },
{ Z_(GPShortPress1of2),0xF021, 0x67, 0x01, Z_() },
{ Z_(GPShortPress2of2),0xF021, 0x68, 0x01, Z_() },
};
/*********************************************************************************************\
@ -283,7 +337,6 @@ void parseXYZ(const char *model, const SBuffer &payload, struct Z_XYZ_Var *xyz)
}
}
// Parse a cluster specific command, and try to convert into human readable
void convertClusterSpecific(class Z_attribute_list &attr_list, uint16_t cluster, uint8_t cmd, bool direction, uint16_t shortaddr, uint8_t srcendpoint, const SBuffer &payload) {
const char * command_name = nullptr;

View File

@ -0,0 +1,336 @@
/*
xdrv_23_zigbee_8_1_greenpower.ino - zigbee support for Tasmota
Copyright (C) 2021 Theo Arends and Stephan Hadinger
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef USE_ZIGBEE
bool convertGPDF_data(class Z_attribute_list &attr_list, uint16_t shortaddr, uint8_t gpcmd, bool wasbroadcast, const SBuffer &payload, size_t payload_start, size_t payload_len) {
bool parsed = false;
// register the raw command in synthetic cluster 0xF021 corresponding to the GPDF command
SBuffer gppayload = payload.subBuffer(payload_start, payload_len);
convertClusterSpecific(attr_list, 0xF021, gpcmd, false, shortaddr, 0xF2, gppayload);
uint16_t cluster = 0xFFFF;
uint8_t cmd = 0xFF;
SBuffer arg(8);
// arguments pre-munched
uint8_t arg8 = (payload_len > 0) ? payload.get8(payload_start) : 0xFF;
uint16_t arg16 = (payload_len > 1) ? payload.get16(payload_start) : 0xFFFF;
uint16_t arg16_1 = (payload_len > 2) ? payload.get16(payload_start + 1) : 0xFFFF; // moved by 1 bytes
uint32_t arg32 = (payload_len > 3) ? payload.get32(payload_start) : 0xFFFFFFFF;
switch (gpcmd) {
case 0x00: cluster = 0x0003; cmd = 0x00; arg.add16(0x003C); break; // Identify - Identify - 0x003C
case 0x10 ... 0x1F: cluster = 0x0005; cmd = 0x01; arg.add8(gpcmd - 0x10); break; // Scenes - View Scene
case 0x20: cluster = 0x0006; cmd = 0x00; break; // OnOff - Off
case 0x21: cluster = 0x0006; cmd = 0x01; break; // OnOff - On
case 0x22: cluster = 0x0006; cmd = 0x02; break; // OnOff - Toggle
case 0x23: break; // Release
case 0x30: cluster = 0x0008; cmd = 0x01; arg.add8(0x00); arg.add8(arg8); break; // Level Control - Move - Up, rate=arg8
case 0x31: cluster = 0x0008; cmd = 0x01; arg.add8(0x01); arg.add8(arg8); break; // Level Control - Move - Down, rate=arg8
case 0x32: cluster = 0x0008; cmd = 0x02; arg.add8(0x00); arg.add8(arg8); arg.add16(arg16); break; // Level Control - Step - Up, step size=arg8, rate=arg16 (opt)
case 0x33: cluster = 0x0008; cmd = 0x02; arg.add8(0x01); arg.add8(arg8); arg.add16(arg16); break; // Level Control - Step - Down, step size=arg8, rate=arg16 (opt)
case 0x34: cluster = 0x0008; cmd = 0x03; break; // Level Control - Stop
case 0x35: cluster = 0x0008; cmd = 0x05; arg.add8(0x00); arg.add8(arg8); break; // Level Control - Move - Up, rate=arg8
case 0x36: cluster = 0x0008; cmd = 0x05; arg.add8(0x01); arg.add8(arg8); break; // Level Control - Move - Down, rate=arg8
case 0x37: cluster = 0x0008; cmd = 0x06; arg.add8(0x00); arg.add8(arg8); arg.add16(arg16_1); break; // Level Control - Step - Up, step size=arg8, rate=arg16 (opt)
case 0x38: cluster = 0x0008; cmd = 0x06; arg.add8(0x01); arg.add8(arg8); arg.add16(arg16_1); break; // Level Control - Step - Down, step size=arg8, rate=arg16 (opt)
case 0x40: cluster = 0x0300; cmd = 0x01; arg.add16(0x1900); break; // Color Control - Move Hue - Stop 25 steps
case 0x41: cluster = 0x0300; cmd = 0x01; arg.add8(0x01); arg.add8(arg8); break; // Color Control - Move Hue - Up, rate=arg8
case 0x42: cluster = 0x0300; cmd = 0x01; arg.add8(0x03); arg.add8(arg8); break; // Color Control - Move Hue - Down, rate=arg8
case 0x43: cluster = 0x0300; cmd = 0x02; arg.add8(0x01); arg.add8(arg8); arg.add8(arg16_1); break; // Color Control - Step Hue - Up - step size/rate
case 0x44: cluster = 0x0300; cmd = 0x02; arg.add8(0x03); arg.add8(arg8); arg.add8(arg16_1); break; // Color Control - Step Hue - Down - step size/rate
case 0x45: cluster = 0x0300; cmd = 0x04; arg.add16(0x1900); break; // Color Control - Move Sat - Stop 25 steps
case 0x46: cluster = 0x0300; cmd = 0x04; arg.add8(0x01); arg.add8(arg8); break; // Color Control - Move Sat - Up, rate=arg8
case 0x47: cluster = 0x0300; cmd = 0x04; arg.add8(0x03); arg.add8(arg8); break; // Color Control - Move Sat - Down, rate=arg8
case 0x48: cluster = 0x0300; cmd = 0x05; arg.add8(0x01); arg.add8(arg8); arg.add8(arg16_1); break; // Color Control - Step Sat - Up - step size/rate
case 0x49: cluster = 0x0300; cmd = 0x05; arg.add8(0x03); arg.add8(arg8); arg.add8(arg16_1); break; // Color Control - Step Sat - Down - step size/rate
case 0x4A: cluster = 0x0300; cmd = 0x08; arg.add32(arg32); break; // Color Control - Move Color - RateX/RateY
case 0x4B: cluster = 0x0300; cmd = 0x09; arg.addBuffer(payload); break; // Color Control - Step Color - copy all
case 0x50: cluster = 0x0101; cmd = 0x00; break; // Door Lock - Lock Door
case 0x51: cluster = 0x0101; cmd = 0x01; break; // Door Lock - Unlock Door
default: break;
}
if (cluster != 0xFFFF) {
convertClusterSpecific(attr_list, cluster, cmd, false, shortaddr, 0xF2, arg);
parsed = true;
}
return parsed;
}
// Handle GPDF Commissioning 0xE0 command
bool convertGPDF_Commissioning(class Z_attribute_list &attr_list, uint16_t shortaddr, bool wasbroadcast, const SBuffer &payload, size_t payload_start, size_t payload_len) {
uint32_t idx_offset = payload_start; // offset compared to minimal packet
uint8_t gpd_device_id = payload.get8(idx_offset++); // type of device
uint8_t gpd_options = payload.get8(idx_offset++);
bool gpd_mac_seq_number = (gpd_options & 0x01);
bool gpd_rx_on = (gpd_options & 0x02); // is the device capable of receiving data (generally not)
bool gpd_app_info_present = (gpd_options & 0x04); // app info extensions at the end of the packet
bool gpd_panid_request = (gpd_options & 0x10);
bool gpd_sec_key_request = (gpd_options & 0x20);
bool gpd_fixed_location = (gpd_options & 0x40);
bool gpd_options_has_ext = (gpd_options & 0x80);
uint8_t gpd_options_ext = 0;
if (gpd_options_has_ext) {
gpd_options_ext = payload.get8(idx_offset++);
}
uint8_t gpd_sec_level_capa = (gpd_options_ext & 0x03);
uint8_t gpd_key_type = (gpd_options_ext >> 2) & 0x07;
uint8_t gpd_key_present = (gpd_options_ext & 0x20);
uint8_t gpd_key_encryption = (gpd_options_ext & 0x40);
uint8_t gpd_out_counter_present = (gpd_options_ext & 0x80);
uint64_t gpd_key_low = 0;
uint64_t gpd_key_high = 0;
if (gpd_key_present) {
gpd_key_low = payload.get64(idx_offset);
gpd_key_high = payload.get64(idx_offset + 8);
idx_offset += 16;
}
uint32_t gpd_key_mic = 0;
if (gpd_key_present && gpd_key_encryption) {
gpd_key_mic = payload.get32(idx_offset);
idx_offset += 4;
}
uint32_t gpd_out_counter = 0;
if (gpd_out_counter_present) {
gpd_out_counter = payload.get32(idx_offset);
idx_offset += 4;
}
Response_P(PSTR("{\"ZbGPDFCommissioningReceived\":{"
"\"srcaddr\":\"0x%04X\"," "\"wasbroadcast\":%d,"
"\"deviceid\":\"0x%02X\"," "\"options\":\"0x%02X\""),
shortaddr, wasbroadcast,
gpd_device_id, gpd_options
);
if (gpd_options_has_ext) {
ResponseAppend_P(PSTR(",\"optionsext\":\"0x%02X\""), gpd_options_ext);
}
if (gpd_key_present) {
ResponseAppend_P(PSTR(",\"securitykey\":\"0x%_X%_X\""), &gpd_key_high, &gpd_key_low);
}
if (gpd_key_present && gpd_key_encryption) {
ResponseAppend_P(PSTR(",\"keymic\":\"0x%08X\""), gpd_key_mic);
}
if (gpd_out_counter_present) {
ResponseAppend_P(PSTR(",\"outcounter\":\"0x%08X\""), gpd_out_counter);
}
// App info extension for Commissioning
if (gpd_app_info_present && idx_offset < payload_len + payload_start) {
uint8_t gp_app_info = payload.get8(idx_offset++);
bool gp_app_manuf_present = (gp_app_info & 0x01);
bool gp_app_modelid_present = (gp_app_info & 0x02);
bool gp_app_cmd_list_present = (gp_app_info & 0x04);
bool gp_app_cluster_reports_present = (gp_app_info & 0x08);
if (gp_app_manuf_present) {
uint16_t gp_app_manuf_id = payload.get8(idx_offset);
idx_offset += 2;
ResponseAppend_P(PSTR(",\"manufid\":\"0x%04X\""), gp_app_manuf_id);
}
if (gp_app_modelid_present) {
uint16_t gp_app_model_id = payload.get8(idx_offset);
idx_offset += 2;
ResponseAppend_P(PSTR(",\"modelid\":\"0x%04X\""), gp_app_model_id);
}
if (gp_app_cmd_list_present) {
uint8_t gpid_len = payload.get8(idx_offset++); // number of entries
JsonGeneratorArray gpdi_list;
for (uint32_t i = 0; i < gpid_len; i++) {
if (idx_offset >= payload_len + payload_start) { break; } // end of payload
gpdi_list.add(payload.get8(idx_offset++));
}
ResponseAppend_P(PSTR(",\"commandid\":%s"), gpdi_list.toString().c_str());
}
if (gp_app_cluster_reports_present) {
uint8_t clust_report_len = payload.get8(idx_offset++); // number of entries
JsonGeneratorArray gpdi_list;
for (uint32_t i = 0; i < clust_report_len; i++) {
if (idx_offset >= payload_len + payload_start) { break; } // end of payload
gpdi_list.add(payload.get16(idx_offset));
idx_offset += 2;
}
ResponseAppend_P(PSTR(",\"clusterreports\":%s"), gpdi_list.toString().c_str());
}
}
ResponseAppend_P(PSTR("}}"));
if (Settings->flag3.tuya_serial_mqtt_publish) {
MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR(D_RSLT_SENSOR));
} else {
AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_ZIGBEE "%s"), ResponseData());
}
// TODO publish to Berry
return true;
}
// Handle GPDF Channel Request 0xE3 command
bool convertGPDF_ChannelRequest(class Z_attribute_list &attr_list, uint16_t shortaddr, bool wasbroadcast, const SBuffer &payload, size_t payload_start, size_t payload_len) {
uint32_t idx_offset = payload_start; // offset compared to minimal packet
uint8_t gpd_channel_toggling = payload.get8(idx_offset++);
uint8_t gpd_next_channel = gpd_channel_toggling & 0x0F;
uint8_t gpd_second_next_channel = (gpd_channel_toggling >> 4) & 0x0F;
Response_P(PSTR("{\"ZbGPDFChannelRequest\":{"
"\"nextchannel\":%i," "\"secondnextchannel\":%i,"
"}}"),
11 + gpd_next_channel, 11 + gpd_second_next_channel
);
if (Settings->flag3.tuya_serial_mqtt_publish) {
MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR(D_RSLT_SENSOR));
} else {
AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_ZIGBEE "%s"), ResponseData());
}
return true;
}
// Parse a GPDF (Green Power Data Frame) tunnelled by a Green Power Proxy
//
// Returns `true` if parsed successfully
bool convertGPDF(class Z_attribute_list &attr_list, uint16_t shortaddr, uint8_t gpcmd, bool wasbroadcast, const SBuffer &payload, size_t payload_start, size_t payload_len) {
// dispatch depending on the GP command
switch (gpcmd) {
case 0x00:
case 0x10 ... 0x6F:
return convertGPDF_data(attr_list, shortaddr, gpcmd, wasbroadcast, payload, payload_start, payload_len);
case ZGP_COMMISSIONING:
return convertGPDF_Commissioning(attr_list, shortaddr, wasbroadcast, payload, payload_start, payload_len);
case ZGP_CHANNEL_REQUEST:
return convertGPDF_ChannelRequest(attr_list, shortaddr, wasbroadcast, payload, payload_start, payload_len);
}
return false;
}
bool convertGPCommissioningNotification(class Z_attribute_list &attr_list, uint16_t shortaddr, bool wasbroadcast, const SBuffer &payload) {
uint32_t idx_offset = 0; // offset due to address format: 0 if 4 bytes, 4 if 8 bytes
uint16_t gp_options = payload.get16(0);
uint8_t gp_app_id = gp_options & 0x07;
bool gp_rx_after_tx = (gp_options & 0x08);
uint8_t gp_security_level = (gp_options >> 4) & 0x03;
uint8_t gp_security_type = (gp_options >> 6) & 0x07;
bool gp_security_failed = (gp_options >> 9) & 0x01;
bool gp_bidir_cap = (gp_options >> 10) & 0x01;
bool gp_proxy_info_present = (gp_options >> 11) & 0x01;
// #define ZBEE_ZCL_GP_COMMISSIONING_NOTIFICATION_OPTION_APP_ID (7<<0)
// #define ZBEE_ZCL_GP_COMMISSIONING_NOTIFICATION_OPTION_RX_AFTER_TX (1<<3)
// #define ZBEE_ZCL_GP_COMMISSIONING_NOTIFICATION_OPTION_SECUR_LEVEL (3<<4)
// #define ZBEE_ZCL_GP_COMMISSIONING_NOTIFICATION_OPTION_SECUR_KEY_TYPE (7<<6)
// #define ZBEE_ZCL_GP_COMMISSIONING_NOTIFICATION_OPTION_SECUR_FAILED (1<<9)
// #define ZBEE_ZCL_GP_COMMISSIONING_NOTIFICATION_OPTION_BIDIR_CAP (1<<10)
// #define ZBEE_ZCL_GP_COMMISSIONING_NOTIFICATION_OPTION_PROXY_INFO_PRESENT (1<<11)
uint64_t gp_pgd_id;
if (gp_app_id == 0x02) {
idx_offset = 4;
gp_pgd_id = payload.get64(2);
} else if (gp_app_id == 0x00) {
gp_pgd_id = payload.get32(2);
} else {
AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_ZIGBEE "Invalild GP app_id=%i"), gp_app_id);
return false;
}
uint32_t gp_frame_counter = payload.get32(idx_offset + 6);
uint8_t gp_cmd = payload.get8(idx_offset + 10);
uint16_t gpp_shortaddr = 0xFFFF; // shortaddress of the proxy
uint8_t gpp_distance = 0xFF; // actual LQI from the GP device to the proxy
uint32_t gp_payload_start = idx_offset + 12;
uint32_t gp_payload_len = payload.get8(gp_payload_start - 1);
idx_offset = gp_payload_start + gp_payload_len; // reset to after payload
if (gp_proxy_info_present) {
gpp_shortaddr = payload.get16(idx_offset);
gpp_distance = payload.get8(idx_offset + 2);
idx_offset += 3;
}
uint32_t gp_mic = 0x00000000;
if (gp_security_failed) {
gp_mic = payload.get32(idx_offset);
idx_offset += 4;
}
Response_P(PSTR("{\"" D_JSON_ZIGBEEGP_RECEIVED "\":{"
"\"srcaddr\":\"0x%04X\"," "\"wasbroadcast\":%d," "\"zclcmd\":\"GP_COMMISSIONING_NOTIFICATION\","
"\"gpoptions\":\"0x%04X\","
"\"appid\":%i," "\"rxaftertx\":%i," "\"seclevel\":%i," "\"sectype\":%i," "\"secfailed\":%i,"
"\"bidircap\":%i," "\"proxyinfo\":%i,"
"\"gpsrcid\":\"0x%_X\"," "\"gpfrmcounter\":\"0x%04X\","
"\"gpproxy\":\"0x%04X\"," "\"gpplqi\":%i," "\"gpmic\":\"0x%08X\","
"\"gpcmd\":\"0x%02X\","
"\"gppayload\":\"%*_H\"}}"),
shortaddr, wasbroadcast,
gp_options,
gp_app_id, gp_rx_after_tx, gp_security_level, gp_security_type, gp_security_failed,
gp_bidir_cap, gp_proxy_info_present,
&gp_pgd_id, gp_frame_counter,
gpp_shortaddr, gpp_distance, gp_mic,
gp_cmd,
gp_payload_len, payload.buf(gp_payload_start)
);
if (Settings->flag3.tuya_serial_mqtt_publish) {
MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR(D_RSLT_SENSOR));
} else {
AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_ZIGBEE "%s"), ResponseData());
}
return convertGPDF(attr_list, shortaddr, gp_cmd, wasbroadcast, payload, gp_payload_start, gp_payload_len);
}
// Parse Green Power specific commands
// Returns: true if parsed successfully, false if revenrt to generix parsing
bool convertGPSpecific(class Z_attribute_list &attr_list, uint8_t cmd, bool direction, uint16_t shortaddr, bool wasbroadcast, const SBuffer &payload) {
if (!direction) {
// server commands
switch (cmd) {
case ZGP_COMMISSIONING_NOTIFICATION:
return convertGPCommissioningNotification(attr_list, shortaddr, wasbroadcast, payload);
break;
default:
return false;
}
} else {
// client commands
switch (cmd) {
default:
return false;
}
}
}
#endif // USE_ZIGBEE