Cannot get THS317-ET-TY to work

I recently purchased a THS317-ET-TY from France. It is detected in my Zigbee network as:

IEEE: 8c:65:a3:ff:fe:92:17:19
Nwk: 0x6729
Device Type: EndDevice
LQI: 138
RSSI: Unknown
Last Seen: 2024-10-15T12:22:57
Power Source: Battery or Unknown

and the ‘last seen’ tiestamp does reflect almost current time always, so it does talk to my coordinator (a SONOFF stick)

However, it only ever records a temperature ONCE when I add it, and then never again, even if I put the probe eg into the fridge etc.

Following some other threads i found here and elsewhere, I set up a ZHA quirks file (link at the bottom)

I pointed by HA installation to this file via configuration.yaml:

...
zha:
  custom_quirks_path: /config/custom_zha_quirks/tuya
...

I am not sure this path is correct, but it does not result in a error when checking the configuration. If I modify this path to one that does not exist, an error is shown, so that suggests that this path is accepted, even though the config say /config/. while in the file editor it is shown under /homeassistant

In the quirks file I found on the ‘net’, I copied one of the existing classes
to make a new one (line 162 onwards)", with the identifiers for this device:

class OWONTuyaTemperatureHumidtySensor(CustomDevice):
    """OWON Tuya  THS317-ET-TY temperature and humidity sensor."""

    signature = {
        #  <SimpleDescriptor endpoint=1 profile=260 device_type=770
        # device_version=1
        # input_clusters=[0, 1, 3, 1029, 1026, 61183]
        # output_clusters=[3, 25]>
        MODELS_INFO: [("_TZE200_iq4ygaai", "TS0201")],
        ENDPOINTS: {

However, I am not sure whether that is sufficient. I see no place in that quirks file where the other classes describing other TS201 devices are referenced/pointed to. So I hope that defining the class with the identifiers:

MODELS_INFO: [("_TZE200_iq4ygaai", "TS0201")],

is in all that is needed?

Then too, I have no idea whether what is defined in that class is correct for this device.
I am a Zigbee noob, and i don’t know what all the ‘endpoints’, ‘profile’, ‘clusters’ etc all refer to.

To get some more info on the actual device I have, I turned on Zigbee debugging info (also link at the bottom) , but that too is way to cryptic to me…

The device is shown (line 210).

a few points from that

  1. it shows
    "quirk_applied": false,
    "quirk_class": "zigpy.device.Device",
    "quirk_id": null,

so I gather that the quirks were not used. Not sure whether it simply didn’t find the file, or nothing in it was found to apply to this device?

SO some questions:
a) what do i need to define to make ZHA apply the quirks file
b) what do I need to define in the quirks file for this specific device to make it report temperature data correctly?
c) is there anything else i need to do?
d) any other help appreciated

The files (debuuging info and the quirks file) are here: HomeAssistant

I tried the steps in Tuya TS0201 temperature sensor - #28 by dmircea but while i can read the temperature that way, it does not make the device report any temp change until the button is pressed and I execute the ‘read attribute’.

The TY version is specifically made for the Tuya bridge. For ZHA you need the THS317-ET version. Not sure if the quirk can fix the Tuya version, or you maybe can flash different firmware

Do you have a pointer on how to find the firmware and how to flash it?

No, I just noted the difference while considering a purchase myself
Maybe domadoo can assist you: https://www.domadoo.fr

I’ve got two THS317-ET temperature sensors monitoring my hot water tank, and both went offline at the same time today. Up until this point, they’ve worked flawlessly for weeks, without the need for a quirk (I use ZHA)

I’ve re-paired them to my sonoff stick multiple times (which works if you reset them first by pressing the button down for 10 seconds).

They both then connect to HA fine and show as connected and report a temperature. However, they never report anything again after that. Up until they went offline, they regularly reported temperatures every 5 minutes without fail.

Also, neither device seems to be reporting their LQI values, but initially show as around 120ish.

I’ve managed to get mine working again, but simply re-pairing wasn’t enough. I had to totally remove the devices from ZHA first, the re-add them and enable LQI. (I enable LQI anyway for monitoring, so this might not be required, although threads suggest it is)