local device = {} device.model = "TS0222_solar_light" device.vendor = "Tuya" device.description = "Solar light sensor" device.exposes = { { type = "numeric", name = "illuminance", property = "illuminance", access = 5, unit = "lx", description = "Measured illuminance", }, { type = "numeric", name = "battery", property = "battery", access = 5, unit = "%", min = 0, max = 100, description = "Remaining battery in %", category = "diagnostic", }, } device.fromZigbee = { "illuminance", "battery" } device.configure = { bind = { "msIlluminanceMeasurement", "genPowerCfg" }, reporting = { { cluster = "msIlluminanceMeasurement", attribute = "measuredValue", min = 10, max = 3600, change = 5, }, { cluster = "genPowerCfg", attribute = "batteryPercentageRemaining", min = 3600, max = 65000, change = 0, }, { cluster = "genPowerCfg", attribute = "batteryVoltage", min = 3600, max = 65000, change = 0, }, }, } device.fingerprint = { { model = "TS0222", manufacturer = "_TZ3000_j6adk9id", }, } return device