make-all / tuya-local

Local support for Tuya devices in Home Assistant
MIT License
1.41k stars 542 forks source link

Request support for PNI CT400 (dual zone thermostat) #2463

Open robex2005 opened 2 weeks ago

robex2005 commented 2 weeks ago

Log message

{
  "home_assistant": {
    "installation_type": "Home Assistant Container",
    "version": "2024.10.4",
    "dev": false,
    "hassio": false,
    "virtualenv": false,
    "python_version": "3.12.4",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/Bucharest",
    "os_name": "Linux",
    "os_version": "6.1.0-26-amd64",
    "run_as_root": true
  },
  "custom_components": {
    "tplink_router": {
      "documentation": "https://github.com/menahishayan/Home-Assistant-TP-Link-Router",
      "version": "0.0.7",
      "requirements": [
        "tplinkrouter>=1.0.0"
      ]
    },
    "scheduler": {
      "documentation": "https://github.com/nielsfaber/scheduler-component",
      "version": "v0.0.0",
      "requirements": []
    },
    "imou_life": {
      "documentation": "https://github.com/user2684/imou_life",
      "version": "1.0.15",
      "requirements": [
        "imouapi==1.0.15"
      ]
    },
    "tuya_local": {
      "documentation": "https://github.com/make-all/tuya-local",
      "version": "2024.11.0",
      "requirements": [
        "tinytuya==1.15.1",
        "tuya-device-sharing-sdk>=0.1.9,<=0.2.99"
      ]
    },
    "browser_mod": {
      "documentation": "https://github.com/thomasloven/hass-browser_mod/blob/master/README.md",
      "version": "2.3.1",
      "requirements": []
    },
    "hikvision_next": {
      "documentation": "https://github.com/maciej-or/hikvision_next",
      "version": "1.0.19",
      "requirements": [
        "xmltodict==0.13.0",
        "requests-toolbelt==1.0.0"
      ]
    },
    "powercalc": {
      "documentation": "https://docs.powercalc.nl",
      "version": "v1.15.1",
      "requirements": [
        "numpy>=1.21.1"
      ]
    },
    "localtuya": {
      "documentation": "https://github.com/xZetsubou/hass-localtuya/",
      "version": "2024.9.0",
      "requirements": []
    },
    "hacs": {
      "documentation": "https://hacs.xyz/docs/configuration/start",
      "version": "2.0.1",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "watchman": {
      "documentation": "https://github.com/dummylabs/thewatchman",
      "version": "0.6.3",
      "requirements": [
        "prettytable==3.10.0"
      ]
    },
    "virtual": {
      "documentation": "https://github.com/twrecked/hass-virtual/blob/master/README.md",
      "version": "0.8.0.1",
      "requirements": []
    },
    "dahua": {
      "documentation": "https://github.com/rroller/dahua",
      "version": "0.9.66  ",
      "requirements": []
    },
    "webrtc": {
      "documentation": "https://github.com/AlexxIT/WebRTC",
      "version": "v3.6.0",
      "requirements": []
    }
  },
  "integration_manifest": {
    "domain": "tuya_local",
    "name": "Tuya Local",
    "codeowners": [
      "make-all"
    ],
    "config_flow": true,
    "dependencies": [],
    "documentation": "https://github.com/make-all/tuya-local",
    "integration_type": "device",
    "iot_class": "local_push",
    "issue_tracker": "https://github.com/make-all/tuya-local/issues",
    "requirements": [
      "tinytuya==1.15.1",
      "tuya-device-sharing-sdk>=0.1.9,<=0.2.99"
    ],
    "version": "2024.11.0",
    "is_built_in": false
  },
  "setup_times": {
    "null": {
      "setup": 6.0063088312745094e-05
    },
    "58ebc1d6fac48275df90fb4c1eb5a0e8": {
      "wait_import_platforms": -10.655389440013096,
      "wait_base_component": -0.0017486859578639269,
      "config_entry_setup": 11.51001810200978
    },
    "31edc989f384675ed970f7046326da00": {
      "wait_import_platforms": -10.65677865408361,
      "config_entry_setup": 11.45570554304868
    },
    "01J8W8SH47MF5AC0MT6BNX3Y8V": {
      "wait_import_platforms": -10.671815341105685,
      "wait_base_component": -0.0013891429407522082,
      "config_entry_setup": 11.436325215967372
    },
    "dd79d94214bd471d8d5d016927751e28": {
      "wait_import_platforms": -10.644779502996244,
      "wait_base_component": -0.016298091039061546,
      "config_entry_setup": 11.389128086040728
    },
    "861840c157f7283442426460df0d229a": {
      "wait_import_platforms": -10.815989460912533,
      "config_entry_setup": 11.479863640968688
    },
    "828633252b8a3d1d8f93f091e92f3b0c": {
      "wait_import_platforms": -10.816814705030993,
      "config_entry_setup": 11.461018368019722
    },
    "891593273f8163822993c0ee8336b542": {
      "wait_import_platforms": -10.819597600959241,
      "config_entry_setup": 11.516008179052733
    },
    "ff7fc0b6af2169b421b83665ba330dd9": {
      "wait_import_platforms": -10.822716712020338,
      "config_entry_setup": 11.48062274500262
    },
    "01ef5ffc070be8fb286a13204a5e3a6c": {
      "wait_import_platforms": -10.832756395917386,
      "config_entry_setup": 11.586066804011352
    },
    "e3cd91280f4bfca8a5ce3d921760bc26": {
      "wait_import_platforms": -10.854338748031296,
      "config_entry_setup": 11.556553904083557
    },
    "bee3338d0e3983c6780a8c0d12b7bd5e": {
      "wait_import_platforms": -10.854489605990238,
      "config_entry_setup": 11.556315815076232
    },
    "d12a02625451d728caafc4e1b60c4ab4": {
      "wait_import_platforms": -10.77718180604279,
      "config_entry_setup": 11.507303021964617
    }
  },
  "data": {
    "name": "Termostat Daria",
    "type": "etop_ht_01ac__thermostat",
    "device_id": "**REDACTED**",
    "device_cid": "**REDACTED**",
    "local_key": "**REDACTED**",
    "host": "**REDACTED**",
    "protocol_version": 3.3,
    "tinytuya_version": "1.15.1",
    "api_version_set": 3.3,
    "api_version_used": 3.3,
    "api_working": true,
    "status": {},
    "cached_state": {
      "updated_at": 1730793462.1744144,
      "1": true,
      "2": "manual",
      "3": "idle",
      "8": true,
      "10": false,
      "16": 180,
      "19": 230,
      "24": 210,
      "26": 100,
      "27": 0,
      "40": false,
      "45": 0,
      "101": 2
    },
    "pending_state": {},
    "connected": true,
    "force_dps": [],
    "home_assistant": {
      "name": "Termostat Daria",
      "name_by_user": null,
      "disabled": false,
      "disabled_by": null,
      "entities": [
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "switch.termostat_daria_anti_frost",
            "state": "off",
            "attributes": {
              "icon": "mdi:snowflake-melt",
              "friendly_name": "Termostat Daria Anti-frost"
            },
            "last_changed": "2024-11-05T07:52:58.523695+00:00",
            "last_reported": "2024-11-05T07:52:58.523695+00:00",
            "last_updated": "2024-11-05T07:52:58.523695+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": "temperature",
          "icon": null,
          "unit_of_measurement": "\u00b0C",
          "state": {
            "entity_id": "number.termostat_daria_setpoint_min",
            "state": "10.0",
            "attributes": {
              "min": 0.0,
              "max": 100.0,
              "step": 0.5,
              "mode": "slider",
              "unit_of_measurement": "\u00b0C",
              "device_class": "temperature",
              "friendly_name": "Termostat Daria Setpoint min."
            },
            "last_changed": "2024-11-05T07:52:58.528462+00:00",
            "last_reported": "2024-11-05T07:52:58.528462+00:00",
            "last_updated": "2024-11-05T07:52:58.528462+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": "temperature",
          "icon": null,
          "unit_of_measurement": "\u00b0C",
          "state": {
            "entity_id": "number.termostat_daria_setpoint_max",
            "state": "23.0",
            "attributes": {
              "min": 5.0,
              "max": 100.0,
              "step": 0.5,
              "mode": "slider",
              "unit_of_measurement": "\u00b0C",
              "device_class": "temperature",
              "friendly_name": "Termostat Daria Setpoint max."
            },
            "last_changed": "2024-11-05T07:52:58.529030+00:00",
            "last_reported": "2024-11-05T07:52:58.529030+00:00",
            "last_updated": "2024-11-05T07:52:58.529030+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": "\u00b0C",
          "state": {
            "entity_id": "number.termostat_daria_temperature_correction",
            "state": "0.0",
            "attributes": {
              "min": -10.0,
              "max": 10.0,
              "step": 0.5,
              "mode": "slider",
              "unit_of_measurement": "\u00b0C",
              "friendly_name": "Termostat Daria Temperature correction"
            },
            "last_changed": "2024-11-05T07:52:58.529507+00:00",
            "last_reported": "2024-11-05T07:52:58.529507+00:00",
            "last_updated": "2024-11-05T07:52:58.529507+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "lock.termostat_daria_child_lock",
            "state": "unlocked",
            "attributes": {
              "icon": "mdi:hand-back-right",
              "friendly_name": "Termostat Daria Child lock",
              "supported_features": 0
            },
            "last_changed": "2024-11-05T07:52:58.523099+00:00",
            "last_reported": "2024-11-05T07:52:58.523099+00:00",
            "last_updated": "2024-11-05T07:52:58.523099+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": "problem",
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "binary_sensor.termostat_daria_error",
            "state": "off",
            "attributes": {
              "device_class": "problem",
              "friendly_name": "Termostat Daria Error"
            },
            "last_changed": "2024-11-05T07:52:58.529880+00:00",
            "last_reported": "2024-11-05T07:52:58.529880+00:00",
            "last_updated": "2024-11-05T07:52:58.529880+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": null,
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "climate.termostat_daria_thermostat",
            "state": "heat",
            "attributes": {
              "hvac_modes": [
                "off",
                "heat"
              ],
              "min_temp": 10.0,
              "max_temp": 23.0,
              "target_temp_step": 0.5,
              "preset_modes": [
                "Manual",
                "Eco",
                "Auto"
              ],
              "current_temperature": 21.0,
              "temperature": 18.0,
              "hvac_action": "idle",
              "preset_mode": "Manual",
              "fault_code": 0,
              "icon": "mdi:cursor-pointer",
              "friendly_name": "Termostat Daria",
              "supported_features": 401
            },
            "last_changed": "2024-11-05T07:52:58.527637+00:00",
            "last_reported": "2024-11-05T07:52:58.527637+00:00",
            "last_updated": "2024-11-05T07:52:58.527637+00:00"
          }
        }
      ]
    }
  }
}

Product ID

zhfbsam03cs0ge5n

Product Name

PNI CT400

DPS information

{
  "result": {
    "properties": [
      {
        "code": "switch",
        "custom_name": "",
        "dp_id": 1,
        "time": 1730746701149,
        "type": "bool",
        "value": true
      },
      {
        "code": "mode",
        "custom_name": "",
        "dp_id": 2,
        "time": 1729592305450,
        "type": "enum",
        "value": "manual"
      },
      {
        "code": "work_state",
        "custom_name": "",
        "dp_id": 3,
        "time": 1730749105429,
        "type": "enum",
        "value": "idle"
      },
      {
        "code": "window_check",
        "custom_name": "",
        "dp_id": 8,
        "time": 1729592307354,
        "type": "bool",
        "value": true
      },
      {
        "code": "frost",
        "custom_name": "",
        "dp_id": 10,
        "time": 1729592308349,
        "type": "bool",
        "value": false
      },
      {
        "code": "temp_set",
        "custom_name": "",
        "dp_id": 16,
        "time": 1730794210656,
        "type": "value",
        "value": 180
      },
      {
        "code": "upper_temp",
        "custom_name": "",
        "dp_id": 19,
        "time": 1729592310349,
        "type": "value",
        "value": 230
      },
      {
        "code": "temp_current",
        "custom_name": "",
        "dp_id": 24,
        "time": 1730794211117,
        "type": "value",
        "value": 210
      },
      {
        "code": "lower_temp",
        "custom_name": "",
        "dp_id": 26,
        "time": 1729592312585,
        "type": "value",
        "value": 100
      },
      {
        "code": "temp_correction",
        "custom_name": "",
        "dp_id": 27,
        "time": 1729592313583,
        "type": "value",
        "value": 0
      },
      {
        "code": "week_program2",
        "custom_name": "",
        "dp_id": 37,
        "time": 1730622340716,
        "type": "raw",
        "value": "CB4AtAweALQRAAC0FB4AtAgeALQMHgC0EQAAtBQeALQIHgC0DB4AtBEAALQUHgC0CB4AtAweALQRAAC0FB4AtAgeALQMHgC0EQAAtBQeALQIHgC0DB4AtBEAALQUHgC0CB4AtAweALQRAAC0FB4AtA=="
      },
      {
        "code": "factory_reset",
        "custom_name": "",
        "dp_id": 39,
        "time": 1682160502058,
        "type": "bool",
        "value": false
      },
      {
        "code": "child_lock",
        "custom_name": "",
        "dp_id": 40,
        "time": 1729592315572,
        "type": "bool",
        "value": false
      },
      {
        "code": "fault",
        "custom_name": "",
        "dp_id": 45,
        "time": 1729592316569,
        "type": "bitmap",
        "value": 0
      },
      {
        "code": "dead_zone",
        "custom_name": "",
        "dp_id": 101,
        "time": 1729592317567,
        "type": "value",
        "value": 2
      }
    ]
  },
  "success": true,
  "t": 1730794508664,
  "tid": "1224bd909b4e11ef9c1466cdd6b50fa6"
}

Information about how the device functions

The 2 thermostats are subdevices connecting to a gateway.

The gateway has the ID: tsnkt6albivl8vaf Gateway info from TUYA Cloud: { "result": [ { "active_time": 1682160501, "bind_space_id": "6062948", "category": "wg2", "create_time": 1682152159, "custom_name": "Gateway PNI", "icon": "smart/icon/ay1539244260287RY0l6/a117be14b3221631227c33730b536117.png", "id": "bf33ffb1e8085b3223hfu0", "ip": "83.103.227.191", "is_online": true, "lat": "46.7741", "local_key": "788bb7fe868db22b", "lon": "24.6996", "model": "E-GW-R", "name": "Gateway", "product_id": "tsnkt6albivl8vaf", "product_name": "E-GW-R", "sub": false, "time_zone": "+03:00", "update_time": 1728220927, "uuid": "358b77b74ff6fa7b" } ], "success": true, "t": 1730796283361, "tid": "33f11cdd9b5211efacb2ded37fff273c" }

DPS for the gateway:

{ "result": { "properties": [ { "code": "alarm_msg", "custom_name": "", "dp_id": 26, "time": 1682160501828, "type": "raw" } ] }, "success": true, "t": 1730794536442, "tid": "22b55c5d9b4e11efacb2ded37fff273c" }

Full working yaml:

name: PNI CT400 thermostat products:

primary_entity: entity: climate name: Thermostat dps: