talrhv / tuya-homebridge

Homebridge custom plugin for controlling Powered by Tuya (PBT) devices in HomeKit. This plugin is officially maintained by the Tuya Developer Team.
MIT License
3 stars 7 forks source link

Color temp control inverted #5

Open shashchatter opened 1 year ago

shashchatter commented 1 year ago

Describe the bug Home app temperature control inverted - warm setting makes light cool, and vice-versa.

Expected behavior warm setting makes light warm color, cool makes it cool.

Screenshots F7D78C22-92F3-44BD-98C4-128AF891F67D_1_105_c

9FF138E8-706A-45CD-B8EF-B7F2731BAD5C_1_105_c

Device info (please complete the following information, which can be found in log): request path = /v1.0/iot-01/associated-users/devices devices.txt

Device functions (please complete the following information, which can be found in log): request path = /v1.0/devices/functions functions.txt

Additional context request/responses for turning on, and changing color temp on "Hallway" temperature.txt

shashchatter commented 1 year ago

Happens with all the Tuya devices from several different manufacturers, but for example:

  {
    "active_time": 1648229533,
    "biz_type": 18,
    "category": "dj",
    "create_time": 1611450227,
    "icon": "smart/product_icon/dj.png",
    "id": "66382108bcddc2691ddb",
    "ip": "47.187.123.231",
    "lat": "32.9728",
    "local_key": "313c16be466ea4c8",
    "lon": "-96.9611",
    "name": "Hallway",
    "online": true,
    "owner_id": "33474261",
    "product_id": "isehgkqn5uqlrorl",
    "product_name": "RGBCW_BR95",
    "status": [
      {
        "code": "switch_led",
        "value": false
      },
      {
        "code": "work_mode",
        "value": "white"
      },
      {
        "code": "bright_value",
        "value": 255
      },
      {
        "code": "temp_value",
        "value": 253
      },
      {
        "code": "colour_data",
        "value": "{\"h\":0.0,\"s\":0.0,\"v\":255.0}"
      },
      {
        "code": "scene_data",
        "value": "{\"h\":37.5,\"s\":255.0,\"v\":189.0}"
      },
      {
        "code": "flash_scene_1",
        "value": "{\"bright\":255,\"frequency\":80,\"hsv\":[{\"h\":120.0,\"s\":255.0,\"v\":255.0}],\"temperature\":255}"
      },
      {
        "code": "flash_scene_2",
        "value": "{\"bright\":255,\"frequency\":128,\"hsv\":[{\"h\":0.0,\"s\":255.0,\"v\":255.0},{\"h\":120.0,\"s\":255.0,\"v\":255.0},{\"h\":240.0,\"s\":255.0,\"v\":255.0},{\"h\":0.0,\"s\":0.0,\"v\":0.0},{\"h\":0.0,\"s\":0.0,\"v\":0.0},{\"h\":0.0,\"s\":0.0,\"v\":0.0}],\"temperature\":255}"
      },
      {
        "code": "flash_scene_3",
        "value": "{\"bright\":255,\"frequency\":80,\"hsv\":[{\"h\":0.0,\"s\":255.0,\"v\":255.0}],\"temperature\":255}"
      },
      {
        "code": "flash_scene_4",
        "value": "{\"bright\":255,\"frequency\":5,\"hsv\":[{\"h\":0.0,\"s\":255.0,\"v\":255.0},{\"h\":120.0,\"s\":255.0,\"v\":255.0},{\"h\":60.0,\"s\":255.0,\"v\":255.0},{\"h\":300.0,\"s\":255.0,\"v\":255.0},{\"h\":240.0,\"s\":255.0,\"v\":255.0},{\"h\":0.0,\"s\":0.0,\"v\":0.0}],\"temperature\":255}"
      }
    ],
    "sub": false,
    "time_zone": "-06:00",
    "uid": "az1611357486861HktlX",
    "update_time": 1652489608,
    "uuid": "66382108bcddc2691ddb"
  }

{
  "category": "dj",
  "devices": [
    "10517386483fdac0e46c"
  ],
  "functions": [
    {
      "code": "switch_led",
      "desc": "switch led",
      "name": "switch led",
      "type": "Boolean",
      "values": "{}"
    },
    {
      "code": "work_mode",
      "desc": "work mode",
      "name": "work mode",
      "type": "Enum",
      "values": "{\"range\":[\"white\",\"colour\",\"scene\",\"music\"]}"
    },
    {
      "code": "bright_value_v2",
      "desc": "bright value v2",
      "name": "bright value v2",
      "type": "Integer",
      "values": "{\"min\":10,\"max\":1000,\"scale\":0,\"step\":1}"
    },
    {
      "code": "colour_data_v2",
      "desc": "colour data v2",
      "name": "colour data v2",
      "type": "Json",
      "values": "{\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}"
    },
    {
      "code": "scene_data_v2",
      "desc": "scene data v2",
      "name": "scene data v2",
      "type": "Json",
      "values": "{\"scene_num\":{\"min\":1,\"scale\":0,\"max\":8,\"step\":1},\"scene_units\": {\"unit_change_mode\":{\"range\":[\"static\",\"jump\",\"gradient\"]},\"unit_switch_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"unit_gradient_duration\":{\"min\":0,\"scale\":0,\"max\":100,\"step\":1},\"bright\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"temperature\":{\"min\":0,\"scale\":0,\"max\":1000,\"step\":1},\"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}}}"
    },
    {
      "code": "countdown_1",
      "desc": "countdown 1",
      "name": "countdown 1",
      "type": "Integer",
      "values": "{\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}"
    },
    {
      "code": "control_data",
      "desc": "control data",
      "name": "control data",
      "type": "Json",
      "values": "{\"change_mode\":{\"range\":[\"direct\",\"gradient\"]}, \"bright\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"temperature\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":1000,\"step\":1}, \"h\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":360,\"step\":1},\"s\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1},\"v\":{\"min\":0,\"scale\":0,\"unit\":\"\",\"max\":255,\"step\":1}}"
    }
  ],
  "product_id": "oxd7vmtrlrp41izs"
},