home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.67k stars 30.43k forks source link

Add support for Dim- Light-CCT to Tuya Integration #127956

Open N3m3515 opened 1 week ago

N3m3515 commented 1 week ago

The problem

Dim- Light-CCT shows up as unsupported

What version of Home Assistant Core has the issue?

core-2024.10.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

tuya

Link to integration documentation on our website

https://www.home-assistant.io/integrations/tuya

Diagnostics information

tuya-01J2TZX9CB28M214R9A30YHTKB-Aussenleuchte 9a-bee94d2122d72af3ee5c0edef9fa86e8.json

Example YAML snippet

No response

Anything in the logs that might be useful for us?

},
  "integration_manifest": {
    "domain": "tuya",
    "name": "Tuya",
    "codeowners": [
      "Tuya",
      "zlinoliver",
      "frenck"
    ],
    "config_flow": true,
    "dependencies": [
      "ffmpeg"
    ],
    "dhcp": [
      {
        "macaddress": "105A17*"
      },
      {
        "macaddress": "10D561*"
      },
      {
        "macaddress": "1869D8*"
      },
      {
        "macaddress": "381F8D*"
      },
      {
        "macaddress": "508A06*"
      },
      {
        "macaddress": "68572D*"
      },
      {
        "macaddress": "708976*"
      },
      {
        "macaddress": "7CF666*"
      },
      {
        "macaddress": "84E342*"
      },
      {
        "macaddress": "D4A651*"
      },
      {
        "macaddress": "D81F12*"
      }
    ],
    "documentation": "https://www.home-assistant.io/integrations/tuya",
    "integration_type": "hub",
    "iot_class": "cloud_push",
    "loggers": [
      "tuya_iot"
    ],
    "requirements": [
      "tuya-device-sharing-sdk==0.1.9"
    ],
    "is_built_in": true
  },
  "setup_times": {
    "null": {
      "setup": 6.840098649263382e-05
    },
    "01J2TZX9CB28M214R9A30YHTKB": {
      "wait_import_platforms": -8.668071286287159,
      "wait_base_component": -0.03740110481157899,
      "config_entry_setup": 9.565174310002476
    }
  },
  "data": {
    "endpoint": "https://apigw.tuyaeu.com",
    "terminal_id": "1721040282821OBQLnX",
    "mqtt_connected": true,
    "disabled_by": null,
    "disabled_polling": false,
    "id": "bfc9edc0f96d3a3473yjmb",
    "name": "Aussenleuchte 9a",
    "category": "tyd",
    "product_id": "t9cac8gmr17wgact",
    "product_name": "Dim- Light-CCT",
    "online": false,
    "sub": false,
    "time_zone": "+02:00",
    "active_time": "2024-10-05T10:14:33+00:00",
    "create_time": "2024-10-05T10:14:33+00:00",
    "update_time": "2024-10-05T10:14:33+00:00",
    "function": {
      "switch_led": {
        "type": "Boolean",
        "value": {}
      },
      "work_mode": {
        "type": "Enum",
        "value": {
          "range": [
            "white",
            "colour",
            "scene",
            "music"
          ]
        }
      },
      "bright_value": {
        "type": "Integer",
        "value": {
          "min": 10,
          "max": 1000,
          "scale": 0,
          "step": 1
        }
      },
      "temp_value": {
        "type": "Integer",
        "value": {
          "min": 0,
          "max": 1000,
          "scale": 0,
          "step": 1
        }
      },
      "scene_data": {
        "type": "Json",
        "value": {}
      },
      "countdown": {
        "type": "Integer",
        "value": {
          "unit": "s",
          "min": 0,
          "max": 86400,
          "scale": 0,
          "step": 1
        }
      },
      "control_data": {
        "type": "Json",
        "value": {}
      },
      "rhythm_mode": {
        "type": "Raw",
        "value": {}
      },
      "wakeup_mode": {
        "type": "Raw",
        "value": {}
      },
      "power_memory": {
        "type": "Raw",
        "value": {}
      },
      "do_not_disturb": {
        "type": "Boolean",
        "value": {}
      },
      "cycle_timing": {
        "type": "Raw",
        "value": {}
      },
      "random_timing": {
        "type": "Raw",
        "value": {}
      }
    },
    "status_range": {
      "switch_led": {
        "type": "Boolean",
        "value": {}
      },
      "work_mode": {
        "type": "Enum",
        "value": {
          "range": [
            "white",
            "colour",
            "scene",
            "music"
          ]
        }
      },
      "bright_value": {
        "type": "Integer",
        "value": {
          "min": 10,
          "max": 1000,
          "scale": 0,
          "step": 1
        }
      },
      "temp_value": {
        "type": "Integer",
        "value": {
          "min": 0,
          "max": 1000,
          "scale": 0,
          "step": 1
        }
      },
      "scene_data": {
        "type": "Json",
        "value": {}
      },
      "countdown": {
        "type": "Integer",
        "value": {
          "unit": "s",
          "min": 0,
          "max": 86400,
          "scale": 0,
          "step": 1
        }
      },
      "rhythm_mode": {
        "type": "Raw",
        "value": {}
      },
      "wakeup_mode": {
        "type": "Raw",
        "value": {}
      },
      "power_memory": {
        "type": "Raw",
        "value": {}
      },
      "do_not_disturb": {
        "type": "Boolean",
        "value": {}
      },
      "cycle_timing": {
        "type": "Raw",
        "value": {}
      },
      "random_timing": {
        "type": "Raw",
        "value": {}
      }
    },
    "status": {
      "switch_led": true,
      "work_mode": "white",
      "bright_value": 1000,
      "temp_value": 0,
      "scene_data": {
        "scene_num": 1,
        "scene_units": [
          {
            "bright": 200,
            "h": 0,
            "s": 0,
            "temperature": 0,
            "unit_change_mode": "static",
            "unit_gradient_duration": 13,
            "unit_switch_duration": 14,
            "v": 0
          }
        ]
      },
      "countdown": 0,
      "rhythm_mode": "AAAAAAA=",
      "wakeup_mode": "AAA=",
      "power_memory": "AAEAAAAAAAAD6AAA",
      "do_not_disturb": false,
      "cycle_timing": "AAAA",
      "random_timing": "AAAA"
    },
    "home_assistant": {
      "name": "Aussenleuchte 9a",
      "name_by_user": null,
      "disabled": false,
      "disabled_by": null,
      "entities": []
    },
    "set_up": false,
    "support_local": true
  }
}

