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
69.75k stars 28.91k forks source link

TUYA WIFI Smart Meter (sbelwddappwy2sj6) #103105

Open paulbalinnel opened 8 months ago

paulbalinnel commented 8 months ago

The problem

Hallo,

The TUYA integration does not deliver all the data. I want to use "cur_power": 7198 to use as indicator if borehole pump is running Any advice on using templates to extract this value pls? or can I request that the integration be updated to include the values?

below the diagnostics download showing the data is available, just not sure how to extract ], "documentation": "https://www.home-assistant.io/integrations/tuya", "integration_type": "hub", "iot_class": "cloud_push", "loggers": [ "tuya_iot" ], "requirements": [ "tuya-iot-py-sdk==0.6.6" ], "is_built_in": true }, "data": { "endpoint": "https://openapi.tuyaeu.com", "auth_type": 0, "country_code": "27", "app_type": "smartlife", "mqtt_connected": true, "disabled_by": null, "disabled_polling": false, "name": "SWITCH - Irrigation Pump", "model": " WIFI \u91cd\u5408\u95f8\u4fdd\u62a4\u5668", "category": "dlq", "product_id": "sbelwddappwy2sj6", "product_name": "WIFI Smart Meter", "online": true, "sub": false, "time_zone": "+02:00", "active_time": "2023-10-19T09:19:46+00:00", "create_time": "2023-10-19T09:19:46+00:00", "update_time": "2023-10-21T06:35:16+00:00", "function": { "switch": { "type": "Boolean", "value": {} }, "countdown_1": { "type": "Integer", "value": { "unit": "s", "min": 0, "max": 86400, "scale": 0, "step": 1 } }, "relay_status": { "type": "Enum", "value": { "range": [ "power_off", "power_on", "last" ] } }, "light_mode": { "type": "Enum", "value": { "range": [ "relay", "pos", "none", "on" ] } }, "child_lock": { "type": "Boolean", "value": {} }, "cycle_time": { "type": "String", "value": { "maxlen": 255 } } }, "status_range": { "switch": { "type": "Boolean", "value": {} }, "countdown_1": { "type": "Integer", "value": { "unit": "s", "min": 0, "max": 86400, "scale": 0, "step": 1 } }, "add_ele": { "type": "Integer", "value": { "min": 0, "max": 50000, "scale": 3, "step": 100 } }, "cur_current": { "type": "Integer", "value": { "unit": "mA", "min": 0, "max": 100000, "scale": 0, "step": 1 } }, "cur_power": { "type": "Integer", "value": { "unit": "W", "min": 0, "max": 199999, "scale": 1, "step": 1 } }, "cur_voltage": { "type": "Integer", "value": { "unit": "V", "min": 0, "max": 5000, "scale": 1, "step": 1 } }, "test_bit": { "type": "Integer", "value": { "min": 0, "max": 5, "scale": 0, "step": 1 } }, "voltage_coe": { "type": "Integer", "value": { "min": 0, "max": 1000000, "scale": 0, "step": 1 } }, "electric_coe": { "type": "Integer", "value": { "min": 0, "max": 1000000, "scale": 0, "step": 1 } }, "power_coe": { "type": "Integer", "value": { "min": 0, "max": 1000000, "scale": 0, "step": 1 } }, "electricity_coe": { "type": "Integer", "value": { "min": 0, "max": 1000000, "scale": 0, "step": 1 } }, "relay_status": { "type": "Enum", "value": { "range": [ "power_off", "power_on", "last" ] } }, "light_mode": { "type": "Enum", "value": { "range": [ "relay", "pos", "none", "on" ] } }, "child_lock": { "type": "Boolean", "value": {} }, "cycle_time": { "type": "String", "value": { "maxlen": 255 } } }, "status": { "switch": true, "countdown_1": 0, "add_ele": 1, "cur_current": 3354, "cur_power": 7198, "cur_voltage": 2261, "test_bit": 2, "voltage_coe": 0, "electric_coe": 0, "power_coe": 0, "electricity_coe": 0, "relay_status": "last", "light_mode": "relay", "child_lock": false, "cycle_time": "" }, "home_assistant": { "name": "SWITCH - Irrigation Pump", "name_by_user": null, "disabled": false, "disabled_by": null, "entities": [ { "disabled": false, "disabled_by": null, "entity_category": "config", "device_class": null, "original_device_class": null, "icon": null, "original_icon": "mdi:account-lock", "unit_of_measurement": null, "state": { "entity_id": "switch.wifi_smart_meter_child_lock", "state": "off", "attributes": { "icon": "mdi:account-lock", "friendly_name": "SWITCH - Irrigation Pump Child lock" }, "last_changed": "2023-10-22T06:13:10.534894+00:00", "last_updated": "2023-10-22T06:13:10.534894+00:00" } }, { "disabled": false, "disabled_by": null, "entity_category": null, "device_class": null, "original_device_class": null, "icon": null, "original_icon": null, "unit_of_measurement": null, "state": { "entity_id": "switch.wifi_smart_meter_switch", "state": "on", "attributes": { "friendly_name": "SWITCH - Irrigation Pump Switch" }, "last_changed": "2023-10-22T06:13:10.535276+00:00", "last_updated": "2023-10-22T06:13:10.535276+00:00" } } ] } }

