question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Device Support Request] Support for tuya 2 gang wall plug _TZ3000_raviyuvk

See original GitHub issue

Is your feature request related to a problem? Please describe. This plug is able to be added into ZHA fine, but no quirk is associated with it. Power monitoring figures are out by a factor of 1000 for current and 100 for energy

Describe the solution you’d like A quirk added so that energy monitoring values are correct.

Device signature
{
  "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress|RxOnWhenIdle|MainsPowered|FullFunctionDevice: 142>, manufacturer_code=4098, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)",
  "endpoints": {
    "1": {
      "profile_id": 260,
      "device_type": "0x0051",
      "in_clusters": [
        "0x0000",
        "0x0004",
        "0x0005",
        "0x0006",
        "0x0702",
        "0x0b04"
      ],
      "out_clusters": [
        "0x000a",
        "0x0019"
      ]
    },
    "2": {
      "profile_id": 260,
      "device_type": "0x0051",
      "in_clusters": [
        "0x0004",
        "0x0005",
        "0x0006",
        "0x0702",
        "0x0b04"
      ],
      "out_clusters": []
    }
  },
  "manufacturer": "_TZ3000_raviyuvk",
  "model": "TS011F",
  "class": "zigpy.device.Device"
}
Diagnostic information
{
  "home_assistant": {
    "installation_type": "Home Assistant Container",
    "version": "2022.9.6",
    "dev": false,
    "hassio": false,
    "virtualenv": false,
    "python_version": "3.10.5",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Australia/Sydney",
    "os_name": "Linux",
    "os_version": "5.10.0-18-amd64",
    "run_as_root": true
  },
  "custom_components": {
    "localtuya": {
      "version": "4.1.0",
      "requirements": []
    }
  },
  "integration_manifest": {
    "domain": "zha",
    "name": "Zigbee Home Automation",
    "config_flow": true,
    "documentation": "https://www.home-assistant.io/integrations/zha",
    "requirements": [
      "bellows==0.33.1",
      "pyserial==3.5",
      "pyserial-asyncio==0.6",
      "zha-quirks==0.0.79",
      "zigpy-deconz==0.18.1",
      "zigpy==0.50.3",
      "zigpy-xbee==0.15.0",
      "zigpy-zigate==0.9.2",
      "zigpy-znp==0.8.2"
    ],
    "usb": [
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*2652*",
        "known_devices": [
          "slae.sh cc2652rb stick"
        ]
      },
      {
        "vid": "1A86",
        "pid": "55D4",
        "description": "*sonoff*plus*",
        "known_devices": [
          "sonoff zigbee dongle plus v2"
        ]
      },
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*sonoff*plus*",
        "known_devices": [
          "sonoff zigbee dongle plus"
        ]
      },
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*tubeszb*",
        "known_devices": [
          "TubesZB Coordinator"
        ]
      },
      {
        "vid": "1A86",
        "pid": "7523",
        "description": "*tubeszb*",
        "known_devices": [
          "TubesZB Coordinator"
        ]
      },
      {
        "vid": "1A86",
        "pid": "7523",
        "description": "*zigstar*",
        "known_devices": [
          "ZigStar Coordinators"
        ]
      },
      {
        "vid": "1CF1",
        "pid": "0030",
        "description": "*conbee*",
        "known_devices": [
          "Conbee II"
        ]
      },
      {
        "vid": "10C4",
        "pid": "8A2A",
        "description": "*zigbee*",
        "known_devices": [
          "Nortek HUSBZB-1"
        ]
      },
      {
        "vid": "0403",
        "pid": "6015",
        "description": "*zigate*",
        "known_devices": [
          "ZiGate+"
        ]
      },
      {
        "vid": "10C4",
        "pid": "EA60",
        "description": "*zigate*",
        "known_devices": [
          "ZiGate"
        ]
      },
      {
        "vid": "10C4",
        "pid": "8B34",
        "description": "*bv 2010/10*",
        "known_devices": [
          "Bitron Video AV2010/10"
        ]
      }
    ],
    "codeowners": [
      "@dmulcahey",
      "@adminiuga",
      "@puddly"
    ],
    "zeroconf": [
      {
        "type": "_esphomelib._tcp.local.",
        "name": "tube*"
      },
      {
        "type": "_zigate-zigbee-gateway._tcp.local.",
        "name": "*zigate*"
      }
    ],
    "dependencies": [
      "file_upload"
    ],
    "after_dependencies": [
      "onboarding",
      "usb",
      "zeroconf"
    ],
    "iot_class": "local_polling",
    "loggers": [
      "aiosqlite",
      "bellows",
      "crccheck",
      "pure_pcapy3",
      "zhaquirks",
      "zigpy",
      "zigpy_deconz",
      "zigpy_xbee",
      "zigpy_zigate",
      "zigpy_znp"
    ],
    "is_built_in": true
  },
  "data": {
    "ieee": "**REDACTED**",
    "nwk": 15778,
    "manufacturer": "_TZ3000_raviyuvk",
    "model": "TS011F",
    "name": "_TZ3000_raviyuvk TS011F",
    "quirk_applied": false,
    "quirk_class": "zigpy.device.Device",
    "manufacturer_code": 4098,
    "power_source": "Mains",
    "lqi": 255,
    "rssi": -44,
    "last_seen": "2022-09-25T15:27:30",
    "available": true,
    "device_type": "Router",
    "signature": {
      "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress|RxOnWhenIdle|MainsPowered|FullFunctionDevice: 142>, manufacturer_code=4098, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)",
      "endpoints": {
        "1": {
          "profile_id": 260,
          "device_type": "0x0051",
          "in_clusters": [
            "0x0000",
            "0x0004",
            "0x0005",
            "0x0006",
            "0x0702",
            "0x0b04"
          ],
          "out_clusters": [
            "0x000a",
            "0x0019"
          ]
        },
        "2": {
          "profile_id": 260,
          "device_type": "0x0051",
          "in_clusters": [
            "0x0004",
            "0x0005",
            "0x0006",
            "0x0702",
            "0x0b04"
          ],
          "out_clusters": []
        }
      }
    },
    "active_coordinator": false,
    "entities": [
      {
        "entity_id": "sensor.laundy_switch_near_door_electricalmeasurement",
        "name": "_TZ3000_raviyuvk TS011F"
      },
      {
        "entity_id": "sensor.laundy_switch_near_door_electricalmeasurement_2",
        "name": "_TZ3000_raviyuvk TS011F"
      },
      {
        "entity_id": "sensor.laundy_switch_near_door_electricalmeasurementpowerfactor",
        "name": "_TZ3000_raviyuvk TS011F"
      },
      {
        "entity_id": "sensor.laundy_switch_near_door_electricalmeasurementpowerfactor_2",
        "name": "_TZ3000_raviyuvk TS011F"
      },
      {
        "entity_id": "sensor.laundy_switch_near_door_electricalmeasurementrmscurrent",
        "name": "_TZ3000_raviyuvk TS011F"
      },
      {
        "entity_id": "sensor.laundy_switch_near_door_electricalmeasurementrmscurrent_2",
        "name": "_TZ3000_raviyuvk TS011F"
      },
      {
        "entity_id": "sensor.laundy_switch_near_door_electricalmeasurementrmsvoltage",
        "name": "_TZ3000_raviyuvk TS011F"
      },
      {
        "entity_id": "sensor.laundy_switch_near_door_electricalmeasurementrmsvoltage_2",
        "name": "_TZ3000_raviyuvk TS011F"
      },
      {
        "entity_id": "sensor.laundy_switch_near_door_polledsmartenergysummation",
        "name": "_TZ3000_raviyuvk TS011F"
      },
      {
        "entity_id": "sensor.laundy_switch_near_door_polledsmartenergysummation_2",
        "name": "_TZ3000_raviyuvk TS011F"
      },
      {
        "entity_id": "switch.laundy_switch_near_door_switch",
        "name": "_TZ3000_raviyuvk TS011F"
      },
      {
        "entity_id": "switch.laundy_switch_near_door_switch_2",
        "name": "_TZ3000_raviyuvk TS011F"
      }
    ],
    "neighbors": [],
    "endpoint_names": [
      {
        "name": "SMART_PLUG"
      },
      {
        "name": "SMART_PLUG"
      }
    ],
    "user_given_name": "Laundy Switch Near Door",
    "device_reg_id": "7cdcd8997177b0104b82ecd2f2dee995",
    "area_id": "laundry",
    "cluster_details": {
      "1": {
        "device_type": {
          "name": "SMART_PLUG",
          "id": 81
        },
        "profile_id": 260,
        "in_clusters": {
          "0x0000": {
            "endpoint_attribute": "basic",
            "attributes": {
              "0x0001": {
                "attribute_name": "app_version",
                "value": 68
              },
              "0x0004": {
                "attribute_name": "manufacturer",
                "value": "_TZ3000_raviyuvk"
              },
              "0x0005": {
                "attribute_name": "model",
                "value": "TS011F"
              }
            },
            "unsupported_attributes": {}
          },
          "0x0004": {
            "endpoint_attribute": "groups",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0005": {
            "endpoint_attribute": "scenes",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0006": {
            "endpoint_attribute": "on_off",
            "attributes": {
              "0x0000": {
                "attribute_name": "on_off",
                "value": 0
              },
              "0x4001": {
                "attribute_name": "on_time",
                "value": 0
              },
              "0x4002": {
                "attribute_name": "off_wait_time",
                "value": 0
              }
            },
            "unsupported_attributes": {
              "0x4003": {
                "attribute_name": "start_up_on_off"
              }
            }
          },
          "0x0702": {
            "endpoint_attribute": "smartenergy_metering",
            "attributes": {
              "0x0000": {
                "attribute_name": "current_summ_delivered",
                "value": 79
              },
              "0x0200": {
                "attribute_name": "status",
                "value": 0
              },
              "0x0300": {
                "attribute_name": "unit_of_measure",
                "value": 0
              },
              "0x0303": {
                "attribute_name": "summation_formatting",
                "value": 0
              },
              "0x0306": {
                "attribute_name": "metering_device_type",
                "value": 0
              }
            },
            "unsupported_attributes": {
              "0x0400": {
                "attribute_name": "instantaneous_demand"
              },
              "0x0301": {
                "attribute_name": "multiplier"
              },
              "0x0302": {
                "attribute_name": "divisor"
              },
              "0x0304": {
                "attribute_name": "demand_formatting"
              }
            }
          },
          "0x0b04": {
            "endpoint_attribute": "electrical_measurement",
            "attributes": {
              "0x0505": {
                "attribute_name": "rms_voltage",
                "value": 248
              },
              "0x0508": {
                "attribute_name": "rms_current",
                "value": 10
              },
              "0x050b": {
                "attribute_name": "active_power",
                "value": 2
              }
            },
            "unsupported_attributes": {
              "0x0600": {
                "attribute_name": "ac_voltage_multiplier"
              },
              "0x0601": {
                "attribute_name": "ac_voltage_divisor"
              },
              "0x0602": {
                "attribute_name": "ac_current_multiplier"
              },
              "0x0603": {
                "attribute_name": "ac_current_divisor"
              },
              "0x0604": {
                "attribute_name": "ac_power_multiplier"
              },
              "0x0605": {
                "attribute_name": "ac_power_divisor"
              },
              "0x0401": {
                "attribute_name": "ac_frequency_divisor"
              },
              "0x0400": {
                "attribute_name": "ac_frequency_multiplier"
              },
              "0x0000": {
                "attribute_name": "measurement_type"
              },
              "0x0403": {
                "attribute_name": "power_divisor"
              },
              "0x0402": {
                "attribute_name": "power_multiplier"
              },
              "0x050a": {
                "attribute_name": "rms_current_max"
              },
              "0x050d": {
                "attribute_name": "active_power_max"
              },
              "0x0507": {
                "attribute_name": "rms_voltage_max"
              },
              "0x050f": {
                "attribute_name": "apparent_power"
              },
              "0x0300": {
                "attribute_name": "ac_frequency"
              },
              "0x0302": {
                "attribute_name": "ac_frequency_max"
              }
            }
          }
        },
        "out_clusters": {
          "0x0019": {
            "endpoint_attribute": "ota",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x000a": {
            "endpoint_attribute": "time",
            "attributes": {},
            "unsupported_attributes": {}
          }
        }
      },
      "2": {
        "device_type": {
          "name": "SMART_PLUG",
          "id": 81
        },
        "profile_id": 260,
        "in_clusters": {
          "0x0004": {
            "endpoint_attribute": "groups",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0005": {
            "endpoint_attribute": "scenes",
            "attributes": {},
            "unsupported_attributes": {}
          },
          "0x0006": {
            "endpoint_attribute": "on_off",
            "attributes": {
              "0x0000": {
                "attribute_name": "on_off",
                "value": 1
              },
              "0x4001": {
                "attribute_name": "on_time",
                "value": 0
              },
              "0x4002": {
                "attribute_name": "off_wait_time",
                "value": 0
              }
            },
            "unsupported_attributes": {
              "0x4003": {
                "attribute_name": "start_up_on_off"
              }
            }
          },
          "0x0702": {
            "endpoint_attribute": "smartenergy_metering",
            "attributes": {
              "0x0000": {
                "attribute_name": "current_summ_delivered",
                "value": 79
              },
              "0x0200": {
                "attribute_name": "status",
                "value": 0
              },
              "0x0300": {
                "attribute_name": "unit_of_measure",
                "value": 0
              },
              "0x0303": {
                "attribute_name": "summation_formatting",
                "value": 0
              },
              "0x0306": {
                "attribute_name": "metering_device_type",
                "value": 0
              }
            },
            "unsupported_attributes": {
              "0x0400": {
                "attribute_name": "instantaneous_demand"
              },
              "0x0301": {
                "attribute_name": "multiplier"
              },
              "0x0302": {
                "attribute_name": "divisor"
              },
              "0x0304": {
                "attribute_name": "demand_formatting"
              }
            }
          },
          "0x0b04": {
            "endpoint_attribute": "electrical_measurement",
            "attributes": {
              "0x0505": {
                "attribute_name": "rms_voltage",
                "value": 247
              },
              "0x0508": {
                "attribute_name": "rms_current",
                "value": 10
              },
              "0x050b": {
                "attribute_name": "active_power",
                "value": 2
              }
            },
            "unsupported_attributes": {
              "0x0600": {
                "attribute_name": "ac_voltage_multiplier"
              },
              "0x0601": {
                "attribute_name": "ac_voltage_divisor"
              },
              "0x0602": {
                "attribute_name": "ac_current_multiplier"
              },
              "0x0603": {
                "attribute_name": "ac_current_divisor"
              },
              "0x0604": {
                "attribute_name": "ac_power_multiplier"
              },
              "0x0605": {
                "attribute_name": "ac_power_divisor"
              },
              "0x0401": {
                "attribute_name": "ac_frequency_divisor"
              },
              "0x0400": {
                "attribute_name": "ac_frequency_multiplier"
              },
              "0x0000": {
                "attribute_name": "measurement_type"
              },
              "0x0403": {
                "attribute_name": "power_divisor"
              },
              "0x0402": {
                "attribute_name": "power_multiplier"
              },
              "0x050a": {
                "attribute_name": "rms_current_max"
              },
              "0x050d": {
                "attribute_name": "active_power_max"
              },
              "0x0507": {
                "attribute_name": "rms_voltage_max"
              },
              "0x050f": {
                "attribute_name": "apparent_power"
              },
              "0x0300": {
                "attribute_name": "ac_frequency"
              },
              "0x0302": {
                "attribute_name": "ac_frequency_max"
              }
            }
          }
        },
        "out_clusters": {}
      }
    }
  }
}
Additional logs
Paste any additional debug logs here.
Don't remove the extra line breaks outside the ``` marks.

