local device = {} device.model = "TS0601_fan_5_levels_and_light_5_levels" device.vendor = "Tuya" device.description = "Fan with 5 levels and light with 5 levels" device.exposes = { { type = "light", features = { { type = "binary", name = "state", property = "state", access = 7, value_on = "ON", value_off = "OFF", description = "On/off state of this light", }, { type = "numeric", name = "brightness", property = "brightness", access = 7, min = 0, max = 254, description = "Brightness of this light", }, }, }, { type = "binary", name = "fan_state", property = "fan_state", access = 3, value_on = "ON", value_off = "OFF", description = "Fan on/off", }, { type = "numeric", name = "fan_speed", property = "fan_speed", access = 3, min = 1, max = 5, value_step = 1, description = "Fan speed (1=slowest, 5=fastest)", }, } device.tuyaDatapoints = { { dp = 1, name = "fan_state", converter = "onOff" }, { dp = 6, name = "fan_speed", converter = "lookup" }, { dp = 104, name = "state", converter = "onOff" }, } device.fingerprint = { { model = "TS0601", manufacturer = "_TZE284_ikul00sx", }, } return device