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

ENOENT: no such file or directory, open '/config/zigbee2mqtt/secret.yaml' #547

Open
ViRuSTriNiTy opened this issue Dec 20, 2022 · 0 comments

Comments

@ViRuSTriNiTy
Copy link

ViRuSTriNiTy commented Dec 20, 2022

Hi there,

I currently trying to switch from ZHA to Zigbee2MQTT but I struggle to get the password setting right.

The documentation in section Specifying MQTT server/user/password and network_key in a different file states that password: '!secret.yaml password' could be used to store the password in secret.yaml.

I have tried to leave out the .yaml to use the approach documented on page [Storing secrets]https://www.home-assistant.io/docs/configuration/secrets/] of the official Homage Assistant but it seems that Zigbee2MQTT does not support it. When I start the add on everything works but as soon as an action is executed, like removing a device in the Web UI, the add-on crashes and the logs will contain the following lines:

Zigbee2MQTT:info  2022-12-20 18:16:09: Removing device '0xb4e3f9fffec1f918' (block: false, force: true)
Zigbee2MQTT:debug 2022-12-20 18:16:09: Clearing Home Assistant discovery topic for '0xb4e3f9fffec1f918'
Zigbee2MQTT:error 2022-12-20 18:16:09: Request 'zigbee2mqtt/bridge/request/device/remove' failed with error: 'Failed to remove device '0xb4e3f9fffec1f918' (block: false, force: true) (Error: ENOENT: no such file or directory, open '/config/zigbee2mqtt/secret.yaml')'
Zigbee2MQTT:debug 2022-12-20 18:16:09: Error: Failed to remove device '0xb4e3f9fffec1f918' (block: false, force: true) (Error: ENOENT: no such file or directory, open '/config/zigbee2mqtt/secret.yaml')
    at Bridge.removeEntity (/app/lib/extension/bridge.ts:577:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Creting file /config/zigbee2mqtt/secret.yaml solves the error but this results in

error 2022-12-20 18:02:07: TypeError: Cannot read properties of undefined (reading 'j1shin_password')
    at Object.updateIfChanged (/app/lib/util/yaml.ts:30:16)
    at write (/app/lib/util/settings.ts:222:22)
    at Object.addDevice (/app/lib/util/settings.ts:552:5)
    at Device.ensureInSettings (/app/lib/model/device.ts:41:22)
    at Zigbee.resolveDevice (/app/lib/zigbee.ts:234:20)
    at /app/lib/zigbee.ts:276:30
    at Array.map (<anonymous>)
    at Zigbee.devices (/app/lib/zigbee.ts:276:14)
    at Zigbee.start (/app/lib/zigbee.ts:113:35)
    at Controller.start (/app/lib/controller.ts:101:27)

because j1shin_password is missing in the file. I don't want to add the password here as it should be loaded from the secrets.yaml mentioned on page [Storing secrets]https://www.home-assistant.io/docs/configuration/secrets/] of the official Homage Assistant.

If this even possible? I thought this would be a general feature of HA and this includes the add-ons, right?

So lonG

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

1 participant