homebridge-tuya icon indicating copy to clipboard operation
homebridge-tuya copied to clipboard

Can only control low speed of fan using plugin

Open psycoticninja opened this issue 1 year ago • 6 comments

Checklist

  • [ y] I have read the common issues wiki page
  • [ y] I have checked to make sure the plugin is up to date

Describe the bug

When controlling fan via Home app, I can only control the low speed. Trying to change to medium/high speeds will turn off the fan.

In the Homebridge logs, I see the following (which is mentioned in the Common Issues Wiki BUT using homebridge-tuya-web plugin I cannot discover the device).

[Tuya] Sending Lounge Room Fan {"1":false}
[Tuya] Sending Lounge Room Fan {"1":false}
[Tuya] Heard back from Lounge Room Fan with command 8
[Tuya] Heard back from Lounge Room Fan with command 8
[Tuya] Sending Lounge Room Fan {"1":false}
[Tuya] Heard back from Lounge Room Fan with command 8
[Tuya] Sending Lounge Room Fan {"3":"1"}
[Tuya] Sending Lounge Room Fan {"1":true}
[Tuya] Sending Lounge Room Fan {"3":"1"}
[Tuya] Heard back from Lounge Room Fan with command 8
[Tuya] Sending Lounge Room Fan {"3":"1"}
[Tuya] Sending Lounge Room Fan {"3":"2"}
[Tuya] Sending Lounge Room Fan {"3":"2"}
[Tuya] Sending Lounge Room Fan {"3":"2"}
[Tuya] Sending Lounge Room Fan {"3":"3"}
[Tuya] Sending Lounge Room Fan {"3":"3"}
[Tuya] Sending Lounge Room Fan {"3":"1"}
[Tuya] Sending Lounge Room Fan {"1":false}
[Tuya] Sending Lounge Room Fan {"1":false}
[Tuya] Heard back from Lounge Room Fan with command 8
[Tuya] Sending Lounge Room Fan {"1":false}
[Tuya] Heard back from Lounge Room Fan with command 8
[Tuya] Sending Lounge Room Fan {"3":"1"}
[Tuya] Sending Lounge Room Fan {"1":true}
[Tuya] Heard back from Lounge Room Fan with command 8
[Tuya] Heard back from Lounge Room Fan with command 8

The device in question is Arlec 40cm Smart Pedestal Fan With Remote.

From the Tuya IoT platform site for the fan I can control the speeds 1-3 and this works.

To Reproduce

Steps to reproduce the behavior:

Control fan via Home app, speeds 2 and 3 (medium/high) turn off the fan.

Expected behavior

A clear and concise description of what you expected to happen.

When set to 50%, change to medium speed. When set to 100%, change to high speed.

Screenshots

Environment (please complete the following information):

  • OS: Raspbian OS Lite
  • iOS version: 17.1
  • Homehubs: Homebridge running latest version
  • Node Version: 18.18.2
  • Plugin Version: 2.0.1
  • Accessory Type: Fan

Additional context Add any other context about the problem here.

Controlling the fan via Tuya IoT Platform (standard instructions):

fan_speed_percent	
Integer	
{
  "unit": "",
  "min": 1,
  "max": 3,
  "scale": 0,
  "step": 1
}

Plugin configuration snippet

   "devices": [
        {
            "name": "Lounge Room Fan",
            "type": "Fan",
            "manufacturer": "Arlec",
            "model": "40cm Smart Pedestal Fan With Remote",
            "id": "XXX",
            "key": "XXX",
            "dpActive": "1",
            "dpRotationSpeed": "3"
        }

Is this a issue with the API or potentially a plugin misconfiguration? It is strange that this works via Tuya IoT platform but not the plugin itself.

psycoticninja avatar Oct 29 '23 04:10 psycoticninja

Hi @psycoticninja, I have pushed a new beta (3.1.0-beta.2). I have made a few changes to the fan controller logic. Can you give it a try on that version and see if that fixes the issue?

05TEVE avatar Jan 15 '24 11:01 05TEVE

Hi @05TEVE, I’ve just updated to the beta plugin and tested this but it looks like I am still seeing the same issue.

psycoticninja avatar Jan 15 '24 12:01 psycoticninja

Is it possible to provide the Tuya Device Specifications here? You should be able to find this in JSON format from the Tuya API. Device Controls -> Query Properties.

I am guessing that the DP id specified for the speed controls may not be right.

05TEVE avatar Jan 15 '24 22:01 05TEVE

Updated just in case of any unnecessary IDs potentially exposed.

{
  "result": {
    "properties": [
      {
        "code": "switch",
        "custom_name": "",
        "dp_id": 1,
        "time": 1705320408162,
        "value": false
      },
      {
        "code": "mode",
        "custom_name": "",
        "dp_id": 2,
        "time": 1705291321204,
        "value": "Normal"
      },
      {
        "code": "fan_speed",
        "custom_name": "",
        "dp_id": 3,
        "time": 1705319971441,
        "value": 1
      },
      {
        "code": "switch_horizontal",
        "custom_name": "",
        "dp_id": 5,
        "time": 1705291321430,
        "value": false
      },
      {
        "code": "light",
        "custom_name": "",
        "dp_id": 15,
        "time": 1705320383119,
        "value": true
      },
      {
        "code": "countdown_set",
        "custom_name": "",
        "dp_id": 22,
        "time": 1705291321632,
        "value": "cancel"
      },
      {
        "code": "countdown_left",
        "custom_name": "",
        "dp_id": 23,
        "time": 1705291321728,
        "value": 0
      }
    ]
  },
  "success": true,
  "t": 1705359944732,
  "tid": "XXXXXXXXXXXXXXXXXXXX"
}

psycoticninja avatar Jan 16 '24 12:01 psycoticninja

Hi @05TEVE did you ever get a chance to look at this further?

I ended up installing the latest plugin v3.1,0, the issue is still present.

I have Max Speed set to 3 and Default Speed to 2.

Any ideas?

psycoticninja avatar Mar 29 '24 23:03 psycoticninja

If you use tuya-cli to pull the switch parameters, does that match the queried properties?

jlg89 avatar May 25 '24 14:05 jlg89