Tuya API from HA only pulling 1 entity on device

Hello all,

Ok, so this one is a bit above my knowledge level. The Tuya Cloud API only appears to be pulling one entity from a device (electricity sensor). I can see in the Tuya Cloud that there are many values available for my sensor, but Home Assistant only appears to be pulling the “Main Consumption” entity.

This picture shows the Tuya Cloud Sensor along with the available entities:

However, the Tuya Link only shows 1 device with 1 entity:

Further, when I download the “diagnostics” log from the Tuya Hub screen:

I can see the other data is coming in as well. Only 1 item has the “Home Assistant” key on it though:

 "home_assistant": {
          "name": "Main Utility Feed",
          "name_by_user": null,
          "disabled": false,
          "disabled_by": null,
          "entities": [
            {
              "disabled": false,
              "disabled_by": null,
              "entity_category": null,
              "device_class": null,
              "original_device_class": "energy",
              "icon": null,
              "original_icon": null,
              "unit_of_measurement": "kWh",
              "state": {
                "entity_id": "sensor.main_utility_feed_total_energy",
                "state": "20.69",
                "attributes": {
                  "state_class": "total_increasing",
                  "unit_of_measurement": "kWh",
                  "device_class": "energy",
                  "friendly_name": "Main Utility Feed Total energy"

None of the other data (here is the status set) is coming in as an entity.

"status": {
          "forward_energy_total": 2069,
          "reverse_energy_total": 8,
          "power_total": 2015,
          "forward_energy_circuit_1": 1264,
          "reserve_energy_circuit_1": 0,
          "forward_energy_circuit_2": 805,
          "reserve_energy_circuit_2": 8,
          "current_total": 17938,
          "voltage": 1195,
          "current_circuit_1": 11218,
          "power_circuit_1": 1282,
          "pf_circuit_1": 96,
          "current_circuit_2": 6720,
          "power_circuit_2": 733,
          "pf_circuit_2": 91,
          "ct_dir_circuit_1": false,
          "ct_dir_circuit_2": false,
          "inactive_power_circult_1": 0,
          "inactive_power_circult_2": -328,
          "frequency": 60,
          "test1": 0,
          "test2": 0,
          "test3": 0,
          "test4": 255,
          "test5": 4

Can anyone assist with helping me get the other items discoverable via API?

1 Like

Ok,

So I ended up installing HACS on my server following these instructions: HACS Installation . Next, I installed Local Tuya (to pull the device information locally, instead of through the API on Tuya Cloud). I followed the instructions found on the Local Tuya application in the HACS add-on.

From there, I needed to get the local key for the device (which was available on the Tuya Cloud). This allowed me to pull each individual value WITHOUT the need to go to a cloud or even use the internet.

I now have everything configured as it is coming from my device:

Everything came in as just random ID numbers and I had to match the values to what I saw in my local Tuya app. Once that was done, it is all being reported as required now.

Happy to go into more details for anyone else who is looking to do something similar.