Code Monkey home page Code Monkey logo

Comments (13)

fopina avatar fopina commented on August 24, 2024 2

I had actually been looking into this and I've opened tuya/tuya-device-sharing-sdk#16

To add more on top of @frenck :

  • HA is using this tuya-device-sharing-sdk which uses internal "Smart Life" APIs to avoid the old setup mess that was required
  • The library is written/supported directly by Tuya
  • There is "total energy" in the library
  • If you notice, when you open a sensor in the app, current values load instantly, "In Total" takes a second to load - likely using a different endpoint to load
  • add_ele is a tick that is consumed by their cloud service to get the accumulated total energy and we need to use the device stats endpoint
  • Officially documented stats endpoint is NOT reachable with the current credentials used by tuya-device-sharing-sdk

Either reversing the mobile app or nagging Tuya to add this to the library is required 😄

from core.

frenck avatar frenck commented on August 24, 2024 1

@Klemvast Looking at the data Tuya provides for your device:

    "status": {
      "switch": true,
      "countdown_1": 0,
      "add_ele": 100,
      "cur_current": 1177,
      "cur_power": 2538,
      "cur_voltage": 2196,
      "test_bit": 2,
      "voltage_coe": 0,
      "electric_coe": 0,
      "power_coe": 0,
      "electricity_coe": 0,
      "fault": 0,
      "relay_status": "last",
      "light_mode": "relay",
      "child_lock": false,
      "cycle_time": "",
      "temp_value": 0,
      "alarm_set_1": "BwAAAA==",
      "alarm_set_2": "AQAAAAMAAAAEAAAA"
    },

There is no energy usage provided to us. Only add_elec which isn't usable for Home Assistant, as it is an addition to an unknown value at an unpredictable interval.

If you think this is an error, please reach out to Tuya.

../Frenck

from core.

home-assistant avatar home-assistant commented on August 24, 2024

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)

from core.

frenck avatar frenck commented on August 24, 2024

could you fix it plz?

Please provide debug information for the specific device you are having issues with.

from core.

bugs02004 avatar bugs02004 commented on August 24, 2024

How? I don't understand.
The problem being that the KwH entity does not exist at all with the current TUYA integration. So what is present on the majority of devices as connected sockets or circuit breakers.
And that this entity goes back well with the integration that we find here unfortunately this version loses the token every 36 hours:
https://github.com/tuya/tuya-smart-life

Could you add the KwH entity to Tuya plz compatible devices?

from core.

bugs02004 avatar bugs02004 commented on August 24, 2024

With Tuya integration:
sans kwh

With Tuya with the github:
avec kwh

The are one more entity. The most useful entity.

from core.

frenck avatar frenck commented on August 24, 2024

Could you add the KwH entity to Tuya plz compatible devices?

There is no universal solution, please provide the diagnostics debug information for your device that is missing data according to you.

Thanks 👍

../Frenck

from core.

Klemvast avatar Klemvast commented on August 24, 2024

Heey Frenck,

Im having the same problem with atleast one of my meter breaker powered by tuya.

When checking the iot platform it says Today Ele, aswell within the Tuya app, but this is not shown as an entity by Home Assistant.

Added the diagnostic of the device in question here:
tuya-b3593a6654125fa4ca36050da6c4653d-Zwembad-40bd841a9119f9d94741c90af47cbe50.json

Screenshot_2024-07-03-01-11-34-59_d448303990bb92d03c4d800220c6084a

from core.

Klemvast avatar Klemvast commented on August 24, 2024

@frenck

Thanks for checking this out, I made an report through the app on the device. Is there any other way though to gain an quicker reaction maybe from Tuya?

Friendly regards,
klem

from core.

channafam avatar channafam commented on August 24, 2024

Smart Plug
@tuya, @zlinoliver, @frenck,

I have the same issue - purchased a number of the attached smart plugs with energy monitoring with a view to include into HA. I am surprised to hear that energy usage is not provided. Especially since the native app does show energy usage over periods of time. Is there a workaround we can implement in HA to get energy usage over time?

from core.

Clem7188 avatar Clem7188 commented on August 24, 2024

Hello, I have the issue here too with a solar micro inverter. No data at all. The switch is ok but the rest no :(

Here some info I gathered from HA but I can't find any other clues.
tuya-01J24P45QATJTQCCT7JY23G0PS-Micro Inverter-1406d2d442148932f6a4b51bfc46cb83.json

image

In the Tuya app, I have correct values.

If you have any question or request to get this to work, I'm here :)

from core.

frenck avatar frenck commented on August 24, 2024

Hello, I have the issue here too with a solar micro inverter. No data at all. The switch is ok but the rest no :(

Looking at your diagnostics you've provided. This is the information your device provides through the Tuya API.

"status": {
  "add_ele": 0,
  "cur_current": 0,
  "cur_power": 0,
  "cur_voltage": 0,
  "switch": true
},

As you can see, there is no energy usage total available there. So, the fact we don't show it, is correct. Tuya doesn't provide it.

In the Tuya app, I have correct values.

Cool, but the Tuya app uses different communication methods, not available to us.

If you think this is an issue, please contact Tuya instead.

../Frenck

from core.

issue-triage-workflows avatar issue-triage-workflows commented on August 24, 2024

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.

from core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.