Skip to content

Zigbee Switch: Fix Climax power meter scaling - #3205

Open
sungmpar wants to merge 2 commits into
SmartThingsCommunity:mainfrom
sungmpar:fix/climax-power-scaling
Open

Zigbee Switch: Fix Climax power meter scaling#3205
sungmpar wants to merge 2 commits into
SmartThingsCommunity:mainfrom
sungmpar:fix/climax-power-scaling

Conversation

@sungmpar

Copy link
Copy Markdown

Check all that apply

Type of Change

  • WWST Certification Request
    • If this is your first time contributing code:
      • I have reviewed the README.md file
      • I have reviewed the CODE_OF_CONDUCT.md file
      • I have signed the CLA
    • I plan on entering a WWST Certification Request or have entered a request through the WWST Certification console at developer.smartthings.com
  • Bug fix
  • New feature
  • Refactor

Checklist

  • I have performed a self-review of my code
  • I have commented my code in hard-to-understand areas
  • I have verified my changes by testing with a device or have communicated a plan for testing
  • I am adding new behavior, such as adding a sub-driver, and have added and run new unit tests to cover the new behavior

Description of Change

Summary

  • Add an exact Climax-specific nested power-meter subdriver.
  • Delegate Electrical Measurement ActivePower to the SDK-standard handler.
  • Delegate Simple Metering InstantaneousDemand to the SDK-standard handler.
  • Add regression tests covering multiplier, divisor, and kW-to-W conversion.

Root cause

The shared zigbee-switch-power compatibility handlers divide reported values by the configured divisor but do not apply the corresponding multiplier. The shared InstantaneousDemand path also emits a kW-scaled value as watts without multiplying by 1000.

Changing these shared handlers globally could alter established compatibility behavior for other fingerprinted devices.

Implementation

The nested subdriver matches only manufacturer ClimaxTechnology and model PSM_00.00.00.35TC. It overrides only Electrical Measurement ActivePower and Simple Metering InstantaneousDemand, delegating both attributes to the existing SDK-standard handlers.

The shared compatibility handlers and all non-Climax device behavior remain unchanged.

Hardware validation

No SmartThings hub or physical Climax device was used. Automated integration tests verify driver and subdriver routing, multiplier/divisor field use, numerical scaling, kW-to-W conversion, and emitted powerMeter events.

The physical-device test plan is to pair a PSM_00.00.00.35TC with a SmartThings hub and verify report ordering, endpoint behavior, and emitted watt values against a known load when hardware is available. That hardware validation was not performed for this change, so firmware report ordering, endpoint quirks, and deployed-device behavior remain unverified.

Fixes #236

Summary of Completed Tests

  • test_switch_power: 7/7 passed
  • test_aurora_relay: 4/4 passed
  • test_ledvance_metering_plug: 4/4 passed
  • Complete Zigbee-switch suite: 63 files, 575/575 tests passed
  • Luacheck: 0 warnings and 0 errors in the four changed files
  • Whitespace checks passed

@CLAassistant

CLAassistant commented Aug 31, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ClimaxTechnology Power Meter | power unit divisor

2 participants