Giter VIP home page Giter VIP logo

Comments (7)

true9741 avatar true9741 commented on August 16, 2024

Hi @Koenkk, the same happens to me, I am developing a converter for Smart Circuit breaker TOQCB2-80.
In the log appears the following message:

error 2024-04-02 10:12:31: Failed to load external converter file 'toqcb2_80.js' (Cannot find module 'zigbee-herdsman-converters/lib/extend'
Require stack:
- /app/dist/util/utils.js
- /app/dist/util/settings.js
- /app/index.js)
error 2024-04-02 10:12:31: Probably there is a syntax error in the file or the external converter is not compatible with the current Zigbee2MQTT version
error 2024-04-02 10:12:31: Note that external converters are not meant for long term usage, it's meant for local testing after which a pull request should be created to add out-of-the-box s>

I think the problem is in the following line of the converters:

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

I have checked that this file extend is not longer present in the lib folder of your source repository.

thank you.

from zigbee-herdsman-converters.

true9741 avatar true9741 commented on August 16, 2024

Hi Sorry @Koenkk, Problem solved removing the line

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

I imagine is not longer needed.

Sorry for disturb you.

from zigbee-herdsman-converters.

Killi77 avatar Killi77 commented on August 16, 2024

@true9741 :) You are treasure! You came to this discussion as a gift for me :) I'm not that skilled IT and don't know how you figured it out but it works for me as well!
Thank you so much.
Issue closed.
@Koenkk I'm still adjusting the converter for _TZE200_g5xqosu7. Want to make sure it'll adapt all features. Once I'm done and convinced all is OK I'll let you post you the file so you can release it.
Thank you.

from zigbee-herdsman-converters.

Koenkk avatar Koenkk commented on August 16, 2024

Good that you found the issue, please make a PR to add out-of-the-box support for these devices ๐Ÿ˜„

from zigbee-herdsman-converters.

Killi77 avatar Killi77 commented on August 16, 2024

@true9741 :) You are treasure! You came to this discussion as a gift for me :) I'm not that skilled IT and don't know how you figured it out but it works for me as well!
Thank you so much.
Issue closed.
@Koenkk I'm still adjusting the converter for _TZE200_g5xqosu7. Want to make sure it'll adapt all features. Once I'm done and convinced all is OK I'll let you post you the file so you can release it.
Thank you.

from zigbee-herdsman-converters.

Killi77 avatar Killi77 commented on August 16, 2024

@Koenkk this is the final converter that woks with _TZE200_g5xqosu7 curtain motor

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_g5xqosu7',
},
],
model: 'TS0601_new',
vendor: 'TuYa',
description: 'Cover motors',
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)})],
[2, 'position', tuya.valueConverter.coverPositionInverted],
[3, 'position', tuya.valueConverter.coverPositionInverted],
[5, 'reverse_direction', tuya.valueConverterBasic.lookup({'true': tuya.enum(0), 'false': tuya.enum(1)})],
[12, 'motor_fault', tuya.valueConverter.trueFalse1],
],
},
};
module.exports = definition;

from zigbee-herdsman-converters.

Koenkk avatar Koenkk commented on August 16, 2024

Added, thanks!

Changes will be available in the dev branch in a few hours from now.

from zigbee-herdsman-converters.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.