Closed ozhound closed 11 months ago
@TheJulianJES I have a device with a totally different model info ("_TZ3000_xkap8wtb"), but it has exactly the same zigbee signature and the same issue of 100x higher current. I wrote a custom quirk for my device that works:
https://gist.github.com/erkr/5d4addf1b4c8e18d68d2adb154c6be93
I wonder if that quirk also works for this device, and if so can be added to the official distribution.
Best Eric
when is it likely this will be resolved? Ive just got 5 of these sitting here doing nothing
I guess It will take a while to resolve this. Someone needs to test new code before it will included in the release.
Why don't you try my custom quirk? Comment out the model part (regering my plug) and uncomment models_info set with your device info. It will help the developers to know if that works. As the zigbee signature is equal, that would not surprise me. Success Eric
i have no idea how to implement quirk.
On Wed, 13 Sept 2023 at 21:40, Eric @.***> wrote:
I guess It will take a while to resolve this. Someone needs to test new code before it will included in the release.
Why don't you try my custom quirk? Comment out the model part (regering my plug) and uncomment models_info set with your device info. It will help the developers to know if that works. As the zigbee signature is equal, that would not surprise me. Success Eric
— Reply to this email directly, view it on GitHub https://github.com/zigpy/zha-device-handlers/issues/2573#issuecomment-1717658038, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA325VPR5B442NHMJX4DOJTX2GZUPANCNFSM6AAAAAA4OIAL2M . You are receiving this because you authored the thread.Message ID: @.***>
Step 1 is to enable custom quirks in your configuration.yaml: https://www.home-assistant.io/integrations/zha#configuration---yaml
Step 2 is to copy the custom quirk file inthe configured folder
Step 3 is restart HA and check your log for errors.
If no errors, check in the zigbee info of the device is the quirk is loaded
Please try this custom quirk:
when is it likely this will be resolved? Ive just got 5 of these sitting here doing nothing
Also note that this is all/mostly community-maintained. At least I'm doing this in my free time. So it's always possible that your devices may never be supported. Tuya is notorious for explicitly making it hard to have their devices work on third-party hubs. If they followed Zigbee spec, it would just work without any quirks.
If you need help installing the custom quirk I've posted above, let me know.
(Basic steps are: put the content in a file called something like tuya_plug.py
, put that file in your custom quirks directory that should be located in the /config
directory of your HA installation. Then, make sure the custom quirk directory is set in your HA configuration.yaml
, restart HA after that and see if the quirk applies to your device.
If everything works, let me know and we'll merge the quirk for the next major HA release. You should remove the custom quirk by then.)
Thankyou I will try it today. I've followed guides for creating quirks but I'm not strong on programming at all and whilst I get the general structure of the Jason file, the specifics just hurt my head. I appreciate this is community run and thank all that contribute.
Regards
Ozhound
On 17 Sept 2023 at 10:20, TheJulianJES @.***> wrote:
when is it likely this will be resolved? Ive just got 5 of these sitting here doing nothing
Also note that this is all/mostly community-maintained. At least I'm doing this in my free time. So it's always possible that your devices may never be supported. Tuya is notorious for explicitly making it hard to have their devices work on third-party hubs. If they followed Zigbee spec, it would just work without any quirks.
If you need help installing the custom quirk I've posted above, let me know. (Basic steps are: put the content in a file called something like tuya_plug.py, put that file in your custom quirks directory that should be located in the /config directory of your HA installation. Then, make sure the custom quirk directory is set in your HA configuration.yaml, restart HA after that and see if the quirk applies to your device. If everything works, let me know and we'll merge the quirk for the next major HA release. You should remove the custom quirk by then.)
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
@TheJulianJES
I tried that quirk and the LOGS say that its loaded custom quirks but it isn't applied to that device.
Is there a reason we cant take an inbuilt quirk , create a custom quirk, changing the model to make it work? I have 5 or these exact same units that work beautifully and have a quirk applied to it automatically. These last 5, bought from the same supplied 2 weeks later have the different model code but are the same unit?
This is the working unit showing the quirk being applied by ZHA automatically
Thanks again for responding initially.
I've updated my above comment. Please try the updated quirk.
Is there a reason we cant take an inbuilt quirk , create a custom quirk, changing the model to make it work?
Yes, it's not the model that is different. The exposed clusters are different. It's basically an entirely different plug (under the hood) (or at least running different firmware).
@TheJulianJES Brilliant, that worked!. Power delivered looks right, the other sensors seem to have registered properly. Ill do some more testing but it looks like its working.
Thankyou so much.
I can confirm that this custom quirk mentioned earlier works perfectly, so should be integrated in the main code. My plugs are the following: _TZ3000_0zfrhq4i TS011F
Thanks for testing!
This PR adds support for the plug: https://github.com/zigpy/zha-device-handlers/pull/2592 It should be available in HA 2023.10.0
I'm (kind of?) in the same boat as OP. I got two batches of plugs labelled as "_TZ3000_cehuw1lw TS011F" however only one batch works with zha, the one I ordered first. The batch of plugs I ordered after that all don't work, even though they look the same and show the same device info in Homeassistant.
The one in the first picture is working fine. All data is being reported correctly and there is no connection loss whatsoever. The one in the second picture only works during pairing, where I can turn if on and off for some time until the light on the plugs stops blinking (= pairing mode stops).
Here are the diagnostics from one plug of each batch.
```
{
"home_assistant": {
"installation_type": "Home Assistant Core",
"version": "2023.9.3",
"dev": false,
"hassio": false,
"virtualenv": true,
"python_version": "3.11.4",
"docker": false,
"arch": "aarch64",
"timezone": "Europe/Berlin",
"os_name": "Linux",
"os_version": "6.1.21-v8+",
"run_as_root": false
},
"custom_components": {
"dwd": {
"version": "2023.8.2",
"requirements": []
},
"dwd_pollenflug": {
"version": "1.0.2",
"requirements": [
"pytz"
]
},
"dwd_weather": {
"version": "v2.0.1",
"requirements": [
"simple_dwd_weatherforecast==2.0.14",
"markdownify==0.6.5"
]
},
"localtuya": {
"version": "5.2.1",
"requirements": []
},
"hacs": {
"version": "1.33.0",
"requirements": [
"aiogithubapi>=22.10.1"
]
},
"better_thermostat": {
"version": "1.3.0",
"requirements": []
},
"ble_monitor": {
"version": "12.6.0",
"requirements": [
"pycryptodomex>=3.18.0",
"janus>=1.0.0",
"aioblescan>=0.2.14",
"btsocket>=0.2.0",
"pyric>=0.1.6.3"
]
},
"dwains_dashboard": {
"version": "3.4.3",
"requirements": []
},
"tapo_control": {
"version": "5.2.4",
"requirements": [
"pytapo==3.2.14"
]
},
"holidays": {
"version": "1.9.6",
"requirements": [
"python-dateutil>=2.8.2",
"holidays>=0.14.2"
]
}
},
"integration_manifest": {
"domain": "zha",
"name": "Zigbee Home Automation",
"after_dependencies": [
"onboarding",
"usb"
],
"codeowners": [
"@dmulcahey",
"@adminiuga",
"@puddly"
],
"config_flow": true,
"dependencies": [
"file_upload"
],
"documentation": "https://www.home-assistant.io/integrations/zha",
"iot_class": "local_polling",
"loggers": [
"aiosqlite",
"bellows",
"crccheck",
"pure_pcapy3",
"zhaquirks",
"zigpy",
"zigpy_deconz",
"zigpy_xbee",
"zigpy_zigate",
"zigpy_znp",
"universal_silabs_flasher"
],
"requirements": [
"bellows==0.36.4",
"pyserial==3.5",
"pyserial-asyncio==0.6",
"zha-quirks==0.0.103",
"zigpy-deconz==0.21.1",
"zigpy==0.57.1",
"zigpy-xbee==0.18.2",
"zigpy-zigate==0.11.0",
"zigpy-znp==0.11.4",
"universal-silabs-flasher==0.0.14"
],
"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"
]
}
],
"zeroconf": [
{
"type": "_esphomelib._tcp.local.",
"name": "tube*"
},
{
"type": "_zigate-zigbee-gateway._tcp.local.",
"name": "*zigate*"
},
{
"type": "_zigstar_gw._tcp.local.",
"name": "*zigstar*"
},
{
"type": "_uzg-01._tcp.local.",
"name": "uzg-01*"
},
{
"type": "_slzb-06._tcp.local.",
"name": "slzb-06*"
}
],
"is_built_in": true
},
"data": {
"ieee": "**REDACTED**",
"nwk": 11615,
"manufacturer": "_TZ3000_cehuw1lw",
"model": "TS011F",
"name": "_TZ3000_cehuw1lw TS011F",
"quirk_applied": true,
"quirk_class": "zhaquirks.tuya.ts011f_plug.Plug",
"manufacturer_code": 4417,
"power_source": "Mains",
"lqi": 196,
"rssi": -51,
"last_seen": "2023-09-27T12:59:37",
"available": true,
"device_type": "Router",
"signature": {
"node_descriptor": "NodeDescriptor(logical_type=
```
{
"home_assistant": {
"installation_type": "Home Assistant Core",
"version": "2023.9.3",
"dev": false,
"hassio": false,
"virtualenv": true,
"python_version": "3.11.4",
"docker": false,
"arch": "aarch64",
"timezone": "Europe/Berlin",
"os_name": "Linux",
"os_version": "6.1.21-v8+",
"run_as_root": false
},
"custom_components": {
"dwd": {
"version": "2023.8.2",
"requirements": []
},
"dwd_pollenflug": {
"version": "1.0.2",
"requirements": [
"pytz"
]
},
"dwd_weather": {
"version": "v2.0.1",
"requirements": [
"simple_dwd_weatherforecast==2.0.14",
"markdownify==0.6.5"
]
},
"localtuya": {
"version": "5.2.1",
"requirements": []
},
"hacs": {
"version": "1.33.0",
"requirements": [
"aiogithubapi>=22.10.1"
]
},
"better_thermostat": {
"version": "1.3.0",
"requirements": []
},
"ble_monitor": {
"version": "12.6.0",
"requirements": [
"pycryptodomex>=3.18.0",
"janus>=1.0.0",
"aioblescan>=0.2.14",
"btsocket>=0.2.0",
"pyric>=0.1.6.3"
]
},
"dwains_dashboard": {
"version": "3.4.3",
"requirements": []
},
"tapo_control": {
"version": "5.2.4",
"requirements": [
"pytapo==3.2.14"
]
},
"holidays": {
"version": "1.9.6",
"requirements": [
"python-dateutil>=2.8.2",
"holidays>=0.14.2"
]
}
},
"integration_manifest": {
"domain": "zha",
"name": "Zigbee Home Automation",
"after_dependencies": [
"onboarding",
"usb"
],
"codeowners": [
"@dmulcahey",
"@adminiuga",
"@puddly"
],
"config_flow": true,
"dependencies": [
"file_upload"
],
"documentation": "https://www.home-assistant.io/integrations/zha",
"iot_class": "local_polling",
"loggers": [
"aiosqlite",
"bellows",
"crccheck",
"pure_pcapy3",
"zhaquirks",
"zigpy",
"zigpy_deconz",
"zigpy_xbee",
"zigpy_zigate",
"zigpy_znp",
"universal_silabs_flasher"
],
"requirements": [
"bellows==0.36.4",
"pyserial==3.5",
"pyserial-asyncio==0.6",
"zha-quirks==0.0.103",
"zigpy-deconz==0.21.1",
"zigpy==0.57.1",
"zigpy-xbee==0.18.2",
"zigpy-zigate==0.11.0",
"zigpy-znp==0.11.4",
"universal-silabs-flasher==0.0.14"
],
"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"
]
}
],
"zeroconf": [
{
"type": "_esphomelib._tcp.local.",
"name": "tube*"
},
{
"type": "_zigate-zigbee-gateway._tcp.local.",
"name": "*zigate*"
},
{
"type": "_zigstar_gw._tcp.local.",
"name": "*zigstar*"
},
{
"type": "_uzg-01._tcp.local.",
"name": "uzg-01*"
},
{
"type": "_slzb-06._tcp.local.",
"name": "slzb-06*"
}
],
"is_built_in": true
},
"data": {
"ieee": "**REDACTED**",
"nwk": 793,
"manufacturer": "_TZ3000_cehuw1lw",
"model": "TS011F",
"name": "_TZ3000_cehuw1lw TS011F",
"quirk_applied": true,
"quirk_class": "zhaquirks.tuya.ts011f_plug.Plug",
"manufacturer_code": 4417,
"power_source": "Mains",
"lqi": 180,
"rssi": -55,
"last_seen": "2023-09-27T14:21:16",
"available": true,
"device_type": "Router",
"signature": {
"node_descriptor": "NodeDescriptor(logical_type=
Following https://github.com/home-assistant/core/issues/98624#issuecomment-1688222346 fixed this issue for me
Hello. I have this power plug from another manufacturer : _TZ3000_okaz9tjs I can turn it on and off, all the sensors are present, but :
I don't mind the wrong current measurement, but is is annoying to be forced to use it as a light.
I tried the custom quirk linked above: no change.
Anything else I could try ?
@alka79
I have several of these plugs and they work fine without custom quirk. On my system they use a released quirk zhaquirks.tuya.ts011f_plug.Plug_v2
:
Measurement is correct and the control is a switch type.
Thanks. So there is hope :)
Whatever I do, it is always a light. The quirk line is not displayed in the UI for this device. When looking in the diagnostics, I always see that no quirk was applied. I also tried with no success the custom quirk you published here: https://gist.github.com/erkr/5d4addf1b4c8e18d68d2adb154c6be93
My plug must be different. I could see that the released quirk for TS011F has already 3 versions ! this might be the 4th.
I have to figure out what the differences are and I don't really know where to look.
BTW, printed on my plug: manufacturer: ELIVCO model: SPA9
@alka79 I have exactly the same brand and firmware. Try to remove them. Restart en add them again.
New quirks not always load for existing devices:
Unbeliveable ! I tried twice already without custom quirk and also with the custom quirk you published and with the one publisher here by TheJulianJES. I'll try again later. Maybe some traces are left from my previous tries. Is there something else I should do to clean other than remove the device in HA ?
I tried again with no success. I started the log before pairing.
As I understand, your plug matches with the tuya.ts011f_plug.Plug_v2 quirk.
For my plug, the matching attempts fail with all the ts011f quirks, mostly "because endpoint list mismatch". For Plug_v2 the reason is a bit different :
2024-02-29 21:15:57.353 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.tuya.ts011f_plug.Plug_v2'>
2024-02-29 21:15:57.353 DEBUG (MainThread) [zigpy.quirks.registry] Fail because device_type mismatch on at least one endpoint
Attached is the full diagnostics of my plug. Maybe you could share the full diagnostics of one of yours matching the Plug_v2 quirk so that I can compare and possibly write a custom quirk based on Plug_v2 that would match my plug ?
I found a work around mentioned in the doc ! https://www.home-assistant.io/integrations/zha/#modifying-the-device-type/
RTFM ;)
modify configuration.yaml
zha:
device_config:
84:71:27:ff:fe:93:17:24-1: # format: {ieee}-{endpoint_id}
type: "switch" # corrected device type
The current metering is still wrong but at least it is recognized as a switch. Good enough for me.
I'm running out of suggestions. Sorry
the fully working quirk for my devices is here https://github.com/zigpy/zha-device-handlers/issues/1764#issuecomment-1946842958
I seem to have a different variant of cehuw1lw which is missing the 242 endpoint. I've only tested it briefly but all looks correct with current and summation power returning sane values. Here's the code:
"""TS011F plug."""
from zigpy.profiles import zgp, zha
from zigpy.zcl.clusters.general import (
Basic,
GreenPowerProxy,
Groups,
Identify,
OnOff,
Ota,
Scenes,
Time,
)
from zigpy.zcl.clusters.homeautomation import ElectricalMeasurement
from zigpy.zcl.clusters.lightlink import LightLink
from zigpy.zcl.clusters.smartenergy import Metering
from zhaquirks.const import (
DEVICE_TYPE,
ENDPOINTS,
INPUT_CLUSTERS,
MODEL,
MODELS_INFO,
OUTPUT_CLUSTERS,
PROFILE_ID,
)
from zhaquirks.tuya import (
TuyaZBE000Cluster,
TuyaZBElectricalMeasurement,
TuyaZBMeteringClusterWithUnit,
TuyaZBOnOffAttributeCluster,
)
from zhaquirks.tuya.mcu import EnchantedDevice
class Plug_v3(EnchantedDevice):
"""Tuya TS011F plug, _TZ3000_cehuw1lw variant."""
signature = {
MODEL: "TS011F",
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
INPUT_CLUSTERS: [
Basic.cluster_id,
Identify.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
OnOff.cluster_id,
Time.cluster_id,
Metering.cluster_id,
ElectricalMeasurement.cluster_id,
LightLink.cluster_id,
0x1888,
TuyaZBE000Cluster.cluster_id,
],
OUTPUT_CLUSTERS: [
Ota.cluster_id,
],
},
},
}
replacement = {
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
INPUT_CLUSTERS: [
Basic.cluster_id,
Identify.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
TuyaZBOnOffAttributeCluster,
Time.cluster_id,
TuyaZBMeteringClusterWithUnit,
TuyaZBElectricalMeasurement,
LightLink.cluster_id,
0x1888,
TuyaZBE000Cluster,
],
OUTPUT_CLUSTERS: [
Ota.cluster_id,
],
},
},
}
I’ve got this unit, but none of the quirks above seem to work, amp is the issue, reporting incorrectly as 1000x that is 84amps instead of 0.84
"node_descriptor": { "logical_type": 1, "complex_descriptor_available": 0, "user_descriptor_available": 0, "reserved": 0, "aps_flags": 0, "frequency_band": 8, "mac_capability_flags": 142, "manufacturer_code": 4107, "maximum_buffer_size": 66, "maximum_incoming_transfer_size": 66, "server_mask": 11264, "maximum_outgoing_transfer_size": 66, "descriptor_capability_field": 0 }, "endpoints": { "1": { "profile_id": "0x0104", "device_type": "0x0051", "input_clusters": [ "0x0000", "0x0003", "0x0004", "0x0005", "0x0006", "0x000a", "0x0702", "0x0b04", "0x1000", "0x1888", "0xe000" ], "output_clusters": [ "0x0019" ] } }, "manufacturer": "_TZ3000_cehuw1lw", "model": "TS011F", "class": "zigpy.device.Device" }
Anyone got suggestions?
Problem description
I have a frustrating issue with this power plug. The first lot of 5 that I installed worked great and the power measurement sensors work accurately and consitently
So 2 weeks later i purchased another 5 from the same seller (sixwgh store on Aliexpress) and when they came, they look and function identically. when installed in HA however, they are missing the Child Lock and the Backlight Settings, and the amperage is approximately 100 times what it is supposed to be (220 AMPS for a fridge?) power draw and Voltage seems accurate.
The difference i can see is that the new plugs mfg code is different and it isnt being picked up correctly by ZHA and the class is "zigpy.device.Device"
Solution description
For it to work the same way as the existing TS011F Plugs that look indentical
Screenshots/Video
Screenshots/Video
Existing (working correctly) Plug ![image](https://github.com/zigpy/zha-device-handlers/assets/3649237/6d9bd0f5-5fb7-4c2d-8b05-2b93aa6aac84) New - Partially Functioning Plug ![image](https://github.com/zigpy/zha-device-handlers/assets/3649237/deabe7c8-d917-41e4-b2ac-b1f404778105)Device signature
Device signature
Partly-working Device Sig ```json "node_descriptor": "NodeDescriptor(logical_type=Diagnostic information
Diagnostic information
[zha-0c688e36739db66388192a6b6d74d7b7-_TZ3000_0zfrhq4i TS011F-479ba64ed9e6ce5acde8be5383d9c027.json.txt](https://github.com/zigpy/zha-device-handlers/files/12544417/zha-0c688e36739db66388192a6b6d74d7b7-_TZ3000_0zfrhq4i.TS011F-479ba64ed9e6ce5acde8be5383d9c027.json.txt)Logs
Logs
```python [Paste the logs here] ```Custom quirk
Custom quirk
```python [Paste your custom quirk here] ```Additional information
No response