-
Notifications
You must be signed in to change notification settings - Fork 521
WWSTCERT-9096 Ct clamp driver wwsm #2552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
WWSTCERT-9096 Ct clamp driver wwsm #2552
Conversation
…driver for temperature, battery percentage
battery seems to always be at 100% on both tested clamps, even throiugh one is as 98%
Now calling the ct clamp sub driver - have temperature,battery,power meter and energy meter on the screen, last two are correct values, first two are not as yet
…nd deployed to the hub, using the standard smartthings zigbee power meter as the base and adding as a sub driver the temperature and battery level
|
|
||
| local function battery_level_handler(driver, device, value, _zb_rx) | ||
| if type(value.value) == "number" then | ||
| local number = value.value/2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spacing
PR SmartThingsCommunity#2552 indent code under the statement to the right as per pull request comment
pegor-karoglanian
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing copyright/license statement
|
Duplicate profile check: Passed - no duplicate profiles detected. |
|
Invitation URL: |
| - id: "ChameleonCTClamp" | ||
| deviceLabel: Zigbee CT | ||
| deviceIdentifiers: | ||
| - 0x000D | ||
| zigbeeProfiles: | ||
| - 0x0104 | ||
| clusters: | ||
| server: | ||
| - 0x0000 #Basic | ||
| - 0x0001 #Power Configuration | ||
| - 0x0002 #Device Temperature Configuration | ||
| - 0x0003 #Identify | ||
| - 0x0019 #Over the Air Bootloading | ||
| - 0x0020 #Poll Control | ||
| - 0x0702 #Simple Metering | ||
| - 0x0B04 #Electrical Measurement | ||
| client: | ||
| - 0x0003 #Identify | ||
| deviceProfileName: ct-clamp | ||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please just include the manufacturer-specific fingerprint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes to this file should be omitted
Test Results 71 files 469 suites 0s ⏱️ Results for commit e04499e. |
|
Minimum allowed coverage is Generated by 🐒 cobertura-action against e04499e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since there isn't anything here that makes this device-specific, could you please rename to something like power-energy-battery-temp?
| local batt_level = device:get_latest_state("main", capabilities.battery.ID, capabilities.battery.battery.NAME) or nil | ||
| if batt_level == nil then | ||
| device:emit_event(capabilities.battery.battery.normal()) | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expect this to go in added. Is there a reason you included it in init?
| local function battery_level_handler(driver, device, value, _zb_rx) | ||
| if type(value.value) == "number" then | ||
| local number = value.value/2 | ||
| local integer_result = math.floor(number) | ||
| device:emit_event(capabilities.battery.battery(integer_result)) | ||
| else | ||
| log.error("Invalid battery level value received: " .. tostring(value.value)) | ||
| end | ||
| end | ||
|
|
||
| local function temperature_handler(driver, device, value, _zb_rx) | ||
| if type(value.value) == "number" then | ||
| device:emit_event(capabilities.temperatureMeasurement.temperature({ value = value.value, unit = "C" })) | ||
| else | ||
| log.error("Invalid temperature value received: " .. tostring(value.value)) | ||
| end | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you just added battery and temperatureMeasurement here: https://github.com/SmartThingsCommunity/SmartThingsEdgeDrivers/blob/main/drivers/SmartThings/zigbee-power-meter/src/init.lua#L53
You could omit most of this file.
|
Check all that apply
Type of Change
Checklist
Description of Change
add a sub driver to the standard edge driver for Zigbee Power meter to supply temperature and battery percentage readings
Summary of Completed Tests
Smartthings full 14 test test suite from the certification console, all 14 tests passed
Test date: 13 November 2025 at 11:28:28
Test duration: 00:12:27
Session ID: WHJ1WLTHID
Test date: 13 November 2025 at 11:51:55
Test duration: 00:09:10
Session ID: 1DIHUP08CV