Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with external device definitions #22150

Open
han-alink opened this issue Apr 9, 2024 · 3 comments
Open

Problem with external device definitions #22150

han-alink opened this issue Apr 9, 2024 · 3 comments

Comments

@han-alink
Copy link

Can you please create a new issue and share all external definitions there?

Originally posted by @mrskycriper in #22023 (reply in thread)

@han-alink
Copy link
Author

Here is the file content (renamed to .txt)

ha_devices.txt

@schauveau
Copy link

You can run node on any external converter file to verify that is compiles properly. That only works if the file is within the /opt/zigbee2mqtt directory structure.

#  node  /opt/zigbee2mqtt/ha_devices.txt
/opt/zigbee2mqtt/ha_devices.txt:439
    extend: [deviceEndpoints({"endpoints":{"1":1,"2":2}}), temperature({"endpointNames":["1"]}), batteryPercentage(), humidity({"endpointNames":["2"], reporting: {min: 300, max: 60000, change: 10}})]
                                                                                                 ^
TypeError: batteryPercentage is not a function
    at Object.<anonymous> (/opt/zigbee2mqtt/ha_devices.txt:439:98)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
    at node:internal/main/run_main_module:28:49

Node.js v20.11.1

Here the problem is obviously with batteryPercentage. The symbol is supposed to be exported by zigbee-herdsman-converters/lib/modernExtend.js but I see no trace of `batteryPercentage in the file.

However, there is a battery function in the exports and one of its argument is percentage.

@han-alink
Copy link
Author

Can you please create a new issue and share all external definitions there?

Originally posted by @mrskycriper in #22023 (reply in thread)

Hi Sergei,
Why did you ask me to create a new link and publish my device configuarion file? I actually hoped to receive some help with the update of the device descriptions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants