make-all / tuya-local

Local support for Tuya devices in Home Assistant
MIT License
1.2k stars 490 forks source link

Request support for DELTACO SH-P02E #531

Closed runlar closed 1 year ago

runlar commented 1 year ago

Log Message

Logger: custom_components.tuya_local.config_flow
Source: custom_components/tuya_local/config_flow.py:45
Integration: Tuya Local (documentation, issues)
First occurred: March 11, 2023 at 22:56:56 (14 occurrences)
Last logged: 08:33:58

Device matches smartplugv2 with quality of 90%. DPS: {"updated_at": 1678606250.8825524, "1": true, "9": 0, "18": 0, "19": 0, "20": 2321, "21": 1, "22": 1739, "23": 40880, "24": 125000, "25": 168}
Device matches smartplugv2 with quality of 90%. DPS: {"updated_at": 1678606304.9884288, "1": true, "9": 0, "18": 0, "19": 0, "20": 2405, "21": 1, "22": 1744, "23": 40960, "24": 124000, "25": 168}
Device matches smartplugv2 with quality of 90%. DPS: {"updated_at": 1678606340.9433415, "1": true, "9": 0, "18": 0, "19": 0, "20": 2321, "21": 1, "22": 1739, "23": 40880, "24": 125000, "25": 168}
Report this to https://github.com/make-all/tuya-local/issues/
Device matches compteur_energy_meter with quality of 71%. DPS: {"updated_at": 1678606437.931585, "1": false, "2": false, "9": 0, "10": 0, "17": 1, "18": 0, "19": 0, "20": 2327, "21": 1, "22": 601, "23": 26710, "24": 15896, "25": 2640, "26": 0}

Information about DPS mappings

{
  "result": {
    "category": "pc",
    "functions": [
      {
        "code": "switch_1",
        "dp_id": 1,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "switch_2",
        "dp_id": 2,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "countdown_1",
        "dp_id": 9,
        "type": "Integer",
        "values": "{\"unit\":\"s\",\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}"
      },
      {
        "code": "countdown_2",
        "dp_id": 10,
        "type": "Integer",
        "values": "{\"unit\":\"s\",\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}"
      }
    ],
    "status": [
      {
        "code": "switch_1",
        "dp_id": 1,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "switch_2",
        "dp_id": 2,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "countdown_1",
        "dp_id": 9,
        "type": "Integer",
        "values": "{\"unit\":\"s\",\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}"
      },
      {
        "code": "countdown_2",
        "dp_id": 10,
        "type": "Integer",
        "values": "{\"unit\":\"s\",\"min\":0,\"max\":86400,\"scale\":0,\"step\":1}"
      },
      {
        "code": "cur_current",
        "dp_id": 18,
        "type": "Integer",
        "values": "{\"unit\":\"mA\",\"min\":0,\"max\":30000,\"scale\":0,\"step\":1}"
      },
      {
        "code": "cur_power",
        "dp_id": 19,
        "type": "Integer",
        "values": "{\"unit\":\"W\",\"min\":0,\"max\":80000,\"scale\":1,\"step\":1}"
      },
      {
        "code": "cur_voltage",
        "dp_id": 20,
        "type": "Integer",
        "values": "{\"unit\":\"V\",\"min\":0,\"max\":5000,\"scale\":1,\"step\":1}"
      }
    ]
  },
  "success": true,
  "t": 1678607376085,
  "tid": "6f205a21c0aa11eda9e9d694da825c81"
}

"Add Electricity" Code: "17"

"Test Bit" code: "21"

"Voltage coe" code: "22"

"Current coe" code: "23"

"Power coe" code: "24"

"Electricity coe" code: "25"

"Fault" code: "26"

Product ID

"product_id": "3jnmzqoyuopg4vtf" "product_name": "DELTACO Smart Plug SH-P02"

Information about how the device functions

https://www.deltaco.eu/en/products/deltaco/smart-home/power-strips/SH-P02E

I have testet: Digoo_dgsp202 simple_dual_switch_timer_v2 Smartplugv2

Only the 2 switches is not working. The switchs does not work when switch to on from HA but when activating the plug on the plug it self, HA sees it is on. The current, power and voltage seems to work fine with on these.

Best regards

runlar commented 1 year ago

Hi

Tested to add the "dual_power_monitor_smartplugv2.yaml" and added the deltaco plug integration. The messurement works but the switches does not work from HA but HA update the state when I press the button on the plug it self.

make-all commented 1 year ago

This behaviour has been seen before when the device id was entered incorrectly. Try removing the device from HA and add it again, taking care to get the device id right.

runlar commented 1 year ago

Now I see what I did wrong. Though it was "uuid" I should use but not, it was "id" from IoT tuya.

Thanks:)