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
150 changes: 3 additions & 147 deletions drivers/Aqara/aqara-bath-heater/profiles/aqara-bath-heater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,165 +8,18 @@ components:
version: 1
- id: colorTemperature
version: 1
config:
values:
- key: "colorTemperature.value"
range: [2700, 6500]
- id: thermostatMode
version: 1
config:
values:
- key: "thermostatMode.value"
enabledValues:
- "off"
- "heat"
- "dryair"
- "cool"
- "fanonly"
- id: thermostatHeatingSetpoint
version: 1
config:
values:
- key: "thermostatHeatingSetpoint.value"
range: [16, 45]
unit: "C"
- id: fanOscillationMode
version: 1
config:
values:
- key: "fanOscillationMode.value"
enabledValues:
- "swing"
- "fixed"
- id: fanMode
version: 1
config:
values:
- key: "fanMode.value"
enabledValues:
- "low"
- "medium"
- "high"
- id: refresh
version: 1
categories:
- name: Thermostat
deviceConfig:
dashboard:
states:
- component: main
capability: switch
version: 1
- component: main
capability: fanMode
version: 1
actions:
- component: main
capability: switch
version: 1
detailView:
- component: main
capability: switch
version: 1
- component: main
capability: switchLevel
version: 1
- component: main
capability: colorTemperature
version: 1
- component: main
capability: thermostatMode
version: 1
- component: main
capability: thermostatHeatingSetpoint
version: 1
visibleCondition:
component: main
capability: thermostatMode
version: 1
value: thermostatMode.value
operator: EQUALS
operand: "heat"
- component: main
capability: fanOscillationMode
version: 1
visibleCondition:
component: main
capability: thermostatMode
version: 1
value: thermostatMode.value
operator: ONE_OF
operand: '["heat", "dryair", "cool"]'
- component: main
capability: fanMode
version: 1
visibleCondition:
component: main
capability: thermostatMode
version: 1
value: thermostatMode.value
operator: ONE_OF
operand: '["heat", "dryair", "cool", "fanonly"]'
- component: main
capability: refresh
version: 1
automation:
conditions:
- component: main
capability: switch
version: 1
- component: main
capability: switchLevel
version: 1
- component: main
capability: colorTemperature
version: 1
- component: main
capability: thermostatMode
version: 1
- component: main
capability: thermostatHeatingSetpoint
version: 1
- component: main
capability: fanOscillationMode
version: 1
- component: main
capability: fanMode
version: 1
values:
- key: "fanMode.value"
enabledValues:
- "low"
- "medium"
- "high"
actions:
- component: main
capability: switch
version: 1
- component: main
capability: switchLevel
version: 1
- component: main
capability: colorTemperature
version: 1
- component: main
capability: thermostatMode
version: 1
- component: main
capability: thermostatHeatingSetpoint
version: 1
- component: main
capability: fanOscillationMode
version: 1
- component: main
capability: fanMode
version: 1
values:
- key: "setFanMode.fanMode"
enabledValues:
- "low"
- "medium"
- "high"
preferences:
- preferenceId: stse.nightLightMode
explicit: true
Expand All @@ -178,3 +31,6 @@ preferences:
explicit: true
- preferenceId: stse.thermostatCtrl
explicit: true
metadata:
mnmn: SolutionsEngineering
vid: SmartThings-smartthings-Aqara_Bath_Heater
1 change: 1 addition & 0 deletions drivers/Aqara/aqara-bath-heater/src/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ local function device_added(driver, device)
capabilities.fanOscillationMode.fanOscillationMode.NAME) == nil then
device:emit_event(capabilities.fanOscillationMode.fanOscillationMode(OSC.SWING))
end
device:emit_event(capabilities.colorTemperature.colorTemperatureRange({ value = {minimum = 2700, maximum = 6500} }))
end

