home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.78k stars 30.88k forks source link

The Tuya WIFI Dual Meter Total energy meter #115106

Open Automatic-Bob opened 7 months ago

Automatic-Bob commented 7 months ago

The problem

The Tuya WIFI Dual Meter Total energy meter does not pick up on the correct output. It needs to pick up total power, but it picks up Forward Energy. Please advise if this can be corrected as there is only one entity listed.

What version of Home Assistant Core has the issue?

System Information version | core-2024.3.1 -- | -- installation_type | Home Assistant OS dev | false hassio | true docker | true user | root virtualenv | false python_version | 3.12.2 os_name | Linux os_version | 6.6.20-haos arch | aarch64 timezone | Europe/London config_dir | /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 5000 Installed Version | 1.34.0 Stage | running Available Repositories | 1403 Downloaded Repositories | 6 HACS Data | ok
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 12.1 -- | -- update_channel | stable supervisor_version | supervisor-2024.03.1 agent_version | 1.6.0 docker_version | 24.0.7 disk_total | 28.0 GB disk_used | 6.3 GB healthy | true supported | true board | green supervisor_api | ok version_api | ok installed_addons | Terminal & SSH (9.10.0), File editor (5.8.0), Studio Code Server (5.15.0)
Dashboards dashboards | 2 -- | -- resources | 0 views | 1 mode | storage
Recorder oldest_recorder_run | April 1, 2024 at 1:21 PM -- | -- current_recorder_run | April 1, 2024 at 2:21 PM estimated_db_size | 374.87 MiB database_engine | sqlite database_version | 3.44.2

What was the last working version of Home Assistant Core?

System Information version | core-2024.3.1 -- | -- installation_type | Home Assistant OS dev | false hassio | true docker | true user | root virtualenv | false python_version | 3.12.2 os_name | Linux os_version | 6.6.20-haos arch | aarch64 timezone | Europe/London config_dir | /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 5000 Installed Version | 1.34.0 Stage | running Available Repositories | 1403 Downloaded Repositories | 6 HACS Data | ok
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 12.1 -- | -- update_channel | stable supervisor_version | supervisor-2024.03.1 agent_version | 1.6.0 docker_version | 24.0.7 disk_total | 28.0 GB disk_used | 6.3 GB healthy | true supported | true board | green supervisor_api | ok version_api | ok installed_addons | Terminal & SSH (9.10.0), File editor (5.8.0), Studio Code Server (5.15.0)
Dashboards dashboards | 2 -- | -- resources | 0 views | 1 mode | storage
Recorder oldest_recorder_run | April 1, 2024 at 1:21 PM -- | -- current_recorder_run | April 1, 2024 at 2:21 PM estimated_db_size | 374.8

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Tuya

Link to integration documentation on our website

https://github.com/tuya/tuya-home-assistant

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 6 months ago

Hey there @tuya, @zlinoliver, @frenck, mind taking a look at this issue as it has been labeled with an integration (tuya) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `tuya` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign tuya` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


tuya documentation tuya source (message by IssueLinks)

Hood-fr commented 5 months ago

Well actually it would be even better if all output were available as sensor: Channel A Forward / Reverse Channel B Forward / Reverse Total Forward / Reverse

Thanks in advance !

ManelR commented 2 months ago

Now the api for this device returns the following response (configurated with the app approach):

2024-08-21 19:08:18.525 DEBUG (Thread-6 (_thread_main)) [homeassistant.components.tuya] Received update for device ---: {'forward_energy_total': 17837, 'reverse_energy_total': 67, 'total_power': 73}

But it is not parsed in the plugin. See: https://github.com/home-assistant/core/blob/0d7627da22707e7925076b8da6e06a4c85ac7186/homeassistant/components/tuya/sensor.py#L674

Before the new plugin configuration (with the developer portal) the response was:

2024-01-05 15:48:34.724 DEBUG (Thread-18 (_thread_main)) [homeassistant.components.tuya] Received update for device ----: {'forward_energy_total': 19, 'reverse_energy_total': 67, 'power_a': 0, 'direction_a': 'FORWARD', 'tbd': False, 'direction_b': 'FORWARD', 'power_b': 0, 'energy_forword_a': 19, 'energy_reverse_a': 67, 'energy_forword_b': 0, 'energy_reserse_b': 0, 'power_factor': 100, 'freq': 4935, 'voltage_a': 2314, 'current_a': 0, 'current_b': 0, 'total_power': 0, 'voltage_coef': 1000, 'current_a_calibration': 1000, 'power_a_calibration': 1000, 'energy_a_calibration_fwd': 1000, 'power_factor_b': 100, 'freq_calibration': 1000, 'current_b_calibration': 1000, 'power_b_calibration': 1000, 'energy_b_calibration_fwd': 1000, 'energy_a_calibration_rev': 1000, 'energy_b_calibration_rev': 1000, 'report_rate_control': 10}

with more information about the device. Do you know why the API is not returning this information now?

Rols38 commented 1 week ago

Hello everyone, I'm a new user of HA coming from Jeedom. I have the same device and i use it to monitor instantaneous curent mesurement for my double flow ventilation. Then i know when to change the filter. Anyway. It was possible te get the information thrue DP instructions in Jeedom . And you also need to make sur that your device is in "controlable" mode and not in "read" in the tuya iot core acount. Any chance we can do this with HA ? I know that tuya made some recent modification on the plateform too. it can also be afecting tuya devices interactions !?

I would be happy to provide my help on this one

Sorry for my french