local device = {} device.model = "ZBCurtain" device.vendor = "SONOFF" device.description = "Zigbee smart curtain motor" device.zigbeeModel = { "ZBCurtain" } device.exposes = { { type = "cover", features = { { type = "enum", name = "state", property = "state", access = 3, values = { "OPEN", "CLOSE", "STOP" }, }, { type = "numeric", name = "position", property = "position", access = 7, unit = "%", min = 0, max = 100, description = "Position of this cover", }, }, }, { type = "numeric", name = "battery", property = "battery", access = 1, unit = "%", min = 0, max = 100, description = "Remaining battery in %, can take up to 24 hours before reported", category = "diagnostic", }, } device.fromZigbee = { "cover", "battery" } device.toZigbee = { "cover" } device.configure = { bind = { "genPowerCfg" }, reporting = { { cluster = "genPowerCfg", attribute = "batteryPercentageRemaining", min = 3600, max = 65000, change = 0, }, { cluster = "genPowerCfg", attribute = "batteryVoltage", min = 3600, max = 65000, change = 0, }, }, } return device