Closed Ultraboss77 closed 2 years ago
@Ultraboss77 Could you please use code brackets so I can try to assist you Could you also share the logging from the pairing process
```
on one line before and after so it not loosing its formatting.
Thanks you for correcting me. Json is more readable now, I know it is not the real format you usually found here, but I'm pretty sure all the infos you need is in. I will try to grab the infos from repairing, I'm running zigpy/bellows on Jeedom.
@Ultraboss77 I have no experience with Jeedom. So some Questions.
Is the plug working? If Yes, What is working and what is missing? If No, I can try to make a custom Quirk. (Later this day) Can you load custom_quirks in Jeedom for testing purposes?
@miit86, thanks for the help :) The module has used to work well before september, I could use on/off, the level for luminosity AND the reporting was working (state and level). From now, I lost the both of the state and level, I don't know why (bellows update, or jeedom part) Yes Jeedom is able to use custom quirk as it installs them on dependency of bellows to /usr/local/lib/python3.7/dist-packages/zhaquirks But, the main part is the lack of supporting the tuya commands, as I wrote first, setData 0x00 and sendData 0x04. It is mandatory to have them to configure the switch type installed with the plug... Some guys did some research on z2m git : https://github.com/Koenkk/zigbee2mqtt/issues/7167
@Ultraboss77
See your problem: options you'd like to have: Control Mode: Local / Remote / Local & Remote (default) Load recognize mode: None / The first Power-On (default) / Always Power-On External Switch-Type: Unknown (default) / Toggle SW / Momentary SW / Rotary SW / Auto Config
I'm not good at coding this kind of stuff.
Basic things you want is in https://github.com/zigpy/zha-device-handlers/blob/dev/zhaquirks/tuya/init.py I think the Control Stuff isn't coded (yet).
Don't Think I can help you out.
@Ultraboss77 Then you was updating was you deleting the old folder first and then adding the new one ?
If "copy" the new over the old you must deleting all the __pycache__
folders in the tree or the system can is reusing some of the old code / data and you is getting problems.
Not yet because none of the custom quirks matches my device. So I'm currently tiring to build the quirk for my device.
The first end point is one _DIMMABLELIGHT and shall being possible steering from the host system with on off and dimming commands. Its is what you is getting on out.
The rest is _LEVEL_CONTROLSWITCH = one remote with on/off and dimmer that is sending commands to the host system. The commands is coming from the input S1 and S2.
Then you have loosing the basic function on this cluster it must beings somthing strange with the host system have have / is doing like configuring reporting and binding of this cluster and that is being made in Zigpy libs on "commands" from the system over it (normally ZHA but here jeedom).
I think you shall putting one issue to jeedom for getting the basic functionality back then its looks being broken with the current Zigpy components (can being you need using one older version of Zigpy libs like bellows).
The extra function looks being very problematic implanted in the device then its more or less one "Normal tuya Zigbee device" (using Zigbee cluster for sending receiving commands) is using one tuya MCU for doing the magic and the configuration is being made with tuya DP commands that is normally only using Zigbee for tunneling tuya MQTT commands to tuya cloud) so its little complex then other tuya devices that have being supported but still possible doing if having the knowledge (i dont have it).
OK, I managed to build my own quirk, witch is recognized like that :
/usr/local/lib/python3.7/dist-packages/zhaquirks/tuya$ cat ts110f_dimmer.py
"""Tuya based touch switch."""
from zigpy.profiles import zha
from zigpy.quirks import CustomCluster, CustomDevice
from zigpy.zcl.clusters.general import Basic, Groups, OnOff, LevelControl, Ota, Scenes, Time
from zhaquirks.const import (
DEVICE_TYPE,
ENDPOINTS,
INPUT_CLUSTERS,
MODELS_INFO,
OUTPUT_CLUSTERS,
PROFILE_ID,
)
from zhaquirks.tuya import (
TuyaLevelControl,
TuyaManufacturerClusterOnOff,
TuyaManufacturerLevelControl,
TuyaOnOff,
TuyaNewManufCluster,
)
class TuyaSingleInWallDimmer(CustomDevice):
"""Tuya in-wall dimmer switch device."""
signature = {
# "node_descriptor": "<NodeDescriptor byte1=1, byte2=64, mac_capability_flags=142, manufacturer_code=4098,
# maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264,
# maximum_outgoing_transfer_size=82, descriptor_capability_field=0>",
# <SimpleDescriptor endpoint=1 profile=260 device_type=51 device_version=1 input_clusters=[0, 4, 5, 61184] output_clusters=[10, 25]>
MODELS_INFO: [
("_TZ3210_lfbz816s", "TS110F"),
],
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.DIMMABLE_LIGHT,
INPUT_CLUSTERS: [
Basic.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
OnOff.cluster_id,
LevelControl.cluster_id,
TuyaNewManufCluster.cluster_id,
0xFD02,
],
OUTPUT_CLUSTERS: [Ota.cluster_id, Time.cluster_id],
},
2: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.LEVEL_CONTROL_SWITCH,
INPUT_CLUSTERS: [],
OUTPUT_CLUSTERS: [OnOff.cluster_id, LevelControl.cluster_id],
},
3: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.LEVEL_CONTROL_SWITCH,
INPUT_CLUSTERS: [],
OUTPUT_CLUSTERS: [OnOff.cluster_id, LevelControl.cluster_id],
},
},
}
replacement = {
ENDPOINTS: {
1: {
DEVICE_TYPE: zha.DeviceType.DIMMABLE_LIGHT,
INPUT_CLUSTERS: [
Basic.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
OnOff.cluster_id,
LevelControl.cluster_id,
TuyaNewManufCluster.cluster_id,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
},
2: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.LEVEL_CONTROL_SWITCH,
INPUT_CLUSTERS: [],
OUTPUT_CLUSTERS: [OnOff.cluster_id, LevelControl.cluster_id],
},
3: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.LEVEL_CONTROL_SWITCH,
INPUT_CLUSTERS: [],
OUTPUT_CLUSTERS: [OnOff.cluster_id, LevelControl.cluster_id],
},
}
}
I removed the cluster 0xFD02 as I don't know what it is used for. I looked into all tuya classes in init.py, but I'm not sure witch one I should use ??
From restart of zigpy, I grab some infos from the device :
[2021-10-28 23:36:11][DEBUG] : [0x000c:1:0x0000] Attribute id: 4 value: _TZ3210_lfbz816s
[2021-10-28 23:36:11][DEBUG] : [0x000c:1:0x0000] Attribute id: 5 value: TS110F
[2021-10-28 23:36:11][DEBUG] : [0x000c:1:0x0000] Attribute id: 0 value: 3
[2021-10-28 23:36:11][DEBUG] : [0x000c:1:0x0000] Attribute id: 1 value: 80
[2021-10-28 23:36:11][DEBUG] : [0x000c:1:0x0000] Attribute id: 2 value: 0
[2021-10-28 23:36:11][DEBUG] : [0x000c:1:0x0000] Attribute id: 3 value: 1
[2021-10-28 23:36:11][DEBUG] : [0x000c:1:0x0000] Attribute id: 7 value: 1
[2021-10-28 23:36:11][DEBUG] : [0x000c:1:0x0000] Attribute id: 6 value:
[2021-10-28 23:36:11][DEBUG] : [0x000c:1:0x0006] Attribute id: 0 value: 0
[2021-10-28 23:36:11][DEBUG] : [0x000c:1:0x0008] Attribute id: 0 value: 0
[2021-10-28 23:36:11][DEBUG] : [0x000c:1:0xef00] Attribute id: 4 value: 146
[2021-10-28 23:36:11][DEBUG] : [0x000c:1:0xef00] Attribute id: 5 value: 179
[2021-10-28 23:36:11][DEBUG] : [0x000c:1:0xef00] Attribute id: 1 value: 3
[2021-10-28 23:36:11][DEBUG] : [0x000c:1:0xef00] Attribute id: 2 value: 3
[2021-10-28 23:36:11][DEBUG] : [0x000c:1:0xef00] Attribute id: 3 value: 1
[2021-10-28 23:36:11][DEBUG] : [0x000c:1:0xef00] Attribute id: 11 value: 0
[2021-10-28 23:36:11][DEBUG] : [0x000c:1:0xef00] Attribute id: 8 value: 1
[2021-10-28 23:36:11][DEBUG] : [0x000c:1:0xef00] Attribute id: 6 value: 0
[2021-10-28 23:36:11][DEBUG] : [0x000c:1:0xef00] Attribute id: 7 value: 0
[2021-10-28 23:36:11][DEBUG] : [0x000c:1:0xef00] Attribute id: 9 value: 3
[2021-10-28 23:36:11][DEBUG] : [0x000c:1:0xef00] Attribute id: 10 value: 1
[2021-10-28 23:36:11][DEBUG] : [0x000c:1:0xfd02] Attribute id: 1 value: 0
Great !! Can you controlling the "light" from your host system and getting status back the you is doing changes on the device ?
Unfortunately, it does not work better. I have some question about the different kind of classes there are in tuya init.py (I'm not friendly with python but it is quite simple to read). Which class should I use to define my TuyaSingleInWallDimmer ?? Also which one should I put to replacement part ??
I have tried different combinaison but nothing really change about reporting tuya specific values :(
I think looking on the https://github.com/zigpy/zha-device-handlers/blob/fed86ddf7adfca94fba087872c4c1156849fca47/zhaquirks/tuya/ts0601_dimmer.py#L55-L68 can being somthing but i think your device is only using the tuyaDP for configuring but it can being that is using both "normal Zigbee" and tuyaDP for sending commands but i dint knowing. If you is putting in the https://github.com/zigpy/zha-device-handlers/blob/fed86ddf7adfca94fba087872c4c1156849fca47/zhaquirks/tuya/ts0601_dimmer.py#L48 shall the quirk "decoding" the DPs and you can see then (also taking the power of the device and putting it back after one minute is normally making the tuya MCU sending all commands to its using). But i dont knowing if you shall using the "normal" OnOff cluster or the new "DP" one for getting the command from the switch. The normal shall being possible binding if all is working OK and the DP is not possible then its all made in the software side and is not normal commands in the Zigbee network.
The strange thing is that you have loosing the "normal" Zigbee function (onOff dim function on cluster 6 and 8) that was working before that i finding strange and bad.
I must doing more testing of my broken IKEA controllers that have loosing there group binding and getting one working way for user getting them recovered.
I have just bought a Silvercrest (Lidl) gateway to setup this device. I noticed that the device was in not normal status, as the led was blinking slowly. Re-pairing it with Jeedom bring me back the normal behavior ! So I would continue trying to build a quirk for it !!
One of the key things is being implanted in this PR https://github.com/zigpy/zha-device-handlers/pull/1153 but then its in place its need more for implanting the command you is needing for congratulating the switch bur its looks like the user that is doing the implantation like getting all other function dome but its takes some time getting all right and not braking all devices that is working in our system.
Its one more user that have one "hybrid" device like you and also need this things being put in the right place.
Thanks for sharing the info, I will follow this work and test when possible 😀
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.
Describe the solution you'd like I'm looking for the support of this tuya device with new commands setData 0x00 and sendData 0x04 but for zigpy/bellows
Device signature - this can be acquired by removing the device from ZHA and pairing it again from the add devices screen. Be sure to add the entire content of the log panel after pairing the device to a code block below this line.