make-all / tuya-local

Local support for Tuya devices in Home Assistant
MIT License
1.42k stars 544 forks source link

Request support for Kruidvat Smart Outdoor Plug #2530

Closed Cadish closed 2 days ago

Cadish commented 4 days ago

Log message

2024-11-21 08:44:51.054 DEBUG (MainThread) [custom_components.tuya_local.device] Outdoor smartplug Kruidvat new pending updates: {"1": {"value": true, "updated_at": 1732175088.1683846, "sent": true}, "9": {"value": 5, "updated_at": 1732175091.0546124, "sent": false}}
2024-11-21 08:44:51.055 DEBUG (MainThread) [custom_components.tuya_local.device] Outdoor smartplug Kruidvat sending dps update: {"9": 5}
2024-11-21 08:44:54.453 DEBUG (MainThread) [custom_components.tuya_local.device] Outdoor smartplug Kruidvat received {"1": true, "9": 0, "full_poll": true}
2024-11-21 08:44:54.453 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of value
2024-11-21 08:44:54.453 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of value
2024-11-21 08:44:54.453 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for step of value
2024-11-21 08:44:54.536 DEBUG (MainThread) [custom_components.tuya_local.device] Outdoor smartplug Kruidvat new pending updates: {"9": {"value": 5, "updated_at": 1732175091.0666382, "sent": true}, "1": {"value": false, "updated_at": 1732175094.5362277, "sent": false}}
2024-11-21 08:44:54.537 DEBUG (MainThread) [custom_components.tuya_local.device] Outdoor smartplug Kruidvat sending dps update: {"1": false}
2024-11-21 08:44:54.564 DEBUG (MainThread) [custom_components.tuya_local.device] Outdoor smartplug Kruidvat received {"1": true, "9": 5, "full_poll": true}
2024-11-21 08:44:54.564 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of value
2024-11-21 08:44:54.564 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of value
2024-11-21 08:44:54.564 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for step of value
2024-11-21 08:44:54.675 DEBUG (MainThread) [custom_components.tuya_local.device] Outdoor smartplug Kruidvat received {"1": true, "full_poll": false}
2024-11-21 08:44:54.675 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of value
2024-11-21 08:44:54.675 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of value
2024-11-21 08:44:54.675 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for step of value
2024-11-21 08:44:54.787 DEBUG (MainThread) [custom_components.tuya_local.device] Outdoor smartplug Kruidvat received {"9": 5, "full_poll": false}
2024-11-21 08:44:54.787 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of value
2024-11-21 08:44:54.787 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of value
2024-11-21 08:44:54.787 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for step of value
2024-11-21 08:44:54.897 DEBUG (MainThread) [custom_components.tuya_local.device] Outdoor smartplug Kruidvat received {"1": false, "9": 0, "full_poll": false}
2024-11-21 08:44:54.898 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of value
2024-11-21 08:44:54.898 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of value
2024-11-21 08:44:54.898 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for step of value
2024-11-21 08:44:55.008 DEBUG (MainThread) [custom_components.tuya_local.device] Outdoor smartplug Kruidvat received {"1": false, "9": 0, "full_poll": false}
2024-11-21 08:44:55.008 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of value
2024-11-21 08:44:55.008 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of value
2024-11-21 08:44:55.009 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for step of value
2024-11-21 08:44:56.503 DEBUG (MainThread) [custom_components.tuya_local.device] Outdoor smartplug Kruidvat new pending updates: {"1": {"value": true, "updated_at": 1732175096.5038004, "sent": false}}
2024-11-21 08:44:56.505 DEBUG (MainThread) [custom_components.tuya_local.device] Outdoor smartplug Kruidvat sending dps update: {"1": true}
2024-11-21 08:44:56.649 DEBUG (MainThread) [custom_components.tuya_local.device] Outdoor smartplug Kruidvat received {"1": true, "full_poll": true}
2024-11-21 08:44:56.649 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of value
2024-11-21 08:44:56.650 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of value
2024-11-21 08:44:56.650 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for step of value
2024-11-21 08:44:56.761 DEBUG (MainThread) [custom_components.tuya_local.device] Outdoor smartplug Kruidvat received {"1": true, "9": 0, "full_poll": false}
2024-11-21 08:44:56.762 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of value
2024-11-21 08:44:56.762 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of value
2024-11-21 08:44:56.762 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for step of value
2024-11-21 08:44:58.821 DEBUG (MainThread) [custom_components.tuya_local.device] Outdoor smartplug Kruidvat new pending updates: {"1": {"value": false, "updated_at": 1732175098.821616, "sent": false}}
2024-11-21 08:44:58.822 DEBUG (MainThread) [custom_components.tuya_local.device] Outdoor smartplug Kruidvat sending dps update: {"1": false}
2024-11-21 08:44:58.960 DEBUG (MainThread) [custom_components.tuya_local.device] Outdoor smartplug Kruidvat received {"1": false, "full_poll": true}
2024-11-21 08:44:58.960 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of value
2024-11-21 08:44:58.960 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of value
2024-11-21 08:44:58.960 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for step of value
2024-11-21 08:44:59.072 DEBUG (MainThread) [custom_components.tuya_local.device] Outdoor smartplug Kruidvat received {"1": false, "9": 0, "full_poll": false}
2024-11-21 08:44:59.072 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of value
2024-11-21 08:44:59.072 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for range of value
2024-11-21 08:44:59.072 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Considering mapping for step of value

Product ID

lbqau5negh2zizit

Product Name

Kruidvat Smart Outdoor Plug (SH.88.165 / SH.88.167)

DPS information

{
  "result": {
    "properties": [
      {
        "code": "switch_1",
        "custom_name": "",
        "dp_id": 1,
        "time": 1732125176227,
        "type": "bool",
        "value": false
      },
      {
        "code": "countdown_1",
        "custom_name": "",
        "dp_id": 9,
        "time": 1732124976514,
        "type": "value",
        "value": 0
      }
    ]
  },
  "success": true,
  "t": 1732125195893,
  "tid": "518c404ca76811ef9fed422f202c76b8"
}

{
  "result": {
    "category": "cz",
    "functions": [
      {
        "code": "switch_1",
        "desc": "{}",
        "name": "开关1",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "countdown_1",
        "desc": "{\"unit\":\"s\",\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}",
        "name": "开关1倒计时",
        "type": "Integer",
        "values": "{\"unit\":\"s\",\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}"
      }
    ],
    "status": [
      {
        "code": "switch_1",
        "name": "开关1",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "countdown_1",
        "name": "开关1倒计时",
        "type": "Integer",
        "values": "{\"unit\":\"s\",\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}"
      }
    ]
  },
  "success": true,
  "t": 1732125279709,
  "tid": "837cc5b5a76811ef9e6566852e0618f4"
}

Information about how the device functions

https://smarthomehelpdesk.nl/wp-content/uploads/2020/10/online_SH.63.215-SH.63.217_smart-plug-manual.pdf

Cadish commented 4 days ago

I've already created a config file for this device, so should just be added in case everything is ok for you.

name: Kruidvat Smart Outdoor Plug
primary_entity:
  entity: switch
  class: outlet
  dps:
    - id: 1
      type: boolean
      name: switch
secondary_entities:
  - entity: number
    category: config
    translation_key: timer
    dps:
      - id: 9
        type: integer
        name: value
        unit: s
        range:
          min: 0
          max: 86400
        mapping:
          - scale: 1
            step: 1