local device = {} device.model = "QBKG22LM" device.vendor = "Aqara" device.description = "Smart wall switch D1 (no neutral, double rocker)" device.zigbeeModel = { "lumi.switch.b2lacn02" } device.exposes = { { type = "switch", endpoint = "left", features = { { type = "binary", name = "state", property = "state_left", access = 7, value_on = "ON", value_off = "OFF", description = "On/off state of the switch", endpoint = "left", }, }, }, { type = "switch", endpoint = "right", features = { { type = "binary", name = "state", property = "state_right", access = 7, value_on = "ON", value_off = "OFF", description = "On/off state of the switch", endpoint = "right", }, }, }, { type = "enum", name = "operation_mode", property = "operation_mode_left", access = 7, description = "Operation mode for left button", endpoint = "left", values = { "control_left_relay", "control_right_relay", "decoupled" }, }, { type = "enum", name = "operation_mode", property = "operation_mode_right", access = 7, description = "Operation mode for right button", endpoint = "right", values = { "control_left_relay", "control_right_relay", "decoupled" }, }, { type = "enum", name = "action", property = "action", access = 1, description = "Triggered action (e.g. a button click)", category = "diagnostic", values = { "release_left", "release_right", "release_both", "double_left", "double_right", "single_left", "single_right", "hold_release_left", }, }, } device.fromZigbee = { "on_off" } device.toZigbee = { "on_off" } device.configure = { bind = { "genOnOff" }, reporting = { { cluster = "genOnOff", attribute = "onOff", min = 0, max = 3600, change = 0, }, }, } device.meta = { multiEndpoint = true } device.endpoint = { system = 1, left = 2, right = 3, } return device