What version of Home Assistant Core has the issue?

Version core-2023.10.5 Installation Type Home Assistant OS

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

TUYA

Link to integration documentation on our website

No response

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 8 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.

(message by CodeOwnersMention)


tuya documentation tuya source (message by IssueLinks)

nortonsk commented 6 months ago

Hi, I have same device but no support. Is there any workaround or way to implement it in the HA?

hssmith76 commented 6 months ago

I have the same problem - some forums suggest connecting via the 'local Tuya' but I cannot do that as the very reason I picked this device is that it is in a different location so the route through Tuya IoT platform is key.

hssmith76 commented 5 months ago

Any progress on this (or further inforamtion required), this problem is still live.

issue-triage-workflows[bot] commented 2 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

hssmith76 commented 2 months ago

This is still an open issue for me, cannot see live power as a variable, only energy.

Sent from my Galaxy

-------- Original message -------- From: "issue-triage-workflows[bot]" @.> Date: 21/04/2024 15:06 (GMT+00:00) To: home-assistant/core @.> Cc: hssmith76 @.>, Comment @.> Subject: Re: [home-assistant/core] TUYA WIFI Smart Meter (sbelwddappwy2sj6) (Issue #103105)

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

— Reply to this email directly, view it on GitHubhttps://github.com/home-assistant/core/issues/103105#issuecomment-2068057053, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A4YDVUEZGKLPAJBYDYOT2MDY6PBVHAVCNFSM6AAAAAA6XD4EU2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRYGA2TOMBVGM. You are receiving this because you commented.Message ID: @.***>

hssmith76 commented 2 months ago

I was just looking at this again and I read through the diagnostics that I have. In that integration it is picking up that 'power' exists as a status element and even what the current value of it is but there is no sensor configrued or ability to enable one?

"status": {
  "forward_energy_total": 113476,
  "reverse_energy_total": 0,
  "total_power": 299
},
hssmith76 commented 2 months ago

Here is the full section from the diagnostic data - it shows that there are 2 functions configured (although only forward energy appears as a sensor), the range for three functions inclduing forrward and reverse energy and importantly power. then current values for all 3 functions.

"function": { "forward_energy_total": { "type": "Integer", "value": { "unit": "KWH", "min": 0, "max": 99999999, "scale": 2, "step": 1 } }, "reverse_energy_total": { "type": "Integer", "value": { "unit": "KWH", "min": 0, "max": 99999999, "scale": 2, "step": 1 } } }, "status_range": { "forward_energy_total": { "type": "Integer", "value": { "unit": "KWH", "min": 0, "max": 99999999, "scale": 2, "step": 1 } }, "reverse_energy_total": { "type": "Integer", "value": { "unit": "KWH", "min": 0, "max": 99999999, "scale": 2, "step": 1 } }, "total_power": { "type": "Integer", "value": { "unit": "W", "min": -99999999, "max": 99999999, "scale": 1, "step": 1 } } }, "status": { "forward_energy_total": 113476, "reverse_energy_total": 0, "total_power": 300 },