tuya-local
tuya-local copied to clipboard
Request support for <KWS-302WF>
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
Local log message is required. Not a repeat of the dps info from Tuya cloud.
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}
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.
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.
| 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}" |
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.
If any additional information is needed, please advise how to obtain it.
What you've provided above should be enough for now.
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 !
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.
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
Energy (kWh/1000) and power (W/10) readings need to be adjusted need add "scale" to energy and power entity: sensor class: energy dps: - id: 105 type: integer name: sensor unit: kWh class: total_increasing mapping: - scale: 1000
- entity: sensor
class: power
category: diagnostic
dps:
- id: 103
type: integer
name: sensor
unit: W
class: measurement
mapping:
- scale: 10
- id: 103
type: integer
name: sensor
unit: W
class: measurement
mapping:
Hi, the sensor returns correct values, but after some time it becomes unavailable and the Wi-Fi icon on the screen of the sensor starts flashing, i.e. it loses connection to the local network. I suspect that Tuya is interfering with the operation of the device.
Have you blocked internet? Some devices do act like this if they cannot connect to the cloud.
The device disconnects (almost always) when my Raspberry (with both HA supervised or HassOS installed) is on the same network. Once I disconnect the Raspberry the power meter starts connecting again. I believe I have granted access to the right APIs from the Tuya IoT Platform, but things (related to the guide I followed) may have changed over time, could the problem be related to that?
Normal operation of this integration does not require access to the Tuya IoT platform. It is only needed to manually gather information about devices. You may be running into a router limitation such as number of IP addresses available for DHCP, though it is unusual that it is always the same device going offline so maybe there is something else happening.
The behavior of the sensor is rather variable. As well as conflicts between router and sensor (Figure 2), if any, do not seem to occur all the time. I verified that it was not an IP conflict issue (also just around 10 DHCP IPs are assigned by the router) but I think it is manifest from the graphs (in the sense that the sensor comes back online sporadically after few seconds beign offline). I will try to investigate further but any tips are still welcome.
Figure 1 - sensor availability with respect to router operations
Figure 2 - zoom on right most data available (2024/10/24)
From the log I can trace the error which seems to be “Energy meter KWS-302WF protocol error 901: Network error: Unable to connect.” According to the internet, “it could be caused by network problems from the Raspberry PI to the device or it could be caused by another app.” By removing all devices that can communicate with the sensor via app on the network, the problem persists. Tuya-local does not seem to me to provide the ability to change the polling time, but could this be a synchronization error?
The integration does not poll by default, so changing the polling interval is meaningless.
Most likely your devices have too weak a wifi signal and are dropping the connection. Tuya devices mostly only support 2.4GHz Wifi, which is susceptible to interference from Bluetooth, Zigbee and microwave ovens, and they have PCB printed antennas, which depending on positioning within the device can give quite poor signal compared to other devices on the same WiFi network.
Thanks for the interesting cue, indeed, verifying the link quality, the app provides a rather low Wi-Fi signal value. However, this does not explain why the sensor disconnects when the Raspberry is in the network. I will continue with the verification, thank you.
Just a little update, you were right, it was a signal problem. By moving the 4G router, I had no more disconnections. Thank you very much, very kind!