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 <KWS-302WF> #2257

Closed
alexps70 opened this issue Aug 30, 2024 · 20 comments
Closed

Request support for <KWS-302WF> #2257

alexps70 opened this issue Aug 30, 2024 · 20 comments

Comments

@alexps70
Copy link

alexps70 commented Aug 30, 2024

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

@alexps70 alexps70 added the new device Unsupported device label Aug 30, 2024
@make-all
Copy link
Owner

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

@make-all make-all closed this as not planned Won't fix, can't repro, duplicate, stale Aug 30, 2024
@make-all make-all removed the new device Unsupported device label Aug 30, 2024
@alexps70
Copy link
Author

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 make-all reopened this Aug 30, 2024
@make-all make-all added new device Unsupported device full_info All info needed was provided labels Aug 30, 2024
@make-all
Copy link
Owner

make-all commented Aug 30, 2024

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
Copy link
Author

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
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

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

@make-all
Copy link
Owner

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

@SS-IS
Copy link

SS-IS commented Sep 3, 2024

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 added a commit that referenced this issue Sep 5, 2024
@make-all make-all added awaiting confirmation Wating for confirmation the issue is solved unreleased Will be in next release and removed full_info All info needed was provided labels Sep 5, 2024
@make-all
Copy link
Owner

make-all commented Sep 5, 2024

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
Copy link
Author

alexps70 commented Sep 5, 2024

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

@make-all make-all removed new device Unsupported device awaiting confirmation Wating for confirmation the issue is solved unreleased Will be in next release labels Sep 8, 2024
@make-all make-all closed this as completed Sep 8, 2024
@alexps70
Copy link
Author

alexps70 commented Sep 9, 2024

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

@make-all make-all added device improvement Improvement to an existing device config awaiting confirmation Wating for confirmation the issue is solved labels Sep 9, 2024
@make-all make-all added the unreleased Will be in next release label Sep 9, 2024
@make-all make-all reopened this Sep 9, 2024
@make-all make-all removed awaiting confirmation Wating for confirmation the issue is solved unreleased Will be in next release device improvement Improvement to an existing device config labels Sep 26, 2024
@fredericuslaurentii
Copy link

fredericuslaurentii commented Oct 22, 2024

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.

@make-all
Copy link
Owner

Have you blocked internet?
Some devices do act like this if they cannot connect to the cloud.

@fredericuslaurentii
Copy link

fredericuslaurentii commented Oct 23, 2024

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?

immagine

@make-all
Copy link
Owner

make-all commented Oct 24, 2024

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.

@fredericuslaurentii
Copy link

fredericuslaurentii commented Oct 24, 2024

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.

immagine
Figure 1 - sensor availability with respect to router operations

immagine
Figure 2 - zoom on right most data available (2024/10/24)

@fredericuslaurentii
Copy link

fredericuslaurentii commented Oct 26, 2024

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?

home-assistant_tuya_local_2024-10-26T08-52-56.496Z.log

@make-all
Copy link
Owner

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.

@fredericuslaurentii
Copy link

fredericuslaurentii commented Oct 26, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

4 participants