Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
11.92k stars 1.66k forks source link

External Convertor of Water Meter exposes missing after update to1.36-1.1 #22080

Open tzeryin1981 opened 6 months ago

tzeryin1981 commented 6 months ago

What happened?

Exposes become empty after upgrade to 1.36-1.1

const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const extend = require('zigbee-herdsman-converters/lib/extend');
const e = exposes.presets;
const ea = exposes.access;
const tuya = require('zigbee-herdsman-converters/lib/tuya');

const definition = {
    fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_vuwtqx0t'}],
    model: 'TS0601',
    vendor: 'TuYa',
    description: 'Water Meter and Valve',
    onEvent: tuya.onEventSetTime,
    configure: tuya.configureMagicPacket,    
    fromZigbee: [tuya.fz.datapoints],
    toZigbee: [tuya.tz.datapoints],

    exposes: [
        tuya.exposes.switch(), e.temperature(), e.battery().withUnit('V').withValueMin(0.1).withValueMax(3.8),
        exposes.text('meter_id', ea.STATE).withDescription('Meter ID (ID of device)'),
        exposes.numeric('water_meter', ea.STATE).withUnit('m3').withDescription('Total Water Comsumption'),
        exposes.numeric('daily_comsumption', ea.STATE).withUnit('m3').withDescription('Daily Water Comsumption'),
        exposes.numeric('monthly_comsumption', ea.STATE).withUnit('m3').withDescription('Monthly Water Comsumption'),
        exposes.numeric('instantaneous_flow_rate', ea.STATE).withUnit('m3').withDescription('Instantaneous Flow Rate'),
        exposes.binary('clean', ea.STATE_SET, 'ON', 'OFF'),
    ],
    meta: {
        tuyaDatapoints: [
            [13, 'state', tuya.valueConverter.onOff],
            [26, 'battery', tuya.valueConverter.divideBy100],
            [16, 'meter_id', tuya.valueConverter.raw],
            [22, 'temperature', tuya.valueConverter.divideBy100],
            [1, 'water_meter', tuya.valueConverter.divideBy1000],
            [3, 'daily_comsumption', tuya.valueConverter.divideBy100],
            [2, 'monthly_comsumption', tuya.valueConverter.divideBy100],
            [21, 'instantaneous_flow_rate', tuya.valueConverter.divideBy100],
            [14, 'clean', tuya.valueConverter.onOff],
        ],
    },
};

module.exports = definition;

What did you expect to happen?

No response

How to reproduce it (minimal and precise)

No response

Zigbee2MQTT version

1.36.1-1

Adapter firmware version

20220219

Adapter

zStack3x0

Setup

Add on Home Assistant on x86 intel pc

Debug log

No response

MrEcosse commented 6 months ago

None of my External Converters are now being picked up and used - all devices showing as unsupported. This using 1.36.1 and HA 2024.4.0

Great-Chart commented 6 months ago

There may be some clues from within #22076?

tzeryin1981 commented 6 months ago

There may be some clues from within #22076?

Ya, t works. However need to add a line for Tuya product:

const tuya = require('zigbee-herdsman-converters/lib/tuya');

Koenkk commented 6 months ago

Could you create a pull request to add out-of-the-box support for this device?

github-actions[bot] commented 3 days ago

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