I can't seem to be able to set up a custom ZHA quirk. It just won't recognize it

Hi.

So i followed guide on how to add custom quirks - creating custom zha quirks folder in /config and point to it in HA configuration.yaml.

I can’t get a TS0043 switch working, no matter what i do, whather i add custom quirk or not, there are always same quirks in pairing that are considered, but there is an endpoint mismatch in all those. I have HA installed in docker.

I can remove custom quirks path and file or set it up, the logs are always the same. Where does ZHA take this data, where are official quirks located in HA 2022.10.4? Why won’t it check my custom quirk?

The logs regarding quirks are always as follows:

Checking quirks for _TZ3000_uyjmm0et TS0043 (a4:c1:38:37:fd:cc:04:58)
Considering <class ‘zhaquirks.tuya.ts0043.TuyaSmartRemote0043TOPlusB’>
Fail because endpoint list mismatch: {1, 2, 3} {1, 2, 3, 4}
Considering <class ‘zhaquirks.tuya.ts0043.TuyaSmartRemote0043TO’>
Fail because endpoint list mismatch: {1, 2, 3} {1, 2, 3, 4}
Considering <class ‘zhaquirks.tuya.ts0043.TuyaSmartRemote0043TI’>
Fail because endpoint list mismatch: {1, 2, 3} {1, 2, 3, 4}
Considering <class ‘zhaquirks.xiaomi.aqara.opple_switch.XiaomiOpple2ButtonSwitchFace2’>
Fail because endpoint list mismatch: {1, 2, 242} {1, 2, 3, 4}
Considering <class ‘zhaquirks.xiaomi.aqara.opple_switch.XiaomiOpple2ButtonSwitchFace1’>
Fail because endpoint list mismatch: {1, 2, 41, 42, 242, 51, 21, 31} {1, 2, 3, 4}
Considering <class ‘zhaquirks.xbee.xbee_io.XBeeSensor’>
Fail because endpoint list mismatch: {232, 230} {1, 2, 3, 4}
Considering <class ‘zhaquirks.xbee.xbee3_io.XBee3Sensor’>
Fail because endpoint list mismatch: {232, 230} {1, 2, 3, 4}
Considering <class ‘zhaquirks.tuya.ts0201.MoesTemperatureHumidtySensorWithScreen’>
Fail because endpoint list mismatch: {1} {1, 2, 3, 4}
Considering <class ‘zhaquirks.smartthings.tag_v4.SmartThingsTagV4’>
Fail because endpoint list mismatch: {1} {1, 2, 3, 4}
Considering <class ‘zhaquirks.smartthings.multi.SmartthingsMultiPurposeSensor’>
Fail because endpoint list mismatch: {1} {1, 2, 3, 4}
Considering <class ‘zhaquirks.netvox.z308e3ed.Z308E3ED’>
Fail because endpoint list mismatch: {1} {1, 2, 3, 4}
Considering <class ‘zhaquirks.gledopto.soposhgu10.SoposhGU10’>
Fail because endpoint list mismatch: {11, 13} {1, 2, 3, 4}

In my configuration.yaml i have:
zha:
enable_quirks: true
custom_quirks_path: /config/custom_zha_quirks/

Anyway i made this thread to figure out how to setup custom quirks and make them work in ZHA. I tryed many different steps i found. Tryed removing device, restarting HA after setting custom quirk there and then adding device again. I always get the same logs as above… If anyone could also help with TS0043 switch i made a thread about it:

I have no programming skills and would really like to get this switch working… :slight_smile:

If you are using Home Assistant core in a Docker container then probably need to map storage volumes via Docker-Compose, (which is not something I not done myself nor am I any good with Docker or Podman containers), and mapping a storage volume for custom_quirks_path in Docker-Compose is not specifically mentioned in the ZHA integration documentation under its troubleshooting section, however, it probably should be documented there, (but maybe you can contribute that to ZHA docs after you get it working?), see example:

https://www.home-assistant.io/integrations/zha#cant-connect-to-usb-device-and-using-docker

https://github.com/home-assistant/home-assistant.io/blob/d220c19a36e8083b2123f4e9bdd38ecd31c19e03/source/_integrations/zha.markdown

Then try to figure it out, reading up on Docker-Compose and how to define/use storage volumes, read:

https://docs.docker.com/storage/volumes/

https://earthly.dev/blog/docker-volumes/

https://devopsheaven.com/docker/docker-compose/volumes/2018/01/16/volumes-in-docker-compose.html

Hopefully, such information would be accepted in an edit pull request and not rejected like this one:

https://github.com/home-assistant/home-assistant.io/pull/23884

Here is by the way what looks to be a discussion about editing or adding ZHA quirks in a container or local → https://github.com/zigpy/zha-device-handlers/discussions/693

Ok thanks.

I’m went trying this method with suplemon now, so i managed to get into configuration.yaml, which is not the same as i was editing all the time at /etc/homeassistant/configuration.yaml. However some things i added did work. How is that?

Now as i added lines for custom quirks i couldn’t restart HA, saying there is no zhaquirks(I changed the name) directory in /config, as i have it in /etc/homeassistant/zhaquirks.

So we are half way there. How do i create a folder and copy quirk there in /config? Can’t seem to find anythink useful so far…

I managed to get it working. However not with the quirk for TS0043, but rather TS0044 with a change of model to TS0043, as i’ve seen in one post yesterday looking all around how to solve this.

Probably my config folder /etc/homeassistant was mounted before but not anymore. I may reinstall things or whatnot i don’t know. So what i did, i removed HA container in Portainer - Should have just cloned it, but luckly i have 2 instances so i cloned another one as i removed it and at advanced settings in Portainer, there is an option to mount container to host when creating container. It can also be done via Docker-compose, as i’ve seen in some guides. So i just mounted /config to /etc/homeassistant and restarted.

After that the switch started working, without removing it and re-pairing. However the quirk i had there was modified TS0044 quirk, as i’ve seen in one post someone solved it this way. Only change was Model from TS0044 to TS0043. I did however try the quirk for TS0043, but then nothing worked again.

So i will just use quirk for TS0044 as it works great. Single, double, long press it all works.

I think that the firmware of switch is for 4 gang switch not 3gang, idk, I’m newbie in all this…

Nice, be sure to contribute any device-specific feedback or input to ZHA Device Handlers if you have it:

https://github.com/zigpy/zha-device-handlers/issues

https://github.com/zigpy/zha-device-handlers/discussions