local device = {} device.model = "NMRD_1G_Switch_LN" device.vendor = "Legrand" device.description = "1-gang wired switch with neutral (LN)" device.zigbeeModel = { "NMRD_1G_Switch_LN" } -- 1-gang: expose a single on/off state. The device advertises genOnOff on a -- secondary endpoint too, but this is not a real second gang (matches z2m, which -- uses a plain m.onOff() for this Legrand family). Binding a converter here also -- bypasses the multi-endpoint fallback that would otherwise emit `state_l1`. device.exposes = { { type = "switch", features = { { type = "binary", name = "state", property = "state", access = 7, value_on = "ON", value_off = "OFF", description = "On/off state of the switch", }, }, }, } device.fromZigbee = { "on_off" } device.toZigbee = { "on_off" } device.configure = { bind = { "genOnOff" }, reporting = { { cluster = "genOnOff", attribute = "onOff", min = 0, max = 3600, change = 0 }, }, } return device