Skip to content
Merged
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
14 changes: 14 additions & 0 deletions drivers/SmartThings/zigbee-thermostat/src/aqara/can_handle.lua
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 function is_aqara_products(opts, driver, device)
local FINGERPRINTS = require("aqara.fingerprints")
for _, fingerprint in ipairs(FINGERPRINTS) do
if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then
return true, require("aqara")
end
end
return false
end

return is_aqara_products
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 FINGERPRINTS = {
{ mfr = "LUMI", model = "lumi.airrtc.agl001" }
}

return FINGERPRINTS
31 changes: 5 additions & 26 deletions drivers/SmartThings/zigbee-thermostat/src/aqara/init.lua
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
-- Copyright 2024 SmartThings
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- Copyright 2024 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local data_types = require "st.zigbee.data_types"
local clusters = require "st.zigbee.zcl.clusters"
local cluster_base = require "st.zigbee.cluster_base"
Expand All @@ -34,9 +24,6 @@ local PRIVATE_ANTIFREEZE_MODE_TEMPERATURE_SETTING_ID = 0x0279
local PRIVATE_VALVE_RESULT_CALIBRATION_ID = 0x027B
local PRIVATE_BATTERY_ENERGY_ID = 0x040A

local FINGERPRINTS = {
{ mfr = "LUMI", model = "lumi.airrtc.agl001" }
}

local preference_map = {
["stse.notificationOfValveTest"] = {
Expand Down Expand Up @@ -82,14 +69,6 @@ local function device_info_changed(driver, device, event, args)
end
end

local function is_aqara_products(opts, driver, device)
for _, fingerprint in ipairs(FINGERPRINTS) do
if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then
return true
end
end
return false
end

local function supported_thermostat_modes_handler(driver, device, value)
device:emit_event(capabilities.thermostatMode.supportedThermostatModes({
Expand Down Expand Up @@ -277,7 +256,7 @@ local aqara_radiator_thermostat_e1_handler = {
[capabilities.refresh.commands.refresh.NAME] = do_refresh,
}
},
can_handle = is_aqara_products
can_handle = require("aqara.can_handle"),
}

return aqara_radiator_thermostat_e1_handler
return aqara_radiator_thermostat_e1_handler
14 changes: 14 additions & 0 deletions drivers/SmartThings/zigbee-thermostat/src/danfoss/can_handle.lua
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 is_danfoss_thermostat = function(opts, driver, device)
local FINGERPRINTS = require("danfoss.fingerprints")
for _, fingerprint in ipairs(FINGERPRINTS) do
if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then
return true, require("danfoss")
end
end
return false
end

return is_danfoss_thermostat
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 DANFOSS_THERMOSTAT_FINGERPRINTS = {
{ mfr = "Danfoss", model = "eTRV0100" }
}

return DANFOSS_THERMOSTAT_FINGERPRINTS
18 changes: 5 additions & 13 deletions drivers/SmartThings/zigbee-thermostat/src/danfoss/init.lua
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
-- Copyright 2025 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local clusters = require "st.zigbee.zcl.clusters"
local battery_defaults = require "st.zigbee.defaults.battery_defaults"
local PowerConfiguration = clusters.PowerConfiguration

local DANFOSS_THERMOSTAT_FINGERPRINTS = {
{ mfr = "Danfoss", model = "eTRV0100" }
}

local is_danfoss_thermostat = function(opts, driver, device)
for _, fingerprint in ipairs(DANFOSS_THERMOSTAT_FINGERPRINTS) do
if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then
return true
end
end
return false
end

local danfoss_thermostat = {
NAME = "Danfoss Thermostat Handler",
Expand All @@ -27,7 +19,7 @@ local danfoss_thermostat = {
lifecycle_handlers = {
init = battery_defaults.build_linear_voltage_init(2.4, 3.2)
},
can_handle = is_danfoss_thermostat
can_handle = require("danfoss.can_handle"),
}

return danfoss_thermostat
return danfoss_thermostat
11 changes: 11 additions & 0 deletions drivers/SmartThings/zigbee-thermostat/src/fidure/can_handle.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- Copyright 2025 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local function fidure_can_handle(opts, driver, device, ...)
if device:get_manufacturer() == "Fidure" and device:get_model() == "A1732R3" then
return true, require("fidure")
end
return false
end

return fidure_can_handle
20 changes: 4 additions & 16 deletions drivers/SmartThings/zigbee-thermostat/src/fidure/init.lua
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
-- Copyright 2022 SmartThings
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- Copyright 2022 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0


local device_management = require "st.zigbee.device_management"

Expand Down Expand Up @@ -38,9 +28,7 @@ local fidure_thermostat = {
}
}
},
can_handle = function(opts, driver, device, ...)
return device:get_manufacturer() == "Fidure" and device:get_model() == "A1732R3"
end
can_handle = require("fidure.can_handle"),
}

return fidure_thermostat
31 changes: 4 additions & 27 deletions drivers/SmartThings/zigbee-thermostat/src/init.lua
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
-- Copyright 2023 SmartThings
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- Copyright 2023 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0


-- Zigbee Driver utilities
local ZigbeeDriver = require "st.zigbee"
Expand Down Expand Up @@ -362,20 +352,7 @@ local zigbee_thermostat_driver = {
doConfigure = do_configure,
added = device_added
},
sub_drivers = {
require("zenwithin"),
require("fidure"),
require("sinope"),
require("stelpro-ki-zigbee-thermostat"),
require("stelpro"),
require("lux-konoz"),
require("leviton"),
require("danfoss"),
require("popp"),
require("vimar"),
require("resideo_korea"),
require("aqara")
},
sub_drivers = require("sub_drivers"),
health_check = false,
}

