Closed antoweb closed 4 months ago
I have used the same quirk of _TZE200_pay2byax changing just line 84 to: MODELS_INFO: [("_TZE200_fwoorn8y", "TS0601")], Attach are the python quirk to rename in py and copy in \config\custom_zha_quirks ts0601_TZE200_fwoorn8y_magnet.txt
I have used the same quirk of _TZE200_pay2byax changin just line 84 to: ...
And does the device work with that custom quirk?
Yes work but without illuminance and battery. Work just the open/close door (the most important) i dont know python if tehre is someone that want to edit this script for add illuminance and battery state is welcome :-)
Ok work also the battery sensor. Just illuminance is missing
The quirk here have the iluminance implemented: https://github.com/zigpy/zha-device-handlers/issues/1502#issuecomment-1378743535
If not working, enable the debug logs and attach them.
Yes thanks but for this model must be modify the line 86
from: MODELS_INFO: [("_TZE200_pay2byax", "TS0601")],
to: MODELS_INFO: [("_TZE200_fwoorn8y", "TS0601")],
Well, the right way to do it would be to add your device like this:
MODELS_INFO: [
("_TZE200_fwoorn8y", "TS0601"),
("_TZE200_pay2byax", "TS0601"),
],
Your quirk does not implement DP=101 and the suggested one does. Have you tried it? Without the debug logs we can't know where is the problem and we can't help you.
Yes i have tried and works good..thanks for the suggestion to add the device
Great! Do you mind to create the PR with the working code?
Wath is PR?
PR states for "Pull Request" the way to propose changes to the library mainstream. Don't worry if you are not familiar.
Could you check that this version is working and fixes your device:
How do I add this to HA? I can test to see if it works.
How do I add this to HA? I can test to see if it works.
You would need enable the local quirk folder in your installation. There is a good guide to configure it:
Once configured, create in your custom_zha_quirks
folder (i.e.) a ts0601_magnet.py
file with the suggested code.
Save changes and repair your device. Check if the device signature has changed.
I got this error when restarting HA
Logger: homeassistant.config_entries
Source: custom_zha_quirks/ts0601_magnet.py:54
First occurred: 12:36:10 PM (1 occurrences)
Last logged: 12:36:10 PM
Error setting up entry socket://192.168.0.219:6638 for zha
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 382, in async_setup
result = await component.async_setup_entry(hass, self)
File "/usr/src/homeassistant/homeassistant/components/zha/__init__.py", line 100, in async_setup_entry
setup_quirks(config)
File "/usr/local/lib/python3.10/site-packages/zhaquirks/__init__.py", line 409, in setup
importer.find_module(modname).load_module(modname)
File "<frozen importlib._bootstrap_external>", line 548, in _check_name_wrapper
File "<frozen importlib._bootstrap_external>", line 1063, in load_module
File "<frozen importlib._bootstrap_external>", line 888, in load_module
File "<frozen importlib._bootstrap>", line 290, in _load_module_shim
File "<frozen importlib._bootstrap>", line 719, in _load
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/config/custom_zha_quirks/ts0601_magnet.py", line 50, in <module>
class ContactSwitchManufCluster(TuyaMCUCluster):
File "/config/custom_zha_quirks/ts0601_magnet.py", line 54, in ContactSwitchManufCluster
1: DPToAttributeMapping(
TypeError: DPToAttributeMapping.__init__() missing 1 required positional argument: 'dp_type'
Sorry, new version incoming...
I have added all the dp_type=TuyaDPType.XXXX
in the DPToAttributeMapping
definitions.
Hi @javicalle
There's still an error.
Logger: homeassistant.config_entries
Source: custom_zha_quirks/ts0601_magnet.py:57
First occurred: 1:36:47 PM (1 occurrences)
Last logged: 1:36:47 PM
Error setting up entry socket://192.168.0.219:6638 for zha
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 382, in async_setup
result = await component.async_setup_entry(hass, self)
File "/usr/src/homeassistant/homeassistant/components/zha/__init__.py", line 100, in async_setup_entry
setup_quirks(config)
File "/usr/local/lib/python3.10/site-packages/zhaquirks/__init__.py", line 409, in setup
importer.find_module(modname).load_module(modname)
File "<frozen importlib._bootstrap_external>", line 548, in _check_name_wrapper
File "<frozen importlib._bootstrap_external>", line 1063, in load_module
File "<frozen importlib._bootstrap_external>", line 888, in load_module
File "<frozen importlib._bootstrap>", line 290, in _load_module_shim
File "<frozen importlib._bootstrap>", line 719, in _load
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/config/custom_zha_quirks/ts0601_magnet.py", line 50, in <module>
class ContactSwitchManufCluster(TuyaMCUCluster):
File "/config/custom_zha_quirks/ts0601_magnet.py", line 57, in ContactSwitchManufCluster
dp_type=TuyaDPType.ENUM,
NameError: name 'TuyaDPType' is not defined
Make sure you're importing TuyaDPType
from zhaquirks.tuya
.
For example:
from zhaquirks.tuya import TuyaLocalCluster, TuyaDPType
Thank you @TheJulianJES that worked.
@javicalle Unfortunately, I do not get the sensor to show data
{
"home_assistant": {
"installation_type": "Home Assistant OS",
"version": "2023.2.5",
"dev": false,
"hassio": true,
"virtualenv": false,
"python_version": "3.10.7",
"docker": true,
"arch": "aarch64",
"timezone": "Asia/Kuala_Lumpur",
"os_name": "Linux",
"os_version": "5.15.84-v8",
"supervisor": "2023.01.1",
"host_os": "Home Assistant OS 9.5",
"docker_version": "20.10.22",
"chassis": "embedded",
"run_as_root": true
},
"custom_components": {
"sonoff": {
"version": "3.4.0",
"requirements": [
"pycryptodome>=3.6.6"
]
},
"hacs": {
"version": "1.30.1",
"requirements": [
"aiogithubapi>=22.10.1"
]
},
"wyzeapi": {
"version": "0.1.17",
"requirements": [
"wyzeapy==0.5.16"
]
},
"ui_lovelace_minimalist": {
"version": "v1.1.6-hotfix",
"requirements": [
"aiofiles==0.8.0",
"aiogithubapi>=22.2.4"
]
},
"localtuya": {
"version": "5.0.0",
"requirements": []
},
"ble_monitor": {
"version": "11.7.1",
"requirements": [
"pycryptodomex>=3.14.1",
"janus>=1.0.0",
"aioblescan>=0.2.14",
"btsocket>=0.2.0",
"pyric>=0.1.6.3"
]
},
"tuya_local": {
"version": "2022.2.3",
"requirements": [
"pycryptodome~=3.17",
"tinytuya==1.10.2"
]
},
"mass": {
"version": "2023.2.1",
"requirements": [
"music-assistant==1.8.7.4"
]
}
},
"integration_manifest": {
"domain": "zha",
"name": "Zigbee Home Automation",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/zha",
"requirements": [
"bellows==0.34.7",
"pyserial==3.5",
"pyserial-asyncio==0.6",
"zha-quirks==0.0.92",
"zigpy-deconz==0.19.2",
"zigpy==0.53.0",
"zigpy-xbee==0.16.2",
"zigpy-zigate==0.10.3",
"zigpy-znp==0.9.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*"
},
{
"type": "_zigstar_gw._tcp.local.",
"name": "*zigstar*"
},
{
"type": "_slzb-06._tcp.local.",
"name": "slzb-06*"
}
],
"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": 33974,
"manufacturer": "_TZE200_fwoorn8y",
"model": "TS0601",
"name": "_TZE200_fwoorn8y TS0601",
"quirk_applied": false,
"quirk_class": "zigpy.device.Device",
"manufacturer_code": 4417,
"power_source": "Battery or Unknown",
"lqi": null,
"rssi": null,
"last_seen": "2023-02-24T13:54:54",
"available": true,
"device_type": "EndDevice",
"signature": {
"node_descriptor": "NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, manufacturer_code=4417, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)",
"endpoints": {
"1": {
"profile_id": 260,
"device_type": "0x0051",
"in_clusters": [
"0x0000",
"0x0004",
"0x0005",
"0xef00"
],
"out_clusters": [
"0x000a",
"0x0019"
]
}
}
},
"active_coordinator": false,
"entities": [],
"neighbors": [],
"routes": [],
"endpoint_names": [
{
"name": "SMART_PLUG"
}
],
"user_given_name": "Contact - Washing Machine",
"device_reg_id": "cd4c0af2eabcda5714cd1d6b74b0b7b2",
"area_id": "wash_area",
"cluster_details": {
"1": {
"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": {}
},
"0xef00": {
"endpoint_attribute": null,
"attributes": {},
"unsupported_attributes": {}
},
"0x0000": {
"endpoint_attribute": "basic",
"attributes": {
"0x0004": {
"attribute_name": "manufacturer",
"value": "_TZE200_fwoorn8y"
},
"0x0005": {
"attribute_name": "model",
"value": "TS0601"
}
},
"unsupported_attributes": {}
}
},
"out_clusters": {
"0x0019": {
"endpoint_attribute": "ota",
"attributes": {},
"unsupported_attributes": {}
},
"0x000a": {
"endpoint_attribute": "time",
"attributes": {},
"unsupported_attributes": {}
}
}
}
}
}
}
@patrickdass93 Your device signature doesn't match at all with the quirk. Please attach the product or vendor link.
Maybe that (quick and untested) quirk could work for you:
@javicalle is this what you mean by product link?
@javicalle is this what you mean by product link?
Yes, that is. The site don't tell anything about device capabilities so no sure if it will report illuminace, battery or anything else. Probably (if the device gets the quirk) that new entities are not populated. If so, it will be better to create a new issue and work from it with your logs.
It should report contact(open/closed) and battery level.
Well, it's a matter of see if the device gets the quirk and what DPs is using... Thes the proposed quirk and enable the debud logs if not working.
PS: you can expand the 'ts0601_magnet.py' block
Hello, after last update HA to 2023.3 this quirks generate error and all Zigbee Integration cannot load. i have to remove from custom_zha_quirks any solution?
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 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.
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 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.
Is your feature request related to a problem? Please describe. Is possible to write a quirk for the device i subject? Attached are diagnostic information
Describe the solution you'd like A clear and concise description of what you want to happen.
Device signature
```yaml Paste the device signature here. Don't remove the extra line breaks outside the ``` marks. ```Diagnostic information
```yaml { "home_assistant": { "installation_type": "Home Assistant OS", "version": "2023.1.7", "dev": false, "hassio": true, "virtualenv": false, "python_version": "3.10.7", "docker": true, "arch": "aarch64", "timezone": "Europe/Rome", "os_name": "Linux", "os_version": "5.15.76-v8", "supervisor": "2022.12.1", "host_os": "Home Assistant OS 9.4", "docker_version": "20.10.19", "chassis": "embedded", "run_as_root": true }, "custom_components": { "iphonedetect": { "version": "1.4.0", "requirements": [] }, "tuya_local": { "version": "2022.1.2", "requirements": [ "pycryptodome~=3.16.0", "tinytuya==1.9.1" ] }, "hacs": { "version": "1.30.0", "requirements": [ "aiogithubapi>=22.10.1" ] }, "candy": { "version": "1.0.0", "requirements": [ "backoff~=2.0", "aiolimiter~=1.0" ] }, "shelly": { "version": "1.0.2", "requirements": [ "pyShelly==1.0.2", "paho-mqtt==1.6.1", "websocket-client" ] }, "smartir": { "version": "1.17.6", "requirements": [ "aiofiles==0.6.0" ] }, "arpscan_tracker": { "version": "1.0.6", "requirements": [] }, "xiaomi_miot": { "version": "0.7.5", "requirements": [ "construct==2.10.56", "python-miio>=0.5.6", "micloud>=0.3" ] }, "alexa_media": { "version": "4.5.3", "requirements": [ "alexapy==1.26.4", "packaging>=20.3", "wrapt>=1.12.1" ] }, "ble_monitor": { "version": "11.4.1", "requirements": [ "pycryptodomex>=3.14.1", "janus>=1.0.0", "aioblescan>=0.2.14", "btsocket>=0.2.0", "pyric>=0.1.6.3" ] }, "sonoff": { "version": "3.3.1", "requirements": [ "pycryptodome>=3.6.6" ] } }, "integration_manifest": { "domain": "zha", "name": "Zigbee Home Automation", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/zha", "requirements": [ "bellows==0.34.6", "pyserial==3.5", "pyserial-asyncio==0.6", "zha-quirks==0.0.90", "zigpy-deconz==0.19.2", "zigpy==0.53.0", "zigpy-xbee==0.16.2", "zigpy-zigate==0.10.3", "zigpy-znp==0.9.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*" }, { "type": "_zigstar_gw._tcp.local.", "name": "*zigstar*" }, { "type": "_slzb-06._tcp.local.", "name": "slzb-06*" } ], "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": 50992, "manufacturer": "_TZE200_fwoorn8y", "model": "TS0601", "name": "_TZE200_fwoorn8y TS0601", "quirk_applied": false, "quirk_class": "zigpy.device.Device", "manufacturer_code": 4417, "power_source": "Battery or Unknown", "lqi": 153, "rssi": null, "last_seen": "2023-01-24T15:14:53", "available": true, "device_type": "EndDevice", "signature": { "node_descriptor": "NodeDescriptor(logical_type=Additional logs
``` Paste any additional debug logs here. Don't remove the extra line breaks outside the ``` marks. ```Additional context Add any other context or screenshots about the feature request here.