Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions drivers/SmartThings/zigbee-switch/fingerprints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1715,6 +1715,11 @@ zigbeeManufacturer:
manufacturer: LEDVANCE
model: RT TW
deviceProfileName: color-temp-bulb
- id: "LEDVANCE/PLUG COMPACT EU EM T"
deviceLabel: SMART ZIGBEE COMPACT OUTDOOR PLUG EU
manufacturer: LEDVANCE
model: PLUG COMPACT EU EM T
deviceProfileName: switch-power-energy
- id: "OSRAM/LIGHTIFY Edge-lit flushmount"
deviceLabel: SYLVANIA Light
manufacturer: OSRAM
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- Copyright 2025 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local can_handle_simple_metering_config = function(opts, driver, device)
return device.fingerprinted == true
end

return can_handle_simple_metering_config
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unsure where this file is used?

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-- Copyright 2025 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

return {
["LEDVANCE"] = {
["PLUG COMPACT EU EM T"] = {
deviceProfileName = "switch-power-energy",
--id = "LEDVANCE/PLUG COMPACT EU EM T",
--deviceLabel = "SMART ZIGBEE COMPACT OUTDOOR PLUG EU"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
-- Copyright 2025 SmartThings, Inc.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

date

-- Licensed under the Apache License, Version 2.0

local capabilities = require "st.capabilities"
local zigbee_constants = require "st.zigbee.constants"
local SimpleMetering = require "st.zigbee.cluster".clusters.SimpleMetering

local function energy_meter_handler(driver, device, value, zb_rx)
local raw_value = value.value

if type(raw_value) ~= "number" or raw_value < 0 then
return
end

local divisor = device:get_field(zigbee_constants.SIMPLE_METERING_DIVISOR_KEY) or 100
local multiplier = device:get_field(zigbee_constants.SIMPLE_METERING_MULTIPLIER_KEY) or 1

if divisor == 0 then
return
end

local calculated_value = (raw_value * multiplier) / divisor

device:emit_event_for_endpoint(
zb_rx.address_header.src_endpoint.value,
capabilities.energyMeter.energy({ value = calculated_value, unit = "kWh" })
)
end
Comment on lines +8 to +28
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

our default handlers should handle this case, provided your device properly reports its simple metering multiplier and divisor.


local simple_metering_config_subdriver = {
supported_capabilities = {
capabilities.energyMeter,
capabilities.powerMeter
},
zigbee_handlers = {
cluster = {
[SimpleMetering.ID] = {
[SimpleMetering.attributes.CurrentSummationDelivered.ID] = energy_meter_handler
}
}
}
}

return simple_metering_config_subdriver