### Link
https://us.aqara.com/products/aqara-dimmer-switch-h2-us
### Database …entry
I only have a database.db.backup file.
### Zigbee2MQTT version
2.5.1
### Comments
I just bought a few of these and needed them to work properly, so I created an external converter. I **_think_** all the features are included and _mostly_ working. It just gets some errors during configuration.
This was much more of a headache than I was expecting. There weren't a lot of Aqara/Lumi dimmers to use as a current example, and I couldn't find much documentation on **anything**. Trying to figure out how to fix the duplicate/independent `state`, `brightness`, and `level_config` entries was a particular pain in my a**.
So here it is for anyone else that might need it.
The icon can be found here:
https://us.aqara.com/cdn/shop/files/DimmerSwitchUs_1.webp?width=600 <-- Change width to suite
FYI: The power monitoring will not work unless you are using a neutral wire.
### External definition
```shell
// Aqara Dimmer Switch H2 US (WS-K05E)
// Produces several of thee errors when configuring, but everything seems to work:
// Exception while calling fromZigbee converter: Value is not a number, got undefined (undefined)}
// icon: https://us.aqara.com/cdn/shop/files/DimmerSwitchUs_1.webp?width=600
import * as lumi from "zigbee-herdsman-converters/lib/lumi";
import * as m from "zigbee-herdsman-converters/lib/modernExtend";
const { manufacturerCode } = lumi;
const {
lumiAction,
lumiZigbeeOTA,
lumiPreventLeave,
lumiPreventReset,
lumiPower,
lumiLedIndicator,
lumiFlipIndicatorLight,
lumiSetEventMode,
lumiPowerOnBehavior,
lumiLight,
lumiMultiClick,
} = lumi.modernExtend;
export default {
zigbeeModel: ["lumi.switch.agl007"],
model: "WS-K05E",
vendor: "Aqara",
description: "Dimmer Switch H2 US",
extend: [
m.deviceEndpoints({
endpoints: { "power": 1, "bright": 2, "dim": 3, 21: 21, 71: 71, 72: 72 },
}),
lumiZigbeeOTA(),
lumiPreventLeave(),
lumiPreventReset(),
m.bindCluster({ cluster: "genOnOff", clusterType: "input" }),
m.bindCluster({ cluster: "genLevelCtrl", clusterType: "input" }),
m.bindCluster({ cluster: "manuSpecificLumi", clusterType: "input" }),
lumiPower(),
lumiLedIndicator(),
lumiFlipIndicatorLight(),
lumiSetEventMode(),
lumiPowerOnBehavior(),
lumiLight({
effect: false,
powerOutageCount: true,
powerOnBehavior: false,
deviceTemperature: true,
levelConfig: {
features: [
"execute_if_off",
"on_transition_time",
"off_transition_time",
"on_level",
],
},
}),
lumiAction({
actionLookup: { hold: 0, single: 1, double: 2, release: 255 },
endpointNames: ["power", "bright", "dim"],
}),
lumiMultiClick({
description: "Multi-click mode for power button",
endpointName: "power",
}),
lumiMultiClick({
description: "Multi-click mode for brightness up button",
endpointName: "bright",
}),
lumiMultiClick({
description: "Multi-click mode for brightness down button",
endpointName: "dim",
}),
m.enumLookup({
name: "phase",
lookup: { forward: 0, reverse: 1 },
cluster: "manuSpecificLumi",
attribute: { ID: 0x030a, type: 0x20 },
description: "Dimming phase",
zigbeeCommandOptions: { manufacturerCode },
}),
m.numeric({
name: "min_brightness",
valueMin: 0,
valueMax: 99,
unit: "%",
cluster: "manuSpecificLumi",
attribute: { ID: 0x0515, type: 0x20 },
description: "Minimum brightness level",
zigbeeCommandOptions: { manufacturerCode },
}),
m.numeric({
name: "max_brightness",
valueMin: 1,
valueMax: 100,
unit: "%",
cluster: "manuSpecificLumi",
attribute: { ID: 0x0516, type: 0x20 },
description: "Maximum brightness level",
zigbeeCommandOptions: { manufacturerCode },
}),
],
meta: {
multiEndpoint: true,
multiEndpointSkip: ["state","brightness","level_config"],
},
};
```
### What does/doesn't work with the external definition?
This external config seems to work fine, except...
- It produces several of these errors when configuring the device:
`Exception while calling fromZigbee converter: Value is not a number, got undefined (undefined)}`
- I am not fully convinced the `min_brightness` and `max_brightness` features are working as they should. I'll need to do more testing when I get a chance.
- Also, for whatever reason, some of the values seem to be 10x what they actually are (like the transition times, voltage, etc.).
Here is the raw state of one of them for reference:
```json
{
"consumption": 0.023399997502565384,
"current": 0.47979370117187503,
"device_temperature": 26,
"energy": 0.023399997502565384,
"flip_indicator_light": "OFF",
"last_seen": "2025-07-28T19:14:57-04:00",
"led_disabled_night": false,
"led_indicator": "OFF",
"level_config": {
"off_transition_time": 50,
"on_transition_time": 20,
"execute_if_off": true,
"on_level": 254
},
"linkquality": 138,
"max_brightness": 100,
"min_brightness": 65,
"multi_click_bright": true,
"multi_click_dim": true,
"multi_click_power": true,
"operation_mode_bright": "control_relay",
"operation_mode_dim": "control_relay",
"operation_mode_power": "control_relay",
"phase": "reverse",
"power": 52.27,
"power_on_behavior": "off",
"power_outage_count": 17,
"state": "ON",
"voltage": 1230.95,
"action": null,
"device": {
"applicationVersion": 22,
"dateCode": "20250627",
"friendlyName": "Bathroom Lights",
"hardwareVersion": 1,
"ieeeAddr": "0x54ef44100134ce7c",
"manufacturerID": 4447,
"manufacturerName": "Aqara",
"model": "WS-K05E",
"networkAddress": 51311,
"powerSource": "DC Source",
"stackVersion": 27,
"type": "Router",
"zclVersion": 3
},
"update": {
"installed_version": -1,
"latest_version": -1,
"state": null
},
"brightness": 254
}
```