question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

External converters

See original GitHub issue

Hi, @Koenkk

I’ve noticed a little pain in diy community. Each and every DIY developer needs to write/modify converters, some times this devices are in very limited quantity or not even meant to be published. So many guys are modifying fromZigbee.js straight from node_modules folder, which eventually causes all changes are lost during update. What if we implement mechanism to support external converters? We can create base package with some interfaces, like this

interface FromZigbeeConverter {
    cluster: string;
    type: string[];
    convert(model, msg, publish, options, meta): unknown;
}

interface ToZigbeeConverter {
    key: string[];
    convertSet(entity, key, value, meta): Promise<void>;
    convertGet(entity, key, meta): Promise<unknown>;
}
interface DeviceDescriptor {
    zigbeeModel: string[];
    model: string;
    vendor: string;
    description: string;
    supports: string;
    fromZigbee: FromZigbeeConverter[];
    toZigbee: ToZigbeeConverter[];
    meta?: { configureKey: number },
    configure?(device, coordinatorEndpoint): Promise<void>
}
  • package.json declaration
{
 "name": "my-awesome-converter"
  "main": "custom-converter.js"
}

users could install their packages like this, or even from their github repositories npm install ~/my-super-converter

And implement loading js modules who are implementing this interfaces. This configuration can be placed in z2m configuration files, where we can just list of packages ex:

external_converters:
    - my-awesome-converter

If this idea is good enough, I’m ready to invest my time into implementation.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
nurikkcommented, Oct 11, 2020

Hi, @ciotlosm! Can you try to prepend NODE_PATH=/app/node_modules env variable before ZIGBEE2MQTT_DATA in Dockerfile?

Read more comments on GitHub >

github_iconTop Results From Across the Web

More configuration options - Zigbee2MQTT
You can define external converters to e.g. add support for a DiY device. The extension can be a file with .js extension in...
Read more >
Zigbee2mqtt external converter zigbee-herdsman-converters ...
Hi everyone, I'm trying to add a device to zigbee2mqtt that is not supported by default. I found the converter here: ...
Read more >
Add external converter file for Zigbee2MQTT via HassOS
Then, to tell Z2M to use the converter file, go to the Z2M UI, then click "Settings" > "External Converters". Enter the filename...
Read more >
internal to external hard drive converter - Amazon.com
Maxmoral Super Speed USB 3.0 to Sata III 2.5 inch Hard Drive Adapter Converter Cable,Supports UASP SATA III II I to USB 3.0,External...
Read more >
External converters with RME Babyface - Gearspace.com
I'm considering the option of buying a Babyface and separate AD-DA converters. I've got a couple of mic preamps. Would it be possible...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found