make-all / tuya-local

Local support for Tuya devices in Home Assistant
MIT License
1.22k stars 489 forks source link

Request support for <KWS-302WF> #2257

Open alexps70 opened 2 weeks ago

alexps70 commented 2 weeks ago

Log message

2024-08-30 11:19:11.282 WARNING (MainThread) [custom_components.tuya_local.config_flow] Device matches qoto_03_sprinkler with quality of 28%. DPS: {"updated_at": 1725005939.0350885, "16": true, "101": 2258, "102": 3620, "103": 6284, "104": 8173, "105": 129146, "106": 76, "107": 49, "108": 36, "109": 180, "110": 250, "111": 0, "113": 0, "114": 0, "115": 85, "116": "2", "119": 0, "123": 12495439}

DPS information

{
  "result": {
    "properties": [
      {
        "code": "switch",
        "custom_name": "",
        "dp_id": 16,
        "time": 1724716564621,
        "type": "bool",
        "value": true
      },
      {
        "code": "voltage",
        "custom_name": "",
        "dp_id": 101,
        "time": 1725005091572,
        "type": "value",
        "value": 2267
      },
      {
        "code": "current",
        "custom_name": "",
        "dp_id": 102,
        "time": 1725005091574,
        "type": "value",
        "value": 3977
      },
      {
        "code": "power",
        "custom_name": "",
        "dp_id": 103,
        "time": 1725005091576,
        "type": "value",
        "value": 7427
      },
      {
        "code": "run_time",
        "custom_name": "",
        "dp_id": 104,
        "time": 1725004542821,
        "type": "value",
        "value": 8150
      },
      {
        "code": "energy",
        "custom_name": "",
        "dp_id": 105,
        "time": 1725005090351,
        "type": "value",
        "value": 128975
      },
      {
        "code": "fac",
        "custom_name": "",
        "dp_id": 106,
        "time": 1725005090368,
        "type": "value",
        "value": 82
      },
      {
        "code": "fre",
        "custom_name": "",
        "dp_id": 107,
        "time": 1725005090385,
        "type": "value",
        "value": 50
      },
      {
        "code": "temp",
        "custom_name": "",
        "dp_id": 108,
        "time": 1724998380538,
        "type": "value",
        "value": 37
      },
      {
        "code": "low_voltage",
        "custom_name": "",
        "dp_id": 109,
        "time": 1724716570606,
        "type": "value",
        "value": 180
      },
      {
        "code": "over_voltage",
        "custom_name": "",
        "dp_id": 110,
        "time": 1724716570615,
        "type": "value",
        "value": 250
      },
      {
        "code": "over_current",
        "custom_name": "",
        "dp_id": 111,
        "time": 1724716570629,
        "type": "value",
        "value": 0
      },
      {
        "code": "poweroff_time",
        "custom_name": "",
        "dp_id": 112,
        "time": 1706802634742,
        "type": "value",
        "value": 0
      },
      {
        "code": "over_energy",
        "custom_name": "",
        "dp_id": 113,
        "time": 1724716570635,
        "type": "value",
        "value": 0
      },
      {
        "code": "over_power",
        "custom_name": "",
        "dp_id": 114,
        "time": 1724716570644,
        "type": "value",
        "value": 0
      },
      {
        "code": "over_temp",
        "custom_name": "",
        "dp_id": 115,
        "time": 1724716570663,
        "type": "value",
        "value": 85
      },
      {
        "code": "state_flg",
        "custom_name": "",
        "dp_id": 116,
        "time": 1724716564632,
        "type": "enum",
        "value": "2"
      },
      {
        "code": "flg_save",
        "custom_name": "",
        "dp_id": 117,
        "time": 1706802634742,
        "type": "enum",
        "value": "0"
      },
      {
        "code": "clear_flg",
        "custom_name": "",
        "dp_id": 118,
        "time": 1706802634742,
        "type": "bool",
        "value": false
      },
      {
        "code": "screen_poweroff",
        "custom_name": "",
        "dp_id": 119,
        "time": 1724716570655,
        "type": "value",
        "value": 0
      },
      {
        "code": "jishi_clear",
        "custom_name": "",
        "dp_id": 120,
        "time": 1706802634742,
        "type": "bool",
        "value": false
      },
      {
        "code": "countdown_1",
        "custom_name": "",
        "dp_id": 121,
        "time": 1706802634742,
        "type": "value",
        "value": 0
      },
      {
        "code": "switch_schedule",
        "custom_name": "",
        "dp_id": 122,
        "time": 1706802634742,
        "type": "bool",
        "value": false
      },
      {
        "code": "add_ele",
        "custom_name": "",
        "dp_id": 123,
        "time": 1725005085577,
        "type": "value",
        "value": 12495267
      }
    ]
  },

Product ID

tadm13agjigbdtxd

Product Name

KWS-302WF

Information about how the device functions

No response

make-all commented 2 weeks ago

Local log message is required. Not a repeat of the dps info from Tuya cloud.

alexps70 commented 2 weeks ago

2024-08-30 11:19:11.282 WARNING (MainThread) [custom_components.tuya_local.config_flow] Device matches qoto_03_sprinkler with quality of 28%. DPS: {"updated_at": 1725005939.0350885, "16": true, "101": 2258, "102": 3620, "103": 6284, "104": 8173, "105": 129146, "106": 76, "107": 49, "108": 36, "109": 180, "110": 250, "111": 0, "113": 0, "114": 0, "115": 85, "116": "2", "119": 0, "123": 12495439}

make-all commented 2 weeks ago

Also, what am I looking at here? What sort of device is a KWS-302WF?

Edit: I see from #2259 that it is an energy meter. I would close this and let that one supercede it, except you reduced the info in dps info, so this one is slightly better. It is still missing info on range and scaling though.

alexps70 commented 2 weeks ago

Sorry, I thought this request was closed as incorrect, so I created a new one This is a DIN switch with a display - measures power, power factor, frequency, current, voltage and temperature, counts the consumed energy and time (these counters can be reset). It also has settings for upper and lower voltage protection, overcurrent or power or high temperature.

alexps70 commented 2 weeks ago
Code Type Values
switch Boolean "{true,false}"
low_voltage Integer { "unit": "V", "min": 100, "max": 220, "scale": 0, "step": 1 }
over_voltage Integer { "unit": "V", "min": 130, "max": 290, "scale": 0, "step": 1 }
over_current Integer { "unit": "A", "min": 0, "max": 100000, "scale": 3, "step": 1 }
poweroff_time Integer { "unit": "min", "min": 0, "max": 60000, "scale": 0, "step": 30 }
over_energy Integer { "unit": "KwH", "min": 0, "max": 99999999, "scale": 3, "step": 1 }
over_power Integer { "unit": "kW", "min": 0, "max": 22000, "scale": 3, "step": 1 }
over_temp Integer { "unit": "°C", "min": -20, "max": 150, "scale": 0, "step": 1 }
flg_save Enum { "range": [ "0", "1", "2" ] }
clear_flg Boolean "{true,false}"
screen_poweroff Integer { "unit": "min", "min": 0, "max": 59, "scale": 0, "step": 1 }
jishi_clear Boolean "{true,false}"
countdown_1 Integer { "unit": "s", "min": 0, "max": 86400, "scale": 0, "step": 1 }
switch_schedule Boolean "{true,false}"
make-all commented 2 weeks ago

Thank you. Closed issues can be reopened if the required info is given. 90% of users never get back with additional info, so I close quickly to avoid having to keep track of too many issues that don't have sufficient info to implement.

alexps70 commented 2 weeks ago

If any additional information is needed, please advise how to obtain it.

make-all commented 2 weeks ago

What you've provided above should be enough for now.

SS-IS commented 1 week ago

Hello, i have the same energy meter, if you are so kind to help us, that wold be great ! Here's the exact product : https://www.aliexpress.com/item/1005006121485272.html. (KWS-302WF, the second one on the Choose color tab). Thank you !

make-all commented 1 week ago

An initial implementation has been attempted. Because the scale info was not available for read-only sensors, some may be scaled incorrectly or have wrong units. Also, the "flags" feature was not understood, as they are just numeric values which probably have a more meaningful display in the app, so flags were left as attributes of the energy sensor.

alexps70 commented 1 week ago

image how do I check this? I have version 2024.8.0 and when I try to add a new device, unsuitable device options are offered

alexps70 commented 6 days ago

Energy (kWh/1000) and power (W/10) readings need to be adjusted need add "scale" to energy and power entity: sensor class: energy dps: