iRayanKhan / homebridge-tuya

A Homebridge plugin to control Tuya devices locally.
MIT License
380 stars 160 forks source link

TreatLife DS03 dimmer not working #473

Open jlg89 opened 1 month ago

jlg89 commented 1 month ago

Describe the bug I can't get the dimming function to work from HomeKit for my TreatLife DS03 combo switches.

With useBrightness disabled, I can toggle the light on/off from HomeKit, and when on it retains whatever brightness setting was last selected on the switch itself (or in the Tuya app).

With useBrightness enabled, when I first pull up the dimmer in HomeKit, it shows the actual value (i.e. minBrightness to 1000), with the yellow slider extending off the bottom of the screen, instead of scaling to HomeKit's 0-100%.

IMG_0272

As soon as I adjust the slider, it pops to 0-100% mode, but the only places it will "stick" are minBrightness or full on. What's odd is that the button in the main HomeKit screen shows the correct percentage (in this case 50%), but when I tap to pull up the slider it shows 500% initially.

Current config looks like this:

{
            "type": "FanLight",
            "name": "Ceiling Fan",
            "id": "<redacted>",
            "key": "<redacted>",
            "manufacturer": "TreatLife",
            "model": "Ceiling Fan Dimmer Switch DS03",
            "dpBrightness": 10,
            "useBrightness": true,
            "minBrightness": 100,
            "scaleBrightness": 1000,
            "maxSpeed": 4
}

According to tuya-cli, the dpBrightness is 10, minimum brightness is data point 105:

{
  '1': true,
  '3': '4',
  '9': true,
  '10': 1000,
  '105': 100,
  '106': 'mode1',
  '108': 1
}

The log shows odd "unreachable by faulting Service" errors. But the fan portion works, so I'm guessing that isn't a big deal.

[5/25/2024, 10:35:08 AM] [homebridge-tuya] Launched child bridge with PID 62727
[5/25/2024, 10:35:08 AM] [homebridge-tuya] Loaded homebridge-tuya v3.1.1 child bridge successfully
[5/25/2024, 10:35:08 AM] Loaded 2 cached accessories from cachedAccessories.0E356DAD8C99.
[5/25/2024, 10:35:08 AM] [homebridge-tuya] Marked Study Ceiling Fan unreachable by faulting Service.Study Ceiling Fan.On
[5/25/2024, 10:35:08 AM] [homebridge-tuya] Marked Study Ceiling Fan unreachable by faulting Service.Study Ceiling Fan Light.On
[5/25/2024, 10:35:08 AM] [homebridge-tuya] Marked East Bedroom Ceiling Fan unreachable by faulting Service.East Bedroom Ceiling Fan.On
[5/25/2024, 10:35:08 AM] [homebridge-tuya] Marked East Bedroom Ceiling Fan unreachable by faulting Service.East Bedroom Ceiling Fan Light.On
[5/25/2024, 10:35:08 AM] Loaded 4 cached accessories from cachedAccessories.0E41BE9EAD2C.
[5/25/2024, 10:35:08 AM] [homebridge-tuya] Starting discovery...
[5/25/2024, 10:35:08 AM] [homebridge-tuya] Discovery - Discovery started on port 6666.
[5/25/2024, 10:35:08 AM] [homebridge-tuya] Discovery - Discovery started on port 6667.
[5/25/2024, 10:35:10 AM] [homebridge-tuya] Discovered East Bedroom Ceiling Fan (<redacted>) identified as FanLight (3.3)
[5/25/2024, 10:35:10 AM] [homebridge-tuya] East Bedroom Ceiling Fan has a different type (1 vs undefined)
[5/25/2024, 10:35:10 AM] [homebridge-tuya] Unregistering East Bedroom Ceiling Fan
[5/25/2024, 10:35:10 AM] [homebridge-tuya] Connected to East Bedroom Ceiling Fan
[5/25/2024, 10:35:10 AM] [homebridge-tuya] Ready to handle East Bedroom Ceiling Fan (FanLight:3.3) with signature {"1":true,"3":"3","9":true,"10":500,"105":100,"106":"mode1","108":1}
[5/25/2024, 10:35:13 AM] [homebridge-tuya] Discovered Study Ceiling Fan (<redacted>) identified as FanLight (3.3)
[5/25/2024, 10:35:13 AM] [homebridge-tuya] Study Ceiling Fan has a different type (1 vs undefined)
[5/25/2024, 10:35:13 AM] [homebridge-tuya] Unregistering Study Ceiling Fan
[5/25/2024, 10:35:13 AM] [homebridge-tuya] Discovery ended.
[5/25/2024, 10:35:13 AM] [homebridge-tuya] Connected to Study Ceiling Fan
[5/25/2024, 10:35:13 AM] [homebridge-tuya] Ready to handle Study Ceiling Fan (FanLight:3.3) with signature {"1":false,"3":"2","9":true,"10":100,"105":50,"106":"mode3","108":1}

Environment