Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
c8278e8
ledvance zigbee meter plug driver pull
LQ107 Jan 26, 2026
316276d
add the handle file
LQ107 Jan 26, 2026
c01a9d0
add driver fingerprints
LQ107 Jan 30, 2026
5e5a387
modify the ledvance zigbee meter plug device Label
LQ107 Jan 30, 2026
98aafe1
add driver for PLUG EU EM T
LQ107 Jan 30, 2026
6a76283
delete the PLUG EU EM T driver
LQ107 Jan 30, 2026
14de7ba
Update the PLUG COMPACT EU EM T device driver
LQ107 Feb 10, 2026
99ce6ea
set the multiplier and divisor fields in the initial handler
LQ107 Mar 3, 2026
22bc75b
disable the rely on the defaults to read the multiplier/divisor and A…
LQ107 Mar 4, 2026
b81fa6b
fixing the init.lua multiplier/divisor handle ,fixing the commit conf…
LQ107 Mar 4, 2026
328797c
update sub driver init.lua files
LQ107 Mar 4, 2026
8f598e7
Merge branch 'main' into ledvance_zigbee_meter_plug
LQ107 Mar 4, 2026
5004c95
Remove unnecessary files
LQ107 Mar 5, 2026
09b89b7
Merge branch 'main' into ledvance_zigbee_meter_plug
LQ107 Mar 5, 2026
3a46f9d
Remove redundant code
LQ107 Mar 6, 2026
b7eb6b6
Merge branch 'ledvance_zigbee_meter_plug' of https://github.com/LQ107…
LQ107 Mar 6, 2026
6b409cb
Merge branch 'main' into ledvance_zigbee_meter_plug
LQ107 Mar 6, 2026
41d31e7
Merge branch 'main' into ledvance_zigbee_meter_plug
LQ107 Mar 10, 2026
28e7783
1.add the test unit 2. add sub driver register 3.fixing the energy_me…
LQ107 Mar 11, 2026
875c75f
revert the gitgnore file to the default
LQ107 Mar 11, 2026
4011278
Merge branch 'ledvance_zigbee_meter_plug' of https://github.com/LQ107…
LQ107 Mar 11, 2026
3347541
Merge branch 'main' into ledvance_zigbee_meter_plug
LQ107 Mar 11, 2026
6063c89
Merge branch 'main' into ledvance_zigbee_meter_plug
LQ107 Mar 12, 2026
9424f57
Merge branch 'main' into ledvance_zigbee_meter_plug
LQ107 Mar 12, 2026
2f5fe4b
Merge branch 'main' into ledvance_zigbee_meter_plug
LQ107 Mar 13, 2026
d02ef90
1.fixing the energy meter value redundant processing 2.change the lo…
LQ107 Mar 16, 2026
c6d53e8
Merge branch 'ledvance_zigbee_meter_plug' of https://github.com/LQ107…
LQ107 Mar 16, 2026
6ee58b2
Merge branch 'main' into ledvance_zigbee_meter_plug
LQ107 Mar 19, 2026
2c5a233
Merge branch 'main' into ledvance_zigbee_meter_plug
LQ107 Mar 26, 2026
420f963
Merge branch 'main' into ledvance_zigbee_meter_plug
LQ107 Mar 31, 2026
4650e24
1.Use the default SmartThings simple metering handlers
LQ107 Apr 9, 2026
5e6d9d6
Merge branch 'ledvance_zigbee_meter_plug' of https://github.com/LQ107…
LQ107 Apr 14, 2026
542e724
Merge branch 'main' into ledvance_zigbee_meter_plug
LQ107 Apr 14, 2026
bea9429
fixing the following issue:
LQ107 Apr 15, 2026
d0f3ccb
Merge branch 'ledvance_zigbee_meter_plug' of https://github.com/LQ107…
LQ107 Apr 15, 2026
d555fe4
Merge branch 'main' into ledvance_zigbee_meter_plug
LQ107 Apr 15, 2026
0d04304
Fix the issues of missing trailing newline and remove trailing white …
LQ107 Apr 20, 2026
d25cf5c
Merge branch 'ledvance_zigbee_meter_plug' of https://github.com/LQ107…
LQ107 Apr 20, 2026
905fe30
Merge branch 'main' into ledvance_zigbee_meter_plug
LQ107 Apr 20, 2026
c4f13dd
1.rename the driver file name to ledvance-metering-plug 2.keep the g…
LQ107 Apr 21, 2026
c651f91
Merge branch 'ledvance_zigbee_meter_plug' of https://github.com/LQ107…
LQ107 Apr 21, 2026
c81e7e3
keep gitignore same to the main branch
LQ107 Apr 21, 2026
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
7 changes: 7 additions & 0 deletions drivers/SmartThings/zigbee-switch/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,10 @@ permissions:
zigbee: {}
description: "SmartThings driver for Zigbee switch devices"
vendorSupportInformation: "https://support.smartthings.com"

