local device = {} device.model = "TS0601_cover_7" device.vendor = "Tuya" device.description = "Cover motor" device.exposes = { { type = "cover", features = { { type = "enum", name = "state", property = "state", access = 3, values = { "OPEN", "CLOSE", "STOP" }, }, { type = "numeric", name = "position", property = "position", access = 3, 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 = { "battery" } device.tuyaDatapoints = { { dp = 1, name = "state", converter = "lookup", lookup = { OPEN = 0, STOP = 1, CLOSE = 2 } }, { dp = 2, name = "position", converter = "coverPosition" }, { dp = 3, name = "position", converter = "raw" }, { dp = 101, name = "battery", converter = "raw" }, } 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, }, }, } device.fingerprint = { { model = "TS0601", manufacturer = "_TZE200_zvo63cmo", }, } return device