openlumi / openlumi.github.io

OpenWrt for Xiaomi Zigbee gateway with imx6 SoC DGNWG05LM, ZHWG11LM
https://openlumi.github.io
154 stars 26 forks source link

[zigbee2mqtt opkg] '[object Object] is not a constructor' while trying to save an external extension #25

Closed FREEZEball closed 1 year ago

FREEZEball commented 2 years ago

While trying to add an extension to zigbee2mqtt on "Xiaomi Gateway Lumi" there is a confusing error

Error: Request 'homeassistant/bridge/request/extension/save' failed with error: '[object Object] is not a constructor' Info: MQTT publish: topic 'homeassistant/bridge/response/extension/save', payload '{"data":{},"error":"[object Object] is not a constructor","status":"error","transaction":"4z14k-9"}'

The code I am trying to add as a file is any of these solutions.

Openlumi device: package consisting of a gateway, two motion sensors, two door sensors and a button. Zigbee device: ZM-RT201 motion sensor. Openwrt version: OpenWrt 19.07.7 r11306-c4a6851c72 / LuCI openwrt-19.07 branch git-21.189.23240-7b931da zigbee2mqtt opkg version: tried with both version from the guide (I believe it was 1.19?) and the latest one (using it currently); all supported devices work with it as normal.

Since I haven't found any of these error messages in zigbee2mqtt github and also failed to find any reference about difference in methods of adding extensions between "native" zigbee2mqtt and an openpkg package, I decided to create this issue. It might be something I missed.

G1K commented 2 years ago

You haven't tried doing this on zigbee2mqtt native right?

You are probably confusing extensions and external converters. It's not the same thing. Extensions are the possibilities of writing code to expand work, for example automation. Converters are needed for the correct operation of devices.