DTH for eWeLink RHK08 Temp/Humidity Sensor - going offline

Hi I have some Australian branded Cygnett Home Temp/Humidity Sensors which are actually eWeLink RHK08 devices. Using a modified version of the SmartSense Temp/Humidity Sensor DTH to utilise the 0x0402 and 0x0405 cluster IDs I can get them to work . However, I’m struggling with the checkInterval/Reporting settings to make sure they regularly report (e.g. hourly) but don’t keep going offline in ST. They seem to wake up again after a few hours, give a reading and then go offline again.
Any ideas on how to tune this to get them reporting more consistently?

DTH extract:
def configure() {
sendEvent(name: “checkInterval”, value: 2 * 3600 + 1 * 60, displayed: false, data: [protocol: “zigbee”, hubHardwareId: device.hub.hardwareID, offlinePingable: “1”])

return refresh() +
zigbee.temperatureConfig(30, 3600) +
zigbee.configureReporting(zigbee.POWER_CONFIGURATION_CLUSTER, 0x0021, DataType.UINT8, 3600, 21600, 0x10) +
zigbee.configureReporting(0x0405, 0x0000, DataType.UINT16, 30, 3600, 100, [destEndpoint: 0x01])

within parse for temp:
sendEvent(name: “checkInterval”, value: 15 * 60, displayed: false, data: [protocol: “zigbee”, hubHardwareId: device.hub.hardwareID, offlinePingable: “1”])

Below is an example log from pairing:

04/20/2020 06:55:22 eWeLink RHK08 battery 100 100
04/20/2020 06:55:24 eWeLink RHK08 temperature 22 22 C
04/20/2020 06:55:26 eWeLink RHK08 humidity 71 71 %
04/20/2020 06:55:48 eWeLink RHK08 humidity 72 72
04/20/2020 06:59:38 eWeLink RHK08 humidity 73 73
04/20/2020 06:59:38 eWeLink RHK08 temperature 21 21 C
04/20/2020 07:12:00 eWeLink RHK08 humidity 76 76
04/20/2020 07:12:00 eWeLink RHK08 temperature 20 20 C
04/20/2020 07:28:03 eWeLink RHK08 activity offline offline
04/20/2020 08:12:01 eWeLink RHK08 humidity 78 78
04/20/2020 08:12:02 eWeLink RHK08 activity online online
04/20/2020 08:28:15 eWeLink RHK08 activity offline offline
04/20/2020 09:12:03 eWeLink RHK08 activity online online
04/20/2020 09:12:03 eWeLink RHK08 humidity 76 76
04/20/2020 09:28:06 eWeLink RHK08 activity offline offline
04/20/2020 10:12:04 eWeLink RHK08 humidity 77 77
04/20/2020 10:12:05 eWeLink RHK08 activity online online
04/20/2020 10:28:17 eWeLink RHK08 activity offline offline
04/20/2020 11:12:06 eWeLink RHK08 activity online online
04/20/2020 11:12:06 eWeLink RHK08 humidity 78 78
04/20/2020 11:28:07 eWeLink RHK08 activity offline offline
04/20/2020 12:12:08 eWeLink RHK08 activity online online
04/20/2020 12:28:19 eWeLink RHK08 activity offline offline
04/20/2020 12:57:37 eWeLink RHK08 activity online online
04/20/2020 13:28:12 eWeLink RHK08 activity offline offline
04/20/2020 14:12:10 eWeLink RHK08 humidity 77 77
04/20/2020 14:12:11 eWeLink RHK08 activity online online
04/20/2020 14:29:22 eWeLink RHK08 activity offline offline
04/20/2020 15:12:11 eWeLink RHK08 humidity 71 71
04/20/2020 15:12:12 eWeLink RHK08 activity online online
04/20/2020 15:28:15 eWeLink RHK08 activity offline offline
04/20/2020 16:12:13 eWeLink RHK08 temperature 19 19 C
04/20/2020 16:12:14 eWeLink RHK08 activity online online
04/20/2020 16:28:28 eWeLink RHK08 activity offline offline
04/20/2020 17:12:15 eWeLink RHK08 activity online online
04/20/2020 17:12:15 eWeLink RHK08 humidity 75 75
04/20/2020 17:12:15 eWeLink RHK08 temperature 20 20 C
04/20/2020 17:28:21 eWeLink RHK08 activity offline offline
04/20/2020 18:12:16 eWeLink RHK08 humidity 73 73
04/20/2020 18:12:17 eWeLink RHK08 activity online online
04/20/2020 18:29:03 eWeLink RHK08 activity offline offline
04/20/2020 18:58:01 eWeLink RHK08 activity online online
04/20/2020 19:12:18 eWeLink RHK08 humidity 76 76
04/20/2020 19:30:19 eWeLink RHK08 activity offline offline
04/20/2020 20:12:20 eWeLink RHK08 humidity 75 75
04/20/2020 20:18:13 eWeLink RHK08 activity online online

I’m making assumptions on these since I don’t have one to test with, but you could change the reporting times, and the reportable change parts of the reporting commands to this:

zigbee.configureReporting(0x0405, 0x0000, DataType.UINT16, 0, 900, 100, [destEndpoint: 0x01])

and

zigbee.temperatureConfig(30, 600)
or
zigbee.configureReporting(0x0402, 0x0000, 0x29, 30, 600, 300) //temperature min: 30sec, max:10min, minimum change: 3.0C
or
zigbee.configureReporting(0x0402, 0x0000, 0x29, 30, 600, 100)

I’m not sure if the second one needs the destination endpoint, but if they’re both 0x01, then you technically don’t need that part of the command.

If you make those changes, just be sure to force a new configuration, and/or swap to some other DTH and then back to yours to kick off a config cycle.

Documentation:
https://docs.smartthings.com/en/latest/ref-docs/zigbee-ref.html