To contribute to this page, edit the following file
Xiaomi QBKG03LM #
Model | QBKG03LM |
Vendor | Xiaomi |
Description | Aqara double key wired wall switch without neutral wire. Doesn’t work as a router and doesn’t support power meter |
Exposes | switch (state), temperature, action, linkquality |
Picture | ![]() |
Notes #
Deprecated click event #
By default this device exposes a deprecated click
event. It’s recommended to use the action
event instead.
To disable the click
event, set legacy: false
for this device in configuration.yaml
. Example:
devices:
'0x12345678':
friendly_name: my_device
legacy: false
Pairing #
Press and hold the button on the device for +- 10 seconds (until the blue light starts blinking and stops blinking), release and wait.
You may have to unpair the switch from an existing coordinator before the pairing process will start.
Device type specific configuration #
How to use device type specific configuration
-
legacy
: Set tofalse
to disable the legacy integration (highly recommended!) (default: true) temperature_precision
: Controls the precision oftemperature
values, e.g.0
,1
or2
; default2
. To control the precision based on the temperature value set it to e.g.{30: 0, 10: 1}
, when temperature >= 30 precision will be 0, when temperature >= 10 precision will be 1.temperature_calibration
: Allows to manually calibrate temperature values, e.g.1
would add 1 degree to the temperature reported by the device; default0
.
Decoupled mode #
Decoupled mode allows to turn wired switch into wireless button with separately controlled relay. This might be useful to assign some custom actions to buttons and control relay remotely. This command also allows to redefine which button controls which relay for the double switch (not supported for QBKG25LM).
Topic zigbee2mqtt/FRIENDLY_NAME/system/set
should be used to modify operation mode.
NOTE: For QBKG25LM instead of system
use left
, center
or right
and leave out the button
property in the payload.
Payload:
{
"operation_mode": {
"button": "single"|"left"|"right", // Always use single for a single switch
"state": "VALUE"
}
}
Values | Description |
---|---|
control_relay |
Button directly controls relay (for single switch and QBKG25LM) |
control_left_relay |
Button directly controls left relay (for double switch, not supported for QBKG25LM) |
control_right_relay |
Button directly controls right relay (for double switch, not supported for QBKG25LM) |
decoupled |
Button doesn’t control any relay |
zigbee2mqtt/FRIENDLY_NAME/system/get
to read current mode.
Payload:
{
"operation_mode": {
"button": "single"|"left"|"right" // Always use single for a single switch
}
}
Response will be sent to zigbee2mqtt/FRIENDLY_NAME
, example: {"operation_mode_right":"control_right_relay"}
Exposes #
Switch (left endpoint) #
The current state of this switch is in the published state under the state_left
property (value is ON
or OFF
).
To control this switch publish a message to topic zigbee2mqtt/FRIENDLY_NAME/set
with payload {"state_left": "ON"}
, {"state_left": "OFF"}
or {"state_left": "TOGGLE"}
.
To read the current state of this switch publish a message to topic zigbee2mqtt/FRIENDLY_NAME/get
with payload {"state_left": ""}
.
Switch (right endpoint) #
The current state of this switch is in the published state under the state_right
property (value is ON
or OFF
).
To control this switch publish a message to topic zigbee2mqtt/FRIENDLY_NAME/set
with payload {"state_right": "ON"}
, {"state_right": "OFF"}
or {"state_right": "TOGGLE"}
.
To read the current state of this switch publish a message to topic zigbee2mqtt/FRIENDLY_NAME/get
with payload {"state_right": ""}
.
Temperature (numeric) #
Measured temperature value.
Value can be found in the published state on the temperature
property.
It’s not possible to read (/get
) or write (/set
) this value.
The unit of this value is °C
.
Action (enum) #
Triggered action (e.g. a button click).
Value can be found in the published state on the action
property.
It’s not possible to read (/get
) or write (/set
) this value.
The possible values are: single_left
, single_right
, single_both
.
Linkquality (numeric) #
Link quality (signal strength).
Value can be found in the published state on the linkquality
property.
It’s not possible to read (/get
) or write (/set
) this value.
The minimal value is 0
and the maximum value is 255
.
The unit of this value is lqi
.
Manual Home Assistant configuration #
Although Home Assistant integration through MQTT discovery is preferred, manual integration is possible with the following configuration:
sensor:
- platform: "mqtt"
state_topic: "zigbee2mqtt/<FRIENDLY_NAME>"
availability_topic: "zigbee2mqtt/bridge/state"
icon: "mdi:toggle-switch"
value_template: "{{ value_json.click }}"
switch:
- platform: "mqtt"
state_topic: "zigbee2mqtt/<FRIENDLY_NAME>"
availability_topic: "zigbee2mqtt/bridge/state"
payload_off: "OFF"
payload_on: "ON"
value_template: "{{ value_json.state_left }}"
command_topic: "zigbee2mqtt/<FRIENDLY_NAME>/left/set"
switch:
- platform: "mqtt"
state_topic: "zigbee2mqtt/<FRIENDLY_NAME>"
availability_topic: "zigbee2mqtt/bridge/state"
payload_off: "OFF"
payload_on: "ON"
value_template: "{{ value_json.state_right }}"
command_topic: "zigbee2mqtt/<FRIENDLY_NAME>/right/set"
sensor:
- platform: "mqtt"
state_topic: "zigbee2mqtt/<FRIENDLY_NAME>"
availability_topic: "zigbee2mqtt/bridge/state"
unit_of_measurement: "°C"
value_template: "{{ value_json.temperature }}"
device_class: "temperature"
sensor:
- platform: "mqtt"
state_topic: "zigbee2mqtt/<FRIENDLY_NAME>"
availability_topic: "zigbee2mqtt/bridge/state"
value_template: "{{ value_json.action }}"
icon: "mdi:gesture-double-tap"
sensor:
- platform: "mqtt"
state_topic: "zigbee2mqtt/<FRIENDLY_NAME>"
availability_topic: "zigbee2mqtt/bridge/state"
unit_of_measurement: "lqi"
value_template: "{{ value_json.linkquality }}"
icon: "mdi:signal"