zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

Tuya IH-K009 do not send battery information

Open Synochy opened this issue 11 months ago • 6 comments

What happened?

I paired my Tuya IH-K009 with Zigbee2MQTT and all the information appears but not the battery and voltage information

What did you expect to happen?

Be able to have the battery % information

How to reproduce it (minimal and precise)

No response

Zigbee2MQTT version

1.42.0-2

Adapter firmware version

7.4.5 [GA]

Adapter

Sonoff_Zigbee_3.0_USB_Dongle_Plus_V2 (with last firmware)

Setup

Add-on HA on orangepi 5B. Supervised version of HA

Debug log

No response

Synochy avatar Dec 05 '24 23:12 Synochy

I see the same behaviour with Tuya IH-K009 ( the rectangular ones powered by 2*AAA )

mainTAP avatar Jan 08 '25 11:01 mainTAP

Facing the same behavior... Temp, Humidity, signal strength are ok, but the voltage and battery level..

flogistone avatar Jan 15 '25 19:01 flogistone

same behaviour

willmann avatar Feb 09 '25 00:02 willmann

I encounter the same behavior on my side

adelinchristian avatar Feb 18 '25 09:02 adelinchristian

Same thing, 2 out of 3 IH-K009 sensors are not reporting battery readings.

gyzod avatar Mar 17 '25 15:03 gyzod

Same problem using H-K009. Below a publish message in mqtt : { "battery": null, "humidity": 46.76, "last_seen": "2025-03-19T17:50:46+02:00", "linkquality": 172, "temperature": 19.23, "voltage": null }

djsakisd avatar Mar 19 '25 15:03 djsakisd

still the same issue , and I see battery is not under device

{ "last_seen": "2025-03-27T08:53:40+01:00", "battery": null, "device": { "applicationVersion": 70, "dateCode": "", "friendlyName": "Temperature05_Disponible", "hardwareVersion": 1, "ieeeAddr": "xxxxxx, "manufacturerID": 4417, "manufacturerName": "_TZ3000_dowj6gyi", "model": "IH-K009", "networkAddress": 20640, "powerSource": "Battery", "stackVersion": 0, "type": "EndDevice", "zclVersion": 3 }, "humidity": 54.1, "linkquality": 21, "temperature": 22.6, "voltage": null }

BePalm2022 avatar Mar 27 '25 08:03 BePalm2022

any updates on this?

dia986 avatar May 07 '25 17:05 dia986

No still waiting

Synochy avatar May 13 '25 06:05 Synochy

solved by connecting to the master ZB dongle again , then place it to the place where it send the data over the slave ZB dongle....not very convenient but worked for me now

BePalm2022 avatar May 13 '25 07:05 BePalm2022

For me there is only one router (the coordinator) in the network, still, all 15 sensors do not send battery info. Running z2m 2.3.0

Soukyuu avatar May 31 '25 22:05 Soukyuu

This is definitely a z2m bug. I have switched to ZHA keeping the network (had to confirm that settings have changed) and waited until the sensors sent a new message to show up in ZHA and:

Image

Soukyuu avatar Jun 01 '25 09:06 Soukyuu

Looking at tuya.ts in current code, it seems that the configure function only configures the tuya magic packet for this sensor, whereas some other TS0201 fingerprints also configure the reporting of the genPowerCfg cluster. Maybe that's what missing, @Koenkk?

Soukyuu avatar Jun 01 '25 10:06 Soukyuu

So I did the following binding:

Image

and pressed the reset switch on the sensor within the 10 seconds after clicking on "connect" - the binding was successfully set up and the sensor now shows the battery information:

Image

Usually it fails because the sensor is in sleep state so the binding request times out. In any case, it seems that the binding is required for the sensor to report battery info.

I attempted to make a custom converter and it kind of seems to be working, but it is still complaining about endpoint 19 not being available on re-configuring the device. Still, battery is now shown for those that I reconfigured. Maybe someone with more knowledge can refine this:

import {temperature, humidity, battery} from 'zigbee-herdsman-converters/lib/modernExtend';

export default {
    fingerprint: [
            ...tuya.fingerprint("TS0201", ["_TZ3000_dowj6gyi", "_TZ3000_8ybe88nf", "_TZ3000_akqdg6g7"]),
            {manufacturerName: "_TZ3000_zl1kmjqx"},
        ],
        model: "IH-K009",
        vendor: "Tuya",
        description: "Temperature & humidity sensor",
        fromZigbee: [fzLocal.TS0201_battery, fz.temperature, fz.humidity],
        toZigbee: [],
        exposes: [e.battery(), e.temperature(), e.humidity(), e.battery_voltage()],
        configure: async (device, coordinatorEndpoint) => {
            const endpoint = device.getEndpoint(1);
            // Enables reporting of measurement state changes
            await tuya.configureMagicPacket(device, coordinatorEndpoint);
            await reporting.bind(endpoint, coordinatorEndpoint, [
                "genBasic",
                "genPowerCfg",
                "msTemperatureMeasurement",
                "msRelativeHumidity",
                "manuSpecificTuya_2",
            ]);
        },
        whiteLabel: [tuya.whitelabel("Tuya", "RSH-HS06_1", "Temperature & humidity sensor", ["_TZ3000_zl1kmjqx"])],
};

Soukyuu avatar Jun 01 '25 16:06 Soukyuu

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] avatar Aug 01 '25 00:08 github-actions[bot]

Can you implement the modification of @Soukyuu in order to close the issue ?

Synochy avatar Aug 04 '25 13:08 Synochy

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] avatar Oct 05 '25 00:10 github-actions[bot]

Unstale

Soukyuu avatar Oct 05 '25 07:10 Soukyuu

Integrated the fix.

Changes will be available in the dev branch tomorrow and in the next release which is every 1st of the month.

Koenkk avatar Oct 05 '25 13:10 Koenkk