fingerprints:
- manufacturer: "LEDVANCE"
model: "PLUG COMPACT EU EM T"
deviceProfileName: "switch-power-energy"
id: "LEDVANCE/PLUG COMPACT EU EM T"
deviceLabel: "SMART ZIGBEE COMPACT OUTDOOR PLUG EU"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please remove the changes to this file

16 changes: 5 additions & 11 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
Comment thread
LQ107 marked this conversation as resolved.
Outdated
- id: "OSRAM/LIGHTIFY Edge-lit flushmount"
deviceLabel: SYLVANIA Light
manufacturer: OSRAM
Expand Down Expand Up @@ -2400,22 +2405,11 @@ zigbeeManufacturer:
manufacturer: NodOn
model: SIN-4-1-21
deviceProfileName: switch-power-energy
#Yanmi
- id: "JNL/Y-K003-001"
deviceLabel: Yanmi Switch (3 Way) 1
manufacturer: JNL
model: Y-K003-001
deviceProfileName: basic-switch
- id: "JNL/Y-K001-001"
deviceLabel: Yanmi Switch (1 Way)
manufacturer: JNL
model: Y-K001-001
deviceProfileName: basic-switch
- id: "JNL/Y-K002-001"
deviceLabel: Yanmi Switch (2 Way) 1
manufacturer: JNL
model: Y-K002-001
deviceProfileName: basic-switch
zigbeeGeneric:
Comment thread
greens marked this conversation as resolved.
- id: "genericSwitch"
deviceLabel: Zigbee Switch
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-- Copyright 2025 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local can_handle_simple_metering_config = function(opts, driver, device)
-- 检查设备是否支持 Simple Metering 集群 (0x0702)
for _, cluster in ipairs(device.server_clusters) do
if cluster == 0x0702 then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we have other devices for which this would return true where we would not want your specific device's logic to be used, which is why we usually gate subdrivers via fingerprints

return true
end
end
return false
end

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

-- 定义支持该子驱动程序的设备指纹
-- 这里可以指定特定的制造商和型号
return {
["Generic"] = {
["SimpleMeteringDevice"] = true
}
}
Comment thread
LQ107 marked this conversation as resolved.
Outdated
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
-- Copyright 2025 SmartThings, Inc.
Copy link
Copy Markdown
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 zigbee_handlers = require "st.zigbee.handlers"

-- 设置 Simple Metering 集群的 multipliers 和 divisors 属性
local function device_init(driver, device)
-- 在设备初始化时设置 multipliers 和 divisors
device:configure()

-- 设置 Multiplier 为 1
local write_multiplier_cmd = SimpleMetering.server.commands.WriteAttributes(device)
if write_multiplier_cmd then
device:send_to_component(
write_multiplier_cmd({
{id = SimpleMetering.attributes.Multiplier.ID, value = 1, DataType = 0x22} -- 0x22 is 24-bit integer
Copy link
Copy Markdown
Contributor

@greens greens Feb 4, 2026

Choose a reason for hiding this comment

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

we provide "st.zigbee.data_types" which has a Int24 (and Int32 constant)

}),
"main"
)
end

-- 设置 Divisor 为 100
local write_divisor_cmd = SimpleMetering.server.commands.WriteAttributes(device)
if write_divisor_cmd then
device:send_to_component(
write_divisor_cmd({
{id = SimpleMetering.attributes.Divisor.ID, value = 100, DataType = 0x23} -- 0x23 is 32-bit integer
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

in the ZCL this attribute is an Int24

}),
"main"
)
end
end
Comment thread
LQ107 marked this conversation as resolved.

-- 处理能量计量事件
local function energy_meter_handler(driver, device, value, zb_rx)
local raw_value = value.value
local divisor = device:get_field(SimpleMetering.attributes.Divisor.ID) or 100
local multiplier = device:get_field(SimpleMetering.attributes.Multiplier.ID) or 1
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this field is not likely to be set. We do set a similar field from "st.zigbee.constants": constants.SIMPLE_METERING_MULTIPLIER_KEY (and divisor) in our defaults, but we never use the attribute ID as a key,


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

-- 定义子驱动程序模板
local simple_metering_config_subdriver = {
supported_capabilities = {
capabilities.energyMeter,
capabilities.powerMeter
},
Comment thread
LQ107 marked this conversation as resolved.
Outdated
lifecycle_handlers = {
init = device_init
},
zigbee_handlers = {
cluster = {
[SimpleMetering.ID] = {
[SimpleMetering.attributes.CurrentSummationDelivered.ID] = energy_meter_handler
}
}
}
}

return simple_metering_config_subdriver