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 with two lights is not supported #490

Open
2 tasks done
slavvka opened this issue Aug 20, 2024 · 0 comments
Open
2 tasks done

Fan with two lights is not supported #490

slavvka opened this issue Aug 20, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@slavvka
Copy link
Sponsor

slavvka commented Aug 20, 2024

Prerequisite

  • Yes, I've read the readme completely.

Cache

  • Yes, I've cleaned accessory cache and the issue still exists.

Version

v1.7.0-beta.54

Device Infomation JSON File

{
    "active_time": 1652912367,
    "biz_type": 18,
    "category": "fs",
    "create_time": 1652912367,
    "icon": "smart/icon/ay1521094467047NKhOJ/1568691199fcace5ecd36.png",
    "model": "CES603FL",
    "name": "Patio Smart Ceiling Fan",
    "online": true,
    "owner_id": "39150358",
    "product_id": "pwn8rplbjtokxaec",
    "product_name": "启正风扇灯",
    "status": [
      {
        "code": "bright_value",
        "value": 260
      },
      {
        "code": "bright_value_1",
        "value": 100
      },
      {
        "code": "fan_speed",
        "value": "10"
      },
      {
        "code": "light",
        "value": false
      },
      {
        "code": "switch",
        "value": false
      },
      {
        "code": "switch_led",
        "value": false
      }
    ],
    "sub": false,
    "update_time": 1724167899,
    "schema": [
      {
        "code": "bright_value",
        "mode": "rw",
        "type": "Integer",
        "property": {
          "min": 10,
          "max": 1000,
          "scale": 0,
          "step": 1
        }
      },
      {
        "code": "bright_value_1",
        "mode": "rw",
        "type": "Integer",
        "property": {
          "min": 10,
          "max": 1000,
          "scale": 0,
          "step": 1
        }
      },
      {
        "code": "fan_speed",
        "mode": "rw",
        "type": "Enum",
        "property": {
          "range": [
            "1",
            "2",
            "3",
            "4",
            "5",
            "6",
            "7",
            "8",
            "9",
            "10"
          ]
        }
      },
      {
        "code": "light",
        "mode": "rw",
        "type": "Boolean",
        "property": {}
      },
      {
        "code": "switch",
        "mode": "rw",
        "type": "Boolean",
        "property": {}
      },
      {
        "code": "switch_led",
        "mode": "rw",
        "type": "Boolean",
        "property": {}
      }
    ]
  }

Device Control Mode

Standard Instruction

Logs

[20/08/2024, 11:47:00] [Tuya] [Patio Smart Ceiling Fan] [Fan/undefined/On] Update value: false => true
[20/08/2024, 11:47:02] [Tuya] [Patio Smart Ceiling Fan] [Fan/undefined/RotationSpeed] Update value: 10 => 4
[20/08/2024, 11:47:04] [Tuya] [Patio Smart Ceiling Fan] [Fan/undefined/On] Update value: true => false
[20/08/2024, 11:47:06] [Tuya] [Patio Smart Ceiling Fan] [Lightbulb/undefined/On] Update value: false => true
[20/08/2024, 11:47:08] [Tuya] [Patio Smart Ceiling Fan] [Lightbulb/undefined/Brightness] Update value: 26 => 45
[20/08/2024, 11:47:09] [Tuya] [Patio Smart Ceiling Fan] [Lightbulb/undefined/On] Update value: true => false

Other Infomations

Hi. So I have a fan with two separate lights. The first one is warm while the second one is white. In the logs I:

  1. Turned on the fan
  2. Change its speed
  3. Turned it off
  4. Turned on the warm light
  5. Changed it brightness
  6. Turned it off
  7. Turned on the white light
  8. Changed its brightness
  9. Turned it of

As you can see in the logs only the fan and the warm light (steps 1-6) are controllable. I tried to update the Fan accessory but it seems impossible to do without serious changes to the frameworks since an accessory can have only one service of each type (so no two services of Lightbulb service) since they are addressed only by their type and not the subtype. Or I just didn't get how to do it.

To make it easier the white light is controlled by switch_led and bright_value_1 instructions.

Appreciate your help in advance. As a thought probably it make sense to have accessories updated so they could support several services of the same type.

@slavvka slavvka added the bug Something isn't working label Aug 20, 2024
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

1 participant