local function send_night_light(device, new)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,8 @@ test.register_coroutine_test(
capabilities.fanMode.fanMode("medium")))
test.socket.capability:__expect_send(mock_device:generate_test_message("main",
capabilities.fanOscillationMode.fanOscillationMode("swing")))
test.socket.capability:__expect_send(mock_device:generate_test_message("main",
capabilities.colorTemperature.colorTemperatureRange({ value = {minimum = 2700, maximum = 6500} })))
end
)

Expand Down
5 changes: 5 additions & 0 deletions drivers/SmartThings/matter-sensor/fingerprints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ matterManufacturer:
vendorId: 0x115F
productId: 0x2005
deviceProfileName: presence-illuminance-temperature-humidity-battery
- id: "4447/8201"
deviceLabel: Spatial Multi-Sensor FP400
vendorId: 0x115F
productId: 0x2009
deviceProfileName: aqara-fp400
#Bosch
- id: 4617/12309
deviceLabel: "Door/window contact II [M]"
Expand Down
14 changes: 14 additions & 0 deletions drivers/SmartThings/matter-sensor/profiles/aqara-fp400.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: aqara-fp400
components:
- id: main
capabilities:
- id: presenceSensor
version: 1
- id: illuminanceMeasurement
version: 1
- id: firmwareUpdate
version: 1
- id: refresh
version: 1
categories:
- name: PresenceSensor
6 changes: 6 additions & 0 deletions drivers/SmartThings/matter-sensor/src/sensor_utils/fields.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,10 @@ SensorFields.BOOLEAN_CAP_EVENT_MAP = {
}
}

SensorFields.vendor_overrides = {
[0x115F] = { -- AQARA_MANUFACTURER_ID
[0x2009] = { is_aqara_fp400 = true }
}
}

return SensorFields
11 changes: 11 additions & 0 deletions drivers/SmartThings/matter-sensor/src/sensor_utils/utils.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
-- Copyright © 2025 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local fields = require "sensor_utils.fields"

local utils = {}

-- Sanity check bounds for soil moisture measurement limits (percent)
Expand All @@ -15,6 +17,15 @@ function utils.set_field_for_endpoint(device, field, endpoint, value, additional
device:set_field(string.format("%s_%d", field, endpoint), value, additional_params)
end

function utils.get_product_override_field(device, override_key)
if device.manufacturer_info
and fields.vendor_overrides[device.manufacturer_info.vendor_id]
and fields.vendor_overrides[device.manufacturer_info.vendor_id][device.manufacturer_info.product_id]
then
return fields.vendor_overrides[device.manufacturer_info.vendor_id][device.manufacturer_info.product_id][override_key]
end
end

function utils.tbl_contains(array, value)
if value == nil then return false end
for _, element in pairs(array or {}) do
Expand Down
1 change: 1 addition & 0 deletions drivers/SmartThings/matter-sensor/src/sub_drivers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ local sub_drivers = {
lazy_load_if_possible("sub_drivers.air_quality_sensor"),
lazy_load_if_possible("sub_drivers.smoke_co_alarm"),
lazy_load_if_possible("sub_drivers.bosch_button_contact"),
lazy_load_if_possible("sub_drivers.aqara_fp400"),
}
return sub_drivers
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-- Copyright 2026 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local function is_aqara_fp400(opts, driver, device)
local sensor_utils = require "sensor_utils.utils"
if sensor_utils.get_product_override_field(device, "is_aqara_fp400") then
return true, require("sub_drivers.aqara_fp400")
end
return false
end

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

local Fp400LifecycleHandlers = {}

-- overwrite to avoid unnecessary metadata update calls
function Fp400LifecycleHandlers.do_configure() end

-- overwrite to avoid unnecessary metadata update calls
function Fp400LifecycleHandlers.driver_switched(driver, device)
device:try_update_metadata({provisioning_state = "PROVISIONED"})
end

local aqara_fp400_handler = {
NAME = "aqara-fp400",
lifecycle_handlers = {
doConfigure = Fp400LifecycleHandlers.do_configure,
driverSwitched = Fp400LifecycleHandlers.driver_switched,
},
can_handle = require("sub_drivers.aqara_fp400.can_handle"),
}

return aqara_fp400_handler
Loading
Loading