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

Make brightness optional for wind calm fan with light #1976

Merged

Conversation

christiaanderidder
Copy link
Contributor

@christiaanderidder christiaanderidder commented Jun 5, 2024

I bought the following wind calm fan from create: https://www.create-store.com/nl/kopen-plafondventilatoren-zonder-lamp/82468-wind-calm-plafondventilator-40w-silent-o132-cm.html?id_c=181245

This fan did not come with a dimmable light (DP 22), and therefore was not recognized. After making this DP optional there were no issues, the device gets recognized and works as expected.

The "Things Data Model" response for reference:

{
  "modelId": "f08l5s",
  "services": [
    {
      "actions": [],
      "code": "",
      "description": "",
      "events": [],
      "name": "默认服务",
      "properties": [
        {
          "abilityId": 20,
          "accessMode": "rw",
          "code": "switch_led",
          "description": "",
          "extensions": {
            "iconName": "icon-dp_power",
            "attribute": "1667"
          },
          "name": "灯开关",
          "typeSpec": {
            "type": "bool"
          }
        },
        {
          "abilityId": 21,
          "accessMode": "rw",
          "code": "work_mode",
          "description": "",
          "extensions": {
            "iconName": "icon-dp_mode",
            "attribute": "1664"
          },
          "name": "灯模式",
          "typeSpec": {
            "type": "enum",
            "range": [
              "white",
              "colour",
              "scene",
              "music"
            ]
          }
        },
        {
          "abilityId": 23,
          "accessMode": "rw",
          "code": "temp_value",
          "description": "",
          "extensions": {
            "iconName": "icon-dp_half",
            "attribute": "1664"
          },
          "name": "冷暖值",
          "typeSpec": {
            "type": "value",
            "max": 1000,
            "min": 0,
            "scale": 0,
            "step": 1
          }
        },
        {
          "abilityId": 25,
          "accessMode": "rw",
          "code": "scene_data",
          "description": "用于切换、编辑场景",
          "extensions": {
            "iconName": "icon-shoucang",
            "attribute": "1664"
          },
          "name": "场景",
          "typeSpec": {
            "type": "string",
            "maxlen": 255
          }
        },
        {
          "abilityId": 60,
          "accessMode": "rw",
          "code": "fan_switch",
          "description": "",
          "extensions": {
            "iconName": "icon-dp_power2",
            "attribute": "1664"
          },
          "name": "风扇开关",
          "typeSpec": {
            "type": "bool"
          }
        },
        {
          "abilityId": 62,
          "accessMode": "rw",
          "code": "fan_speed",
          "description": "",
          "extensions": {
            "iconName": "icon-FanSpeed",
            "attribute": "1664"
          },
          "name": "风速",
          "typeSpec": {
            "type": "value",
            "max": 6,
            "min": 1,
            "scale": 0,
            "step": 1,
            "unit": ""
          }
        },
        {
          "abilityId": 63,
          "accessMode": "rw",
          "code": "fan_direction",
          "description": "",
          "extensions": {
            "iconName": "icon-dp_mode",
            "attribute": "1664"
          },
          "name": "风向",
          "typeSpec": {
            "type": "enum",
            "range": [
              "forward",
              "reverse"
            ]
          }
        },
        {
          "abilityId": 64,
          "accessMode": "rw",
          "code": "fan_countdown_left",
          "description": "",
          "extensions": {
            "iconName": "icon-dp_time3",
            "attribute": "1664"
          },
          "name": "风扇倒计时",
          "typeSpec": {
            "type": "value",
            "max": 540,
            "min": 0,
            "scale": 0,
            "step": 1,
            "unit": "min"
          }
        }
      ]
    }
  ]
}

@make-all
Copy link
Owner

make-all commented Jun 7, 2024

Doesn't the lightbulb still show with brightness controls in HA with this change, but the brightness will not work (and possibly cause the lightbulb to drop the connection due to unexpected input)?

@christiaanderidder
Copy link
Contributor Author

Doesn't the lightbulb still show with brightness controls in HA with this change, but the brightness will not work (and possibly cause the lightbulb to drop the connection due to unexpected input)?

You are right, it does indeed still show the brightness slider, but it does not seem to have any adverse affects here.

Of course it would be easy to create a copy of the file for the non-dimmable variant of the fan and remove the brightness option altogether. I'd happily submit that change.

@make-all
Copy link
Owner

make-all commented Jun 8, 2024

Since the light has colour temperature control, I think HA will assume brightness is available as well, so maybe it won't make any difference to have a separate config.

@make-all make-all merged commit 6d46cfc into make-all:main Jun 8, 2024
4 checks passed
make-all added a commit that referenced this pull request Jun 9, 2024
timlaing pushed a commit to timlaing/tuya-local that referenced this pull request Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants