Koenkk / zigbee2mqtt

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

[New device support]: Beok TGR85-ZB #21103

Open ckegels opened 7 months ago

ckegels commented 7 months ago

Link

https://zigbee.blakadder.com/Beok_TGR85-ZB.html

Database entry

'0xa4c138f6054453a5', type 'readResponse', cluster 'genBasic', data '{"65534":0,"appVersion":74,"manufacturerName":"_TZE204_lzriup1j","modelId":"TS0601","powerSource":1,"zclVersion":3}' from endpoint 1 with groupID 0

Comments

It seems that all configuration is allready available but that this version or revision is not added yet could somebody add it to the fingerprint in the tuya file.

i copied the lines from the tuya device in tuya.js to a js file and its working. (if you search for tgr85-ZB in tuya.js)

i hope i am making sence.

add: manufacturerName: '_TZE204_lzriup1j' to: herdsmann converters tuya file line 4389: fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_2ekuz3dz'}],

External defintion

const definition = {
    zigbeeModel: ['TS0601'],
    model: 'TS0601',
    vendor: '_TZE204_lzriup1j',
    description: 'Automatically generated definition',
    extend: [],
};

module.exports = definition;

after editing external converter:

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 = {
    // Since a lot of TuYa devices use the same modelID, but use different datapoints
    // it's necessary to provide a fingerprint instead of a zigbeeModel
    fingerprint: [
        {
            // The model ID from: Device with modelID 'TS0601' is not supported
            // You may need to add \u0000 at the end of the name in some cases
            modelID: 'TS0601',
            // The manufacturer name from: Device with modelID 'TS0601' is not supported.
            manufacturerName: '_TZE204_lzriup1j',
        },
    ],
    model: 'TGR85-ZB-EP(16A)',
    vendor: 'Beok Controls',
    description: 'Beok Controls 16A wall thermostat',
    fromZigbee: [tuya.fz.datapoints],
    toZigbee: [tuya.tz.datapoints],
    onEvent: tuya.onEventSetTime, // Add this if you are getting no converter for 'commandMcuSyncTime'
    configure: tuya.configureMagicPacket,

    exposes: [
            e.climate().withSetpoint('current_heating_setpoint', 5, 60, 0.5, ea.STATE_SET)
                .withLocalTemperature(ea.STATE).withLocalTemperatureCalibration(-9.9, 9.9, 0.1, ea.STATE_SET)
                .withSystemMode(['off', 'heat'], ea.STATE_SET).withRunningState(['idle', 'heat'], ea.STATE)
                .withPreset(['manual', 'program']),
            e.temperature_sensor_select(['internal', 'external', 'both']),
            e.text('schedule', ea.STATE_SET).withDescription('There are 8 periods in the schedule in total. ' +
                '6 for workdays and 2 for holidays. It should be set in the following format for each of the periods: ' +
                '`hours:minutes/temperature`. All periods should be set at once and delimited by the space symbol. ' +
                'For example: `06:00/20.5 08:00/15 11:30/15 13:30/15 17:00/22 22:00/15 06:00/20 22:00/15`. ' +
                'The thermostat doesn\'t report the schedule by itself even if you change it manually from device'),
            e.child_lock(), e.week(),
            e.enum('brightness_state', ea.STATE_SET, ['off', 'low', 'medium', 'high'])
                .withDescription('Screen brightness'),
            e.binary('sound', ea.STATE_SET, 'ON', 'OFF')
                .withDescription('Switches beep sound when interacting with thermostat'),
            e.binary('frost_protection', ea.STATE_SET, 'ON', 'OFF')
                .withDescription('Antifreeze function'),
            e.binary('factory_reset', ea.STATE_SET, 'ON', 'OFF')
                .withDescription('Resets all settings to default. Doesn\'t unpair device.'),
            e.numeric('heating_temp_limit', ea.STATE_SET).withUnit('°C').withValueMax(60)
                .withValueMin(5).withValueStep(1).withPreset('default', 35, 'Default value')
                .withDescription('Heating temperature limit'),
            e.numeric('deadzone_temperature', ea.STATE_SET).withUnit('°C').withValueMax(9.5)
                .withValueMin(0.5).withValueStep(0.5).withPreset('default', 1, 'Default value')
                .withDescription('The delta between local_temperature and current_heating_setpoint to trigger Heat'),
            e.numeric('upper_temp', ea.STATE_SET).withUnit('°C').withValueMax(95)
                .withValueMin(35).withValueStep(1).withPreset('default', 60, 'Default value'),
        ],
        onEvent: tuya.onEventSetTime,
    meta: {
        tuyaDatapoints: [
            [1, 'system_mode', tuya.valueConverterBasic.lookup({'heat': true, 'off': false})],
            [2, 'current_heating_setpoint', tuya.valueConverter.divideBy10],
            [3, 'local_temperature', tuya.valueConverter.divideBy10],
            [4, 'preset', tuya.valueConverterBasic.lookup({'auto': tuya.enum(1), 'manual': tuya.enum(0), 'temporary_manual': tuya.enum(2)})],
            [9, 'child_lock', tuya.valueConverter.lockUnlock],
            [11, 'faultalarm', tuya.valueConverter.raw],
            [15, 'max_temperature_limit', tuya.valueConverter.divideBy10],
            [19, 'local_temperature_calibration', tuya.valueConverter.localTempCalibration3],
            [101, 'running_state', tuya.valueConverterBasic.lookup({'heat': tuya.enum(1), 'idle': tuya.enum(0)})],
            [102, 'frost_protection', tuya.valueConverter.onOff],
            [103, 'factory_reset', tuya.valueConverter.onOff],
            [104, 'working_day', tuya.valueConverter.workingDay],
            [106, 'sensor', tuya.valueConverterBasic.lookup({'internal': tuya.enum(0), 'external': tuya.enum(1), 'both': tuya.enum(2)})],
            [107, 'deadzone_temperature', tuya.valueConverter.divideBy10],
            [109, null, tuya.valueConverter.ZWT198_schedule],
            [109, 'schedule_weekday', tuya.valueConverter.ZWT198_schedule],
            [109, 'schedule_holiday', tuya.valueConverter.ZWT198_schedule],
            [110, 'backlight_mode', tuya.valueConverter.backlightModeOffLowMediumHigh],

            // These are the schedule values in bytes, 8 periods in total (4 bytes per period).
            // For each period:
            // 1st byte: hour
            // 2nd byte: minute
            // 3rd, 4th bytes: temperature multiplied by 10
            // On the device last 2 periods are ignored if schedule_mode is 7day. When schedule_mode is disabled,
            // scheduling can't be configured at all on the device.
            // For example, if schedule_mode is weekday/sat+sun and this byte array is received:
            // [6,10,1,144,8,10,0,170,11,40,0,170,12,40,0,170,17,10,0,230,22,10,0,170,8,5,0,200,23,0,0,160]
            // Then the schedule is:
            // Mon-Fri: 6:10 --> 40C, 8:10 --> 17C, 11:40 --> 17C, 12:40 --> 17C, 17:10 --> 23C, 22:10 --> 17C
            // Sat-Sun: 8:05 --> 20C, 23:00 --> 16C
        ],
    },
};

module.exports = definition;
apedance commented 6 months ago

I have the same device. My biggest problem is that the time is not synced correctly. It is totally off and I can't figure out how to adjust it.

github-actions[bot] commented 2 weeks 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