Closed ascn closed 1 year ago
Can you upload the device info json? I want to check the schema of your device's brightness. On/Off
command will be auto added by homekit when slide the brightness bar, not instead of the brightness command, usually there's no side effect.
Yup, here it is!
{
"id": "redacted",
"schema": [
{
"oldCode": "bright_value",
"code": "bright_value",
"type": "Integer",
"onGet": "((((value - 25) / 230) * 99) + 1);",
"onSet": "((((value - 1) / 99) * 230) + 25);",
"property": {
"min": 1,
"max": 100,
"scale": 0,
"step": 1
}
}
]
}
I didn't mean the config file, I mean the device information json file which can be get from the log (/path/to/TuyaDeviceList.{uid}.json
)
It contains all the device info including category, status and schema :)
Usually the brightness schema is correct, no need to do this convertion manually.
My bad, here it is:
"active_time": 1671913151,
"biz_type": 0,
"category": "dj",
"create_time": 1671901691,
"icon": "smart/icon/ay1480002761059me2zH/x.png",
"id": "",
"ip": "",
"lat": "",
"local_key": "",
"lon": "",
"model": "",
"name": "Geeni BW223 Smart Filament Bulb",
"online": true,
"owner_id": "92637966",
"product_id": "",
"product_name": "Geeni BW223 Smart Filament Bulb",
"status": [
{
"code": "bright_value",
"value": 25
},
{
"code": "led_switch",
"value": true
},
{
"code": "temp_value",
"value": 0
}
],
"sub": false,
"time_zone": "-08:00",
"uid": "",
"update_time": 1671913151,
"uuid": "",
"schema": [
{
"code": "bright_value",
"mode": "rw",
"type": "Integer",
"property": {
"min": 25,
"max": 255,
"scale": 0,
"step": 1
}
},
{
"code": "led_switch",
"mode": "rw",
"type": "Boolean",
"property": {}
},
{
"code": "temp_value",
"mode": "rw",
"type": "Integer",
"property": {
"min": 0,
"max": 255,
"scale": 0,
"step": 1
}
}
]
}
Thanks for the information. Seems the schema is correct, so no need to set deviceOverrides
manually. Have you tried clean the accessory cache? And during the launch, the logs output: Light Accessory type: CW
is it right?
Yup, removed the manual deviceOverrides
. Also just reinstalled the plugin, the launch log has this:
[12/24/2022, 10:14:53 PM] [TuyaPlatform] [Geeni BW223 Smart Filament Bulb] Light Accessory type: CW
OK I know the reason: https://github.com/0x5e/homebridge-tuya-platform/blob/d5740d5605173153fa99219bbeac37237e19a1af/src/accessory/LightAccessory.ts#L181-L202
I see Characteristic.Brightness set to: xxx
from your log, so the onSet handler has been executed. And your device didn't have the work_mode
schema, then it goes to the else
block, nothing happends.
I will fix this later.
Thank you!
Please try beta.12
It works :) Thanks for fixing it so quickly!
Describe the bug Dimming does not work even with updated schema. Logs indicate wrong code sent on brightness change - the
switch_led
is sent instead of thebright_value
. When brightness in Homekit is changed, there is a brief delay before the brightness is set back to 100% and the light brightness does not change at all.Expected behavior Brightness in Homekit is changed, and then the light brightness is updated.
Device info