Expand Down
15 changes: 15 additions & 0 deletions drivers/SmartThings/zigbee-thermostat/src/lazy_load_subdriver.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-- Copyright 2025 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

return function(sub_driver_name)
-- gets the current lua libs api version
local version = require "version"
local ZigbeeDriver = require "st.zigbee"
if version.api >= 16 then
return ZigbeeDriver.lazy_load_sub_driver_v2(sub_driver_name)
elseif version.api >= 9 then
return ZigbeeDriver.lazy_load_sub_driver(require(sub_driver_name))
else
return require(sub_driver_name)
end
end
11 changes: 11 additions & 0 deletions drivers/SmartThings/zigbee-thermostat/src/leviton/can_handle.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- Copyright 2025 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local function leviton_can_handle(opts, driver, device, ...)
if device:get_manufacturer() == "HAI" and device:get_model() == "65A01-1" then
return true, require("leviton")
end
return false
end

return leviton_can_handle
20 changes: 4 additions & 16 deletions drivers/SmartThings/zigbee-thermostat/src/leviton/init.lua
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
-- Copyright 2022 SmartThings
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- Copyright 2022 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0


local clusters = require "st.zigbee.zcl.clusters"
local Thermostat = clusters.Thermostat
Expand Down Expand Up @@ -128,9 +118,7 @@ local leviton_thermostat = {
}
}
},
can_handle = function(opts, driver, device, ...)
return device:get_manufacturer() == "HAI" and device:get_model() == "65A01-1"
end
can_handle = require("leviton.can_handle"),
}

return leviton_thermostat
14 changes: 14 additions & 0 deletions drivers/SmartThings/zigbee-thermostat/src/lux-konoz/can_handle.lua
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 is_lux_konoz = function(opts, driver, device)
local FINGERPRINTS = require("lux-konoz.fingerprints")
for _, fingerprint in ipairs(FINGERPRINTS) do
if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then
return true, require("lux-konoz")
end
end
return false
end

return is_lux_konoz
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 LUX_KONOZ_THERMOSTAT_FINGERPRINTS = {
{ mfr = "LUX", model = "KONOZ" }
}

return LUX_KONOZ_THERMOSTAT_FINGERPRINTS
29 changes: 4 additions & 25 deletions drivers/SmartThings/zigbee-thermostat/src/lux-konoz/init.lua
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
-- Copyright 2022 SmartThings
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- Copyright 2022 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0


local clusters = require "st.zigbee.zcl.clusters"
local Thermostat = clusters.Thermostat
Expand All @@ -19,18 +9,7 @@ local capabilities = require "st.capabilities"
local ThermostatMode = capabilities.thermostatMode


local LUX_KONOZ_THERMOSTAT_FINGERPRINTS = {
{ mfr = "LUX", model = "KONOZ" }
}

local is_lux_konoz = function(opts, driver, device)
for _, fingerprint in ipairs(LUX_KONOZ_THERMOSTAT_FINGERPRINTS) do
if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then
return true
end
end
return false
end

-- LUX KONOz reports extra ["auto", "emergency heat"] which, actually, aren't supported
local supported_thermostat_modes_handler = function(driver, device, supported_modes)
Expand All @@ -46,7 +25,7 @@ local lux_konoz = {
}
}
},
can_handle = is_lux_konoz
can_handle = require("lux-konoz.can_handle"),
}

return lux_konoz
14 changes: 14 additions & 0 deletions drivers/SmartThings/zigbee-thermostat/src/popp/can_handle.lua
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 is_popp_thermostat = function(opts, driver, device)
local FINGERPRINTS = require("popp.fingerprints")
for _, fingerprint in ipairs(FINGERPRINTS) do
if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then
return true, require("popp")
end
end
return false
end

return is_popp_thermostat
15 changes: 15 additions & 0 deletions drivers/SmartThings/zigbee-thermostat/src/popp/fingerprints.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-- Copyright 2025 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local POPP_THERMOSTAT_FINGERPRINTS = {
{
mfr = "D5X84YU",
model = "eT093WRO"
},
{
mfr = "D5X84YU",
model = "eT093WRG"
}
}

return POPP_THERMOSTAT_FINGERPRINTS
Loading
Loading