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

Request support for PT-19DW #2712

Open
szemkhel opened this issue Dec 30, 2024 · 2 comments
Open

Request support for PT-19DW #2712

szemkhel opened this issue Dec 30, 2024 · 2 comments
Labels
config provided Config included by reporter full_info All info needed was provided new device Unsupported device

Comments

@szemkhel
Copy link

Log message

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2024.12.5",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.13.0",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/Warsaw",
    "os_name": "Linux",
    "os_version": "6.6.66-haos",
    "supervisor": "2024.12.0",
    "host_os": "Home Assistant OS 14.1",
    "docker_version": "27.2.0",
    "chassis": "vm",
    "run_as_root": true
  },
  "custom_components": {
    "config_editor": {
      "documentation": "https://github.com/junkfix/config-editor-card",
      "version": "4.4.2",
      "requirements": []
    },
    "tuya_local": {
      "documentation": "https://github.com/make-all/tuya-local",
      "version": "2024.12.2",
      "requirements": [
        "tinytuya==1.15.1",
        "tuya-device-sharing-sdk~=0.2.1"
      ]
    },
    "hacs": {
      "documentation": "https://hacs.xyz/docs/configuration/start",
      "version": "2.0.1",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    }
  },
  "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.2.1"
    ],
    "version": "2024.12.2",
    "is_built_in": false,
    "overwrites_built_in": false
  },
  "setup_times": {},
  "data": {
    "name": "Czujnik",
    "type": " pt19dw_wifi_humidity_and_temperature_clock",
    "device_id": "**REDACTED**",
    "device_cid": "",
    "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": 1735595920.80768,
      "1": 235,
      "2": 596,
      "4": 100,
      "9": "c",
      "101": "1",
      "103": true,
      "105": 1,
      "108": 260,
      "109": 218,
      "110": 894,
      "111": 426
    },
    "pending_state": {},
    "connected": true,
    "force_dps": [],
    "home_assistant": {
      "name": "Czujnik",
      "name_by_user": null,
      "disabled": false,
      "disabled_by": null,
      "entities": [
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": null,
          "device_class": null,
          "original_device_class": "temperature",
          "icon": null,
          "unit_of_measurement": "\u00b0C",
          "state": {
            "entity_id": "sensor.czujnik_temperatura",
            "state": "23.5",
            "attributes": {
              "state_class": "measurement",
              "unit_of_measurement": "\u00b0C",
              "device_class": "temperature",
              "friendly_name": "Czujnik Temperatura"
            },
            "last_changed": "2024-12-30T21:58:21.975782+00:00",
            "last_reported": "2024-12-30T21:58:40.808882+00:00",
            "last_updated": "2024-12-30T21:58:21.975782+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": "enum",
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "sensor.czujnik_comfort_level",
            "state": "1",
            "attributes": {
              "device_class": "enum",
              "icon": "mdi:emoticon-happy",
              "friendly_name": "Czujnik Comfort level"
            },
            "last_changed": "2024-12-30T21:49:24.979189+00:00",
            "last_reported": "2024-12-30T21:49:44.615217+00:00",
            "last_updated": "2024-12-30T21:49:24.979189+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": "temperature",
          "icon": null,
          "unit_of_measurement": "\u00b0C",
          "state": {
            "entity_id": "sensor.czujnik_temperature_max",
            "state": "26.0",
            "attributes": {
              "state_class": "measurement",
              "unit_of_measurement": "\u00b0C",
              "device_class": "temperature",
              "icon": "mdi:thermometer-plus",
              "friendly_name": "Czujnik temperature max"
            },
            "last_changed": "2024-12-30T21:49:24.979414+00:00",
            "last_reported": "2024-12-30T21:49:44.615366+00:00",
            "last_updated": "2024-12-30T21:49:24.979414+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": "temperature",
          "icon": null,
          "unit_of_measurement": "\u00b0C",
          "state": {
            "entity_id": "sensor.czujnik_temperature_min",
            "state": "21.8",
            "attributes": {
              "state_class": "measurement",
              "unit_of_measurement": "\u00b0C",
              "device_class": "temperature",
              "icon": "mdi:thermometer-minus",
              "friendly_name": "Czujnik temperature min"
            },
            "last_changed": "2024-12-30T21:49:24.979659+00:00",
            "last_reported": "2024-12-30T21:49:44.615524+00:00",
            "last_updated": "2024-12-30T21:49:24.979659+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": "light.czujnik_podswietlenie",
            "state": "on",
            "attributes": {
              "supported_color_modes": [
                "onoff"
              ],
              "color_mode": "onoff",
              "friendly_name": "Czujnik Pod\u015bwietlenie",
              "supported_features": 0
            },
            "last_changed": "2024-12-30T21:49:24.977757+00:00",
            "last_reported": "2024-12-30T21:49:44.614293+00:00",
            "last_updated": "2024-12-30T21:49:24.977757+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": "select.czujnik_jednostka_temperatury",
            "state": "celsius",
            "attributes": {
              "options": [
                "fahrenheit",
                "celsius"
              ],
              "friendly_name": "Czujnik Jednostka temperatury"
            },
            "last_changed": "2024-12-30T21:49:24.977102+00:00",
            "last_reported": "2024-12-30T21:49:44.613886+00:00",
            "last_updated": "2024-12-30T21:49:24.977102+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": "select.czujnik_clock_configuration",
            "state": "24h",
            "attributes": {
              "options": [
                "12h",
                "24h"
              ],
              "icon": "mdi:hours-24",
              "friendly_name": "Czujnik clock configuration"
            },
            "last_changed": "2024-12-30T21:49:24.977456+00:00",
            "last_reported": "2024-12-30T21:49:44.614073+00:00",
            "last_updated": "2024-12-30T21:49:24.977456+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": null,
          "device_class": null,
          "original_device_class": "humidity",
          "icon": null,
          "unit_of_measurement": " %",
          "state": {
            "entity_id": "sensor.czujnik_wilgotnosc",
            "state": "59.6",
            "attributes": {
              "state_class": "measurement",
              "unit_of_measurement": " %",
              "device_class": "humidity",
              "friendly_name": "Czujnik Wilgotno\u015b\u0107"
            },
            "last_changed": "2024-12-30T21:58:40.809042+00:00",
            "last_reported": "2024-12-30T21:58:40.809042+00:00",
            "last_updated": "2024-12-30T21:58:40.809042+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": "battery",
          "icon": null,
          "unit_of_measurement": " %",
          "state": {
            "entity_id": "sensor.czujnik_bateria",
            "state": "100",
            "attributes": {
              "state_class": "measurement",
              "unit_of_measurement": " %",
              "device_class": "battery",
              "friendly_name": "Czujnik Bateria"
            },
            "last_changed": "2024-12-30T21:49:24.978984+00:00",
            "last_reported": "2024-12-30T21:49:44.615007+00:00",
            "last_updated": "2024-12-30T21:49:24.978984+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": "humidity",
          "icon": null,
          "unit_of_measurement": " %",
          "state": {
            "entity_id": "sensor.czujnik_humidity_max",
            "state": "89.4",
            "attributes": {
              "state_class": "measurement",
              "unit_of_measurement": " %",
              "device_class": "humidity",
              "icon": "mdi:water-plus",
              "friendly_name": "Czujnik humidity max"
            },
            "last_changed": "2024-12-30T21:49:24.980006+00:00",
            "last_reported": "2024-12-30T21:49:44.615692+00:00",
            "last_updated": "2024-12-30T21:49:24.980006+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": "humidity",
          "icon": null,
          "unit_of_measurement": " %",
          "state": {
            "entity_id": "sensor.czujnik_humidity_min",
            "state": "42.6",
            "attributes": {
              "state_class": "measurement",
              "unit_of_measurement": " %",
              "device_class": "humidity",
              "icon": "mdi:water-minus",
              "friendly_name": "Czujnik humidity min"
            },
            "last_changed": "2024-12-30T21:49:24.980348+00:00",
            "last_reported": "2024-12-30T21:49:44.615834+00:00",
            "last_updated": "2024-12-30T21:49:24.980348+00:00"
          }
        }
      ]
    }
  }
}

Product ID

"product_id": "vzsjt2vxirsibm6s",

Product Name

"name": "PT19DW WiFi humidity and temperature clock"

DPS information

{
    "name": "PT19DW WiFi humidity and temperature clock",
    "id": "bf7c9de4634c28ff764mbp",
    "key": "XIOCqIo9s67-36`L",
    "mac": "d8:1f:12:70:74:7d",
    "uuid": "9bc26ff0a4fc86f3",
    "sn": "100064384001D8",
    "category": "wsdcg",
    "product_name": "PT19DW WiFi humidity and temperature clock",
    "product_id": "vzsjt2vxirsibm6s",
    "biz_type": 0,
    "model": "PTH-19DW",
    "sub": false,
    "icon": "https://images.tuyaeu.com/smart/icon/ay1571825171870ICRMe/148343a401bc7dbb601ba8e4fb690b21.png",
    "mapping": {
      "1": {
        "code": "temp_current",
        "type": "Integer",
        "values": {
          "unit": "°C",
          "min": -400,
          "max": 1000,
          "scale": 1,
          "step": 1
        }
      },
      "2": {
        "code": "humidity_value",
        "type": "Integer",
        "values": {
          "unit": "%",
          "min": 0,
          "max": 1000,
          "scale": 1,
          "step": 1
        }
      },
      "4": {
        "code": "battery_percentage",
        "type": "Integer",
        "values": {
          "unit": "%",
          "min": 0,
          "max": 100,
          "scale": 0,
          "step": 1
        }
      },
      "9": {
        "code": "temp_unit_convert",
        "type": "Enum",
        "values": {
          "range": [
            "c",
            "f"
          ]
        }
      },
      "101": {
        "code": "time",
        "type": "Enum",
        "values": {
          "range": [
            "0",
            "1"
          ]
        }
      },
      "102": {
        "code": "Alarm",
        "type": "Raw",
        "values": {
          "maxlen": 128
        }
      },
      "103": {
        "code": "backlight",
        "type": "Boolean",
        "values": {}
      },
      "105": {
        "code": "Comfort_level",
        "type": "Integer",
        "values": {
          "unit": "",
          "min": 1,
          "max": 3,
          "scale": 0,
          "step": 1
        }
      },
      "106": {
        "code": "Alarm_status",
        "type": "Enum",
        "values": {
          "range": [
            "0",
            "1"
          ]
        }
      },
      "108": {
        "code": "TEM_MAX",
        "type": "Integer",
        "values": {
          "unit": "°C",
          "min": -400,
          "max": 1000,
          "scale": 1,
          "step": 1
        }
      },
      "109": {
        "code": "TEM_MIN",
        "type": "Integer",
        "values": {
          "unit": "°C",
          "min": -400,
          "max": 1000,
          "scale": 1,
          "step": 1
        }
      },
      "110": {
        "code": "HUM_MAX",
        "type": "Integer",
        "values": {
          "unit": "%",
          "min": 0,
          "max": 1000,
          "scale": 1,
          "step": 1
        }
      },
      "111": {
        "code": "HUM_MIN",
        "type": "Integer",
        "values": {
          "unit": "%",
          "min": 0,
          "max": 1000,
          "scale": 1,
          "step": 1
        }
      },
      "107": {
        "code": "realtime",
        "type": "Raw",
        "values": {
          "maxlen": 128
        }
      }
    },
    "ip": "<edit>",
    "version": "3.3"

Information about how the device functions

This is USB and battery powered temperature and humidity sensor
more details can be found here https://www.alibaba.com/product-detail/Digital-Thermometer-PT19DW-High-Sensitive-Dark_1600509436582.html

@szemkhel szemkhel added the new device Unsupported device label Dec 30, 2024
@szemkhel
Copy link
Author

I have made this config, it works for all DP except for time and alarm. It is my first interaction with HA and Tuya-local so probably need polishing. I couldn't make branch - only fork so decided to paste code here.

name: PT19DW WiFi humidity and temperature clock
products:
  - id: vzsjt2vxirsibm6s
primary_entity:
  entity: sensor
  class: temperature
  dps:
    - id: 1
      name: sensor
      type: integer
      unit: C
      mapping:
        - scale: 10
      class: measurement
secondary_entities:
  - entity: sensor
    class: humidity
    dps:
      - id: 2
        type: integer
        name: sensor
        unit: " %"
        mapping:
          - scale: 10
        class: measurement
  - entity: sensor
    class: battery
    category: diagnostic
    dps:
      - id: 4
        type: integer
        name: sensor
        unit: " %"
        class: measurement
  - entity: select
    translation_key: temperature_unit
    category: config
    dps:
      - id: 9
        name: option
        type: string
        mapping:
          - dps_val: "f"
            value: fahrenheit
          - dps_val: "c"
            value: celsius
        optional: true
  - entity: light
    category: config
    translation_key: backlight
    dps:
      - id: 103
        type: boolean
        name: switch
        optional: true
  - entity: select
    category: config
    name: "clock configuration"
    icon: "mdi:hours-24"
    dps:
      - id: 101
        name: option
        type: string
        mapping:
          - dps_val: "0"
            value: "12h"
          - dps_val: "1"
            value: "24h"
        optional: true
  - entity: sensor
    name: "Comfort level"
    class: enum
    category: diagnostic
    dps:
      - id: 105
        type: integer
        name: sensor
        mapping:
          - dps_val: 1
            icon: "mdi:emoticon-happy"
          - dps_val: 2
            icon: "mdi:emoticon-neutral"
          - dps_val: 3
            icon: "mdi:emoticon-sad"
  - entity: sensor
    category: diagnostic
    class: temperature
    icon: "mdi:thermometer-plus"
    name: "temperature max"
    dps:
      - id: 108
        name: sensor
        type: integer
        unit: C
        mapping:
          - scale: 10
        class: measurement
  - entity: sensor
    category: diagnostic
    class: temperature
    icon: "mdi:thermometer-minus"
    name: "temperature min"
    dps:
      - id: 109
        name: sensor
        type: integer
        unit: C
        mapping:
          - scale: 10
        class: measurement
  - entity: sensor
    category: diagnostic
    class: humidity
    icon: "mdi:water-plus"
    name: "humidity max"
    dps:
      - id: 110
        name: sensor
        type: integer
        unit: " %"
        mapping:
          - scale: 10
        class: measurement
  - entity: sensor
    category: diagnostic
    class: humidity
    icon: "mdi:water-minus"
    name: "humidity min"
    dps:
      - id: 111
        name: sensor
        type: integer
        unit: " %"
        mapping:
          - scale: 10
        class: measurement

@szemkhel
Copy link
Author

From Tuya Dev portal Standard Status Set:

temp_current | Integer | {   "unit": "℃",   "min": -400,   "max": 1000,   "scale": 1,   "step": 1 }
humidity_value | Integer | {   "unit": "%",   "min": 0,   "max": 1000,   "scale": 1,   "step": 1 }
battery_percentage | Integer | {   "unit": "%",   "min": 0,   "max": 100,   "scale": 0,   "step": 1 }
temp_unit_convert | Enum | {   "range": [     "c",     "f"   ] }
time | Enum | {   "range": [     "0",     "1"   ] }
Alarm | Raw | {   "maxlen": 128 }
backlight | Boolean | "{true,false}"
Comfort_level | Integer | {   "unit": "",   "min": 1,   "max": 3,   "scale": 0,   "step": 1 }
Alarm_status | Enum | {   "range": [     "0",     "1"   ] }
TEM_MAX | Integer | {   "unit": "°C",   "min": -400,   "max": 1000,   "scale": 1,   "step": 1 }
TEM_MIN | Integer | {   "unit": "°C",   "min": -400,   "max": 1000,   "scale": 1,   "step": 1 }
HUM_MAX | Integer | {   "unit": "%",   "min": 0,   "max": 1000,   "scale": 1,   "step": 1 }
HUM_MIN | Integer | {   "unit": "%",   "min": 0,   "max": 1000,   "scale": 1,   "step": 1 }

and Standard Instruction Set:

temp_unit_convert | Enum | {   "range": [     "c",     "f"   ] }
time | Enum | {   "range": [     "0",     "1"   ] }
Alarm | Raw | {   "maxlen": 128 }
backlight | Boolean | "{true,false}"
Alarm_status | Enum | {   "range": [     "0",     "1"   ] }
realtime | Raw | {   "maxlen": 128 }

@make-all make-all added full_info All info needed was provided config provided Config included by reporter labels Dec 31, 2024
@make-all make-all moved this to 🔖 Ready in Tuya Local Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config provided Config included by reporter full_info All info needed was provided new device Unsupported device
Projects
Status: 🔖 Ready
Development

No branches or pull requests

2 participants