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

Fan - Setting RotationSpeed #112

Open
CameronSmith93 opened this issue Nov 5, 2020 · 13 comments
Open

Fan - Setting RotationSpeed #112

CameronSmith93 opened this issue Nov 5, 2020 · 13 comments
Labels
active Should stay opened bug Something isn't working help wanted Extra attention is needed

Comments

@CameronSmith93
Copy link

CameronSmith93 commented Nov 5, 2020

Device type

Stirling FS1-40DCWIFI Pedestal Fan

Device information

{   u'header': {   u'code': u'SUCCESS', u'payloadVersion': 1},
    u'payload': {   u'devices': [   {   u'data': {   u'online': True,
                                                     u'speed': u'3',
                                                     u'speed_level': 15,
                                                     u'state': u'false'},
                                        u'dev_type': u'fan',
                                        u'ha_type': u'fan',
                                        u'icon': u'https://images.tuyaeu.com/smart/icon/bay1589359175993MeEh/159540337782efe7f8e63.jpg',
                                        u'id': u'<redacted>',
                                        u'name': u'FS1-40DCWIFI'}],
                    u'scenes': []}}

Issue

Toggling on/off the fan via HomeKit works correctly.
However, when setting any rotation speed, the fan shows a speed of '00' on the physical display and stops rotating.

Setting the rotation speed via the TuyaSmart app works correctly.

Let me know what else I can provide to assist in diagnosing the issue.

@CameronSmith93 CameronSmith93 changed the title [NEW DEVICE] Fan - Setting RotationSpeed Nov 5, 2020
@milo526
Copy link
Owner

milo526 commented Nov 5, 2020

Hey! Thank you for opening an issue.

In your logs you should be able to find some log lines that look something like the following

[device_name] Characteristic.RotationSpeed [SET] xxxx xxxx

Could you please provide me with your log after you set the rotation speed, then I can see what values are being transmitted and see what goes wrong there.

@milo526 milo526 added the bug Something isn't working label Nov 5, 2020
@CameronSmith93
Copy link
Author

CameronSmith93 commented Nov 5, 2020

Thanks for looking into this!
Here are some values I've triggered just now:

[11/6/2020, 10:25:13] [TuyaWebPlatform] [FS1-40DCWIFI] Characteristic.RotationSpeed - [SET] 24 4
[11/6/2020, 10:25:13] [TuyaWebPlatform] [FS1-40DCWIFI] Characteristic.Active - [SET] 1 1
[11/6/2020, 10:25:15] [TuyaWebPlatform] [FS1-40DCWIFI] Characteristic.RotationSpeed - [SET] 30 5
[11/6/2020, 10:25:15] [TuyaWebPlatform] [FS1-40DCWIFI] Characteristic.Active - [SET] 1 1
[11/6/2020, 10:25:17] [TuyaWebPlatform] [FS1-40DCWIFI] Characteristic.Active - [SET] 1 1
[11/6/2020, 10:25:17] [TuyaWebPlatform] [FS1-40DCWIFI] Characteristic.RotationSpeed - [SET] 36 6
[11/6/2020, 10:25:20] [TuyaWebPlatform] [FS1-40DCWIFI] Characteristic.Active - [SET] 1 1
[11/6/2020, 10:25:20] [TuyaWebPlatform] [FS1-40DCWIFI] Characteristic.RotationSpeed - [SET] 24 4
[11/6/2020, 10:25:21] [TuyaWebPlatform] [FS1-40DCWIFI] Characteristic.Active - [SET] 1 1
[11/6/2020, 10:25:21] [TuyaWebPlatform] [FS1-40DCWIFI] Characteristic.RotationSpeed - [SET] 18 3
[11/6/2020, 10:25:28] [TuyaWebPlatform] [FS1-40DCWIFI] Characteristic.Active - [SET] 0 0

Edit: Just for clarification, it's a 15-speed fan.

@milo526
Copy link
Owner

milo526 commented Nov 12, 2020

I have no clue what the problem is here.
It seems like the plugin is sending very reasonable values, I've tried it with my fan and that one works fine.

@CameronSmith93
Copy link
Author

Yes, very strange indeed.

Is there anything that I can provide you with to assist with a diagnosis? Packet or request/response capture of working traffic from the Tuya app?

@milo526 milo526 added active Should stay opened help wanted Extra attention is needed labels Nov 27, 2020
@milo526
Copy link
Owner

milo526 commented Nov 27, 2020

I cannot reproduce this issue and at the moment do not have the time to debug this with you sadly.

I would love for somebody to be able to submit a PR for this.

@patrickl96
Copy link

I've got a very similar problem. I've also submitted an issue for this.

@BobbyLindsey
Copy link

I have a similar issue with my fan. For my fan, it looks like maybe the speeds are not set by percentage, but simply enumerated. My fan has three speeds. When I set it to the medium speed in the Smart Life app, I see this in the HomeBridge logs:

[05/03/2021, 00:03:28] [TuyaWebPlatform] [Ceiling Fan] Characteristic.Active - [GET] true
[05/03/2021, 00:03:28] [TuyaWebPlatform] [Ceiling Fan] Characteristic.RotationSpeed - [GET] 2

@BobbyLindsey
Copy link

Also, on startup, it seems to indicate the number of speeds; three in my case:

[05/03/2021, 00:11:16] [TuyaWebPlatform] [Ceiling Fan] deviceConfig: {
  data: { online: true, state: 'false', speed_level: 3, speed: '2' },
  name: 'Ceiling Fan',
  icon: 'https://images.tuyaus.com/smart/icon/ay1566306500214Y6P2j/15856618854f216b2db9c.png',
  id: 'removed',
  dev_type: 'fan',
  ha_type: 'fan'
}

@milo526
Copy link
Owner

milo526 commented Mar 6, 2021

I guess there is a rounding error somewhere.
I'm strongly contemplating moving away from percentage based device control and instead move back to level based control thus only allowing you to select steps 0 (off), 1, 2, ... up til the max your device supports.

@CameronSmith93
Copy link
Author

I'm inclined to agree with the suggestion of it being a rounding error - incrementing the speed on my 15-speed fan increases the percentage display by 6%, for a max speed displayed of 90% rather than 100%.

Looking forward to level based control if/when you have the time to make the change!

@pcm1ke
Copy link

pcm1ke commented Sep 21, 2021

Any word on if/when this change to fan levels, rather than percentages may occur?

Thank you

@milo526
Copy link
Owner

milo526 commented Oct 4, 2021

No updates at the moment.

@wailuen
Copy link

wailuen commented Feb 26, 2023

I have many ceiling fan and there many line of this generated in the log. Although, everything seems to be work, is there any I can do to get this off the log?

[homebridge-tuya-platform] This plugin generated a warning from the characteristic 'Rotation Speed': characteristic was supplied illegal value: number 166 exceeded maximum of 100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
active Should stay opened bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants