ZigBee2MQTT Unsupported Device External Converter Help

Hello! I’m trying to add these (https://www.amazon.com/dp/B08K45W4LR) Zigbee plugs to my Home Assistant OS install. I can pair the device but I get this error:

Zigbee2MQTT:warn  2022-11-29 15:33:23: Device '0x7cb94c634f170000' with Zigbee model 'SWITCH-ZR03-1' and manufacturer name 'eWeLink' is NOT supported, please follow https://www.zigbee2mqtt.io/how_tos/how_to_support_new_devices.html

So I started using the instructions in that URL. I added the following to my ZigBee2MQTT advanced configuration:

log_level: debug
external_converters:
  - Makida.js

And the Makida file looks like this:

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 definition = {
    zigbeeModel: ['SWITCH-ZR03-1'],
    model: 'Makida',
    vendor: 'eWeLink',
    description: 'Mini Smart Socket',
    fromZigbee: [fz.on_off],
    toZigbee: [tz.on_off],
    exposes: [e.switch()],
    // The configure method below is needed to make the device reports on/off state changes
    // when the device is controlled manually through the button on it.
    configure: async (device, coordinatorEndpoint, logger) => {
        const endpoint = device.getEndpoint(1);
        await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
        await reporting.onOff(endpoint);
    },
};

module.exports = definition;

However when I reboot Zigbee2MQTT I get no indication that it’s actually using the external converter at all. There’s no error or anything that mentions it in the logs. I noticed in my \\HASSIO\share\zigbee2mqtt\configuration.yaml file that the external converter is blank, and any changes I make to that file won’t stay after a reboot. Not sure if that’s relevant or not. Does any one have any ideas? Or maybe a simple step I completely skipped? Thanks!

Have you tried adding it from the UI?

I did but I get that error about it being an unsupported device.

Zigbee2MQTT:warn  2022-11-29 15:33:23: Device '0x7cb94c634f170000' with Zigbee model 'SWITCH-ZR03-1' and manufacturer name 'eWeLink' is NOT supported, please follow https://www.zigbee2mqtt.io/how_tos/how_to_support_new_devices.html

You haven’t answered my question. Have you gone into the z2m UI and tried to add the file there?

Also, the page you have pointed to has several debugging steps, including raising the z2m debug level and editing your z2m configuration.yaml. Perhaps reveal to us the log and the configuration.yaml that you ended up with.

Hi @nickrout, I don’t think I understood that you meant the configuration UI. Sorry about that. But I may have found my first problem. I was using external converter under advanced in the UI. Right under the log level. But I found under options there’s a “edit in YAML” and I saw two external converters. That’s been updated now:

data_path: /share/zigbee2mqtt
external_converters:
  - Makida.js
devices: devices.yaml
groups: groups.yaml
homeassistant: true
permit_join: true
mqtt:
  base_topic: zigbee2mqtt
  server: mqtt://homeassistant:1883
  user: mqtt
  password: mqtt
serial:
  port: /dev/ttyACM0
advanced:
  log_level: debug
  pan_id: 6754
  channel: 11
  network_key:
    - 1
    - 3
    - 5
    - 7
    - 9
    - 11
    - 13
    - 15
    - 0
    - 2
    - 4
    - 6
    - 8
    - 10
    - 12
    - 13
  availability_blocklist: []
  availability_passlist: []
device_options: {}
blocklist: []
passlist: []
queue: {}
frontend:
  port: 8099
experimental:
  new_api: true
socat:
  enabled: false
  master: pty,raw,echo=0,link=/dev/ttyZ2M,mode=777
  slave: tcp-listen:8485,keepalive,nodelay,reuseaddr,keepidle=1,keepintvl=1,keepcnt=5
  options: "-d -d"
  log: false
  restartdelay: 1
  initialdelay: 1
availability: true
zigbee_herdsman_debug: false

New error: “Error: Cannot find module ‘zigbee-herdsman-converters/lib/extend’”

From my limited googling it sounds like I need to upgrade to the Edge version of Z2M? Or do I just need to download that repo to the z2m folder?