Additional information

No response

home-assistant[bot] commented 1 week ago

Hey there @tuya, @zlinoliver, @frenck, mind taking a look at this issue as it has been labeled with an integration (tuya) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `tuya` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign tuya` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


tuya documentation tuya source (message by IssueLinks)

jbusuttil83 commented 1 week ago

Is CCT mode available through the Tuya integration? I cannot get it to work.

N3m3515 commented 1 week ago

Is CCT mode available through the Tuya integration? I cannot get it to work.

Not yet. That is what this issue is about.

jbusuttil83 commented 1 week ago

@N3m3515 there is this PR open about it.

N3m3515 commented 1 week ago

@N3m3515 there is this PR open about it.

But the PR is not for this specific Light?

wedsa5 commented 6 days ago

Tuya should already support CCT afaik. The issue mentioned (and PR I opened) won't necessarily fix your problem. You should try testing it out with the provided code fix (in the PR) and your specific bulbs. The issue is about bulbs that don't support color temperature, but just a white mode.

Your bulb is likely not supported because the field "category" with value "tyd" is not in the list of available lights.

If you check light.py in the tuya component, you will see a pre-defined constant called LIGHTS which defines all the light categories and their TuyaLightEntityDescription. tyd is not in the list and needs to be added. Normal lights, like the one in the mentioned issue, are category dj.