Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TreatLife DS03 RotationSpeed is not a number #472

Open
jlg89 opened this issue May 25, 2024 · 2 comments
Open

TreatLife DS03 RotationSpeed is not a number #472

jlg89 opened this issue May 25, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@jlg89
Copy link

jlg89 commented May 25, 2024

Describe the bug

This doesn't appear to be causing any functional issues, but it's worth noting, and maybe worth fixing if it could potentially cause problems in the future.

I have a couple of TreatLife DS03 combo switches. Currently testing this FanLight config:

{
            "type": "FanLight",
            "name": "Ceiling Fan",
            "id": "<redacted>",
            "key": "<redacted, but what a pain in the butt it is to acquire these!>",
            "manufacturer": "TreatLife",
            "model": "Ceiling Fan Dimmer Switch DS03",
            "dpLight": 9,
            "dpBrightness": 10,
            "useBrightness": true,
            "minBrightness": 100,
            "scaleBrightness": 1000,
            "dpActive": 1,
            "dpRotationSpeed": 2,
            "maxSpeed": 4
}

For some reason the switches (these are firmware v3.3) send the fan speed as text instead of a number. I have confirmed this with tuya-cli. The response looks like this:

{
  '1': true,
  '3': '4',         <---- fan speed is sent as a text string ¯\_( ͠° ͟ʖ ͠°)_/¯
  '9': true,
  '10': 1000,
  '105': 100,
  '106': 'mode1',
  '108': 1
}

This causes an error in the log, since the plugin obviously expects a number instead of text:

[5/25/2024, 8:54:48 AM] [homebridge-tuya] Connected to Ceiling Fan
[5/25/2024, 8:54:48 AM] [homebridge-tuya] Ready to handle Ceiling Fan (FanLight:3.3) with signature {"1":true,"3":"3","9":false,"10":1000,"105":100,"106":"mode1","108":1}
[5/25/2024, 8:54:48 AM] [homebridge-tuya] This plugin generated a warning from the characteristic 'Rotation Speed': characteristic value expected valid finite number and received "NaN" (number). See https://homebridge.io/w/JtMGR for more info.

Environment

  • OS: macOS 12.7.5
  • iOS version: 17.5
  • Homehubs: 2x ATV 4K
  • Node Version: 20.13.1
  • Plugin Version: 3.1.1
  • Accessory Type: FanLight
@jlg89 jlg89 added the bug Something isn't working label May 25, 2024
@jlg89
Copy link
Author

jlg89 commented May 25, 2024

Sorry, same as #461

@jlg89
Copy link
Author

jlg89 commented May 25, 2024

Actually, I just noticed that when I define dpActive and dpRotationSpeed, fan speed does not appear properly in HomeKit; it's always 0%. If I eliminate those settings and only define maxSpeed, the fan controls work properly.

Still having issues getting the dimmer control working properly, but that's a different issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants