Z2M seems to have made quite a few changes to how external converters work
I’m still googling and trying to learn since that folder does not exist
opened 04:45PM - 04 Jan 25 UTC
closed 01:04PM - 17 Jan 25 UTC
problem
### What happened?
After updating to version 2,0, my external converter for a t… uya blind motor failed to load.
### What did you expect to happen?
When can i load external converter again?
### How to reproduce it (minimal and precise)
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 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: '_TZE200_xtrnjaoz',
},
],
model: 'TS0601_blinds',
vendor: 'TuYa',
description: 'Blinds motor',
fromZigbee: [tuya.fz.datapoints],
toZigbee: [tuya.tz.datapoints],
configure: tuya.configureMagicPacket,
options: [exposes.options.invert_cover()],
exposes: [
e.cover_position().setAccess('position', ea.STATE_SET),
e.enum('reverse_direction', ea.STATE_SET, ['true', 'false'])
.withDescription('Reverse the motor direction'),
e.binary('motor_fault', ea.STATE, true, false),
],
meta: {
tuyaDatapoints: [
[1, 'state', tuya.valueConverterBasic.lookup({'OPEN': tuya.enum(0), 'STOP': tuya.enum(1), 'CLOSE': tuya.enum(2)})],
[9, 'position', tuya.valueConverter.coverPositionInverted],
[8, 'position', tuya.valueConverter.raw],
[11, 'reverse_direction', tuya.valueConverterBasic.lookup({'true': tuya.enum(0), 'false': tuya.enum(1)})],
[10, 'motor_fault', tuya.valueConverter.trueFalse1],
],
},
};
module.exports = definition;
### Zigbee2MQTT version
2.0
### Adapter firmware version
7.4.2 [GA]
### Adapter
EmberZNet
### Setup
Add-on on home assistant
### Debug log
_No response_
Edit: I think I can copy the code from the updated converter and create my own external converter for the device?
model: 'ZG-205Z/A',
vendor: 'Tuya',
description: '5.8Ghz/24Ghz Human presence sensor',
fromZigbee: [tuya.fz.datapoints],
toZigbee: [tuya.tz.datapoints],
exposes: [
e.presence(),
e.illuminance().withUnit('lx'),
e
.numeric('large_motion_detection_sensitivity', ea.STATE_SET)
.withValueMin(0)
.withValueMax(10)
.withValueStep(1)
.withUnit('x')
.withDescription('Motion detection sensitivity'),
e
.numeric('large_motion_detection_distance', ea.STATE_SET)
.withValueMin(0)
.withValueMax(10)
.withValueStep(0.01)
.withUnit('m')
.withDescription('Motion detection distance'),
e.enum('motion_state', ea.STATE, ['none', 'small', 'medium', 'large', 'huge', 'gigantic']).withDescription('State of the motion'),
e
.numeric('fading_time', ea.STATE_SET)
.withValueMin(0)
.withValueMax(28800)
.withValueStep(1)
.withUnit('s')
.withDescription('For how much time presence should stay true after detecting it'),
e
.numeric('medium_motion_detection_distance', ea.STATE_SET)
.withValueMin(0)
.withValueMax(6)
.withValueStep(0.01)
.withUnit('m')
.withDescription('Medium motion detection distance'),
e
.numeric('medium_motion_detection_sensitivity', ea.STATE_SET)
.withValueMin(0)
.withValueMax(10)
.withValueStep(1)
.withUnit('x')
.withDescription('Medium motion detection sensitivity'),
e.binary('indicator', ea.STATE_SET, 'ON', 'OFF').withDescription('LED Indicator'),
e
.numeric('small_detection_distance', ea.STATE_SET)
.withValueMin(0)
.withValueMax(6)
.withValueStep(0.01)
.withUnit('m')
.withDescription('Small detection distance'),
e
.numeric('small_detection_sensitivity', ea.STATE_SET)
.withValueMin(0)
.withValueMax(10)
.withValueStep(1)
.withUnit('x')
.withDescription('Small detection sensitivity'),
],
meta: {
tuyaDatapoints: [
[1, 'presence', tuya.valueConverter.trueFalse1],
[2, 'large_motion_detection_sensitivity', tuya.valueConverter.raw],
[4, 'large_motion_detection_distance', tuya.valueConverter.divideBy100],
[
101,
'motion_state',
tuya.valueConverterBasic.lookup({
none: tuya.enum(0),
large: tuya.enum(1),
medium: tuya.enum(2),
small: tuya.enum(3),
huge: tuya.enum(4),
gigantic: tuya.enum(5),
}),
],
[102, 'fading_time', tuya.valueConverter.raw],
[104, 'medium_motion_detection_distance', tuya.valueConverter.divideBy100],
[105, 'medium_motion_detection_sensitivity', tuya.valueConverter.raw],
[106, 'illuminance', tuya.valueConverter.raw],
[107, 'indicator', tuya.valueConverter.onOff],
[108, 'small_detection_distance', tuya.valueConverter.divideBy100],
[109, 'small_detection_sensitivity', tuya.valueConverter.raw],
// Not exposed DPs/untested
// [103, 'motion_false_detection', tuya.valueConverter.raw],
// [113, 'breathe_false_detection', tuya.valueConverter.raw],
// [3, 'mov_minimum_distance', tuya.valueConverter.raw],
// [110, 'micro_minimum_distance', tuya.valueConverter.raw],
// [111, 'motionless_minimum_distance', tuya.valueConverter.raw],
// [112, 'reset_setting', tuya.valueConverter.raw],
// [114, 'time', tuya.valueConverter.raw],
// [115, 'alarm_time', tuya.valueConverter.raw],
// [116, 'alarm_volume', tuya.valueConverterBasic.lookup(
// {'low': tuya.enum(0), 'medium': tuya.enum(1), 'high': tuya.enum(2), 'mute': tuya.enum(3)})],
// [117, 'working_mode', tuya.valueConverterBasic.lookup(
// {'arm': tuya.enum(0), 'off': tuya.enum(1), 'alarm': tuya.enum(2), 'doorbell': tuya.enum(3)})],
// [118, 'auto1', tuya.valueConverter.raw],
// [119, 'auto2', tuya.valueConverter.raw],
// [120, 'auto3', tuya.valueConverter.raw],
],
},
},
{
Now I just have to figure out how to create the external converter/.js file