Additional context This is an Australian plug. plug screenshot is with very minimal load on plug. Current should be 0.01A and 0.79 for kWh

Thanks!

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
MattWestbcommented, Sep 25, 2022

The device is not loading the quirk that shall fixing the power measurement and need one new device class in the https://github.com/zigpy/zha-device-handlers/blob/dev/zhaquirks/tuya/ts011f_plug.py quirk.

0reactions
peterkhcommented, Sep 27, 2022

Just gave it a try and works a treat, thank you!

Screen Shot 2022-09-27 at 9 24 39 pm With real load on it.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Contact Us | Tuya Smart
Submit a request to speak with our IoT experts. Company Name. Contact Person.
Read more >
Customer Service System | Tuya Smart
Conveniently view device information and user information to quickly locate issues, quickly and regularly obtain gateway logs, allocate user issues into ...
Read more >
What should I do when my device fails to connect ... - Tuya.com
Ensure that your device has been added over a Wi-Fi band of 2.4 GHz (Check whether the 2.4 GHz band and 5GHz band...
Read more >
Smart Electrical Solutions | Enjoy a smart life in a comfortable ...
The Tuya platform supports multi-specification plug-and-play modules of common communication protocols, including Wi-Fi, Zigbee, Bluetooth, NB-IoT, ...
Read more >
Tuya Smart Launches Its Latest Solutions that will support ...
“Is there a way to simply use one App to control all of the smart devices in my home? I don't want to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found