Skip to content

Tuya Fan can not set the speed #710

Open
@vampywiz17

Description

The problem

i can not set the tuya fan speed,only read the value

Environment

  • Localtuya version: 3.4.0
  • Last working localtuya version (if known and relevant): none
  • Home Assistant Core version: 2021.12.10
  • [NOT] Are you using the Home Assistant Tuya Cloud component ?
  • [NOT] Are you using the Tuya App in parallel ?

Steps to reproduce

  1. Set the correct DPS
  2. Open Fan entity
  3. Move Slide

Configuration configuration.yaml or config_flow

image

DP dump

    "status": [
      {
        "code": "switch_fan",
        "dp_id": 1,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "countdown_fan",
        "dp_id": 2,
        "type": "Integer",
        "values": "{\"unit\":\"s\",\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}"
      },
      {
        "code": "fan_speed_enum",
        "dp_id": 3,
        "type": "Enum",
        "values": "{\"range\":[\"level_1\",\"level_2\",\"level_3\",\"level_4\",\"level_5\"]}"
      },
      {
        "code": "fan_speed",
        "dp_id": 4,
        "type": "Integer",
        "values": "{\"unit\":\"%\",\"min\":1,\"max\":100,\"scale\":0,\"step\":1}"
      }
    ]
  },
  "success": true,
  "t": 1643059090409
}

Provide Home Assistant taceback/logs

2022-01-24 22:20:02 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf7...1au] Sending command heartbeat (device type: type_0a)
2022-01-24 22:20:02 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf7...1au] Send payload: b'{}'
2022-01-24 22:20:02 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf7...1au] Waiting for sequence number -100
2022-01-24 22:20:02 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf7...1au] Dispatching message TuyaMessage(seqno=0, cmd=9, retcode=0, payload=b'', crc=2958142211)
2022-01-24 22:20:02 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf7...1au] Got heartbeat response
2022-01-24 22:20:02 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf7...1au] Decrypted payload: {}
2022-01-24 22:20:03 DEBUG (MainThread) [custom_components.localtuya.discovery] Discovered device: {'ip': '192.168.31.223', 'gwId': '******************', 'active': 2, 'ability': 0, 'mode': 0, 'encrypt': True, 'productKey': '******************', 'version': '3.3'}
2022-01-24 22:20:04 DEBUG (MainThread) [custom_components.localtuya.fan] Fan async_set_percentage: 67
2022-01-24 22:20:04 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf7...1au] Sending command set (device type: type_0a)
2022-01-24 22:20:04 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf7...1au] Send payload: b'{"devId":"bf774d69bdd41812c191au","uid":"******************","t":"1643059204","dps":{"4":"67"}}'
2022-01-24 22:20:04 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf7...1au] Waiting for sequence number 4
2022-01-24 22:20:04 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf7...1au] Dispatching message TuyaMessage(seqno=4, cmd=7, retcode=0, payload=b'', crc=3089766919)
2022-01-24 22:20:04 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf7...1au] Dispatching sequence number 4
2022-01-24 22:20:04 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf7...1au] Decrypted payload: {}
2022-01-24 22:20:04 DEBUG (MainThread) [custom_components.localtuya.fan] Fan async_set_percentage: 67 > 67.0
2022-01-24 22:20:04 DEBUG (MainThread) [custom_components.localtuya.fan] Fan speed_count: 100

Additional information

Device link: https://www.aliexpress.com/item/1005002941694177.html

Other info:

If i set the speed value in Tuya app, it show correctly in HA. Only the "writing" side is not working.

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions