Closed ben-digitalhive closed 2 years ago
As per the debug log it looks like it creates a new config file everytime
2021-10-31 15:59:44.330 INFO : zigbee2mqtt-adapter: - USB stick spotted at: /dev/ttyACM0
2021-10-31 15:59:44.332 INFO : zigbee2mqtt-adapter: line:
2021-10-31 15:59:44.334 INFO : zigbee2mqtt-adapter: this.zigbee2mqtt_data_dir_path = /home/pi/.webthings/data/zigbee2mqtt-adapter
2021-10-31 15:59:44.335 INFO : zigbee2mqtt-adapter: this.zigbee2mqtt_dir_path = /home/pi/.webthings/data/zigbee2mqtt-adapter/zigbee2mqtt
2021-10-31 15:59:44.337 INFO : zigbee2mqtt-adapter: this.config.local_zigbee2mqtt = true
2021-10-31 15:59:44.338 INFO : zigbee2mqtt-adapter: zigbee2mqtt folder existed.
2021-10-31 15:59:44.340 INFO : zigbee2mqtt-adapter: in run_zigbee2mqtt
2021-10-31 15:59:44.341 INFO : zigbee2mqtt-adapter: Checking if config file exists
2021-10-31 15:59:44.343 INFO : zigbee2mqtt-adapter: basic configuration.yaml file was succesfully created!
2021-10-31 15:59:45.382 INFO : Finished updating add-ons
I don't quite follow. Home Assistant? You're connecting your Webthings Gateway to Home Assistant somehow? Are you using this addon to run Zigbee2MQTT on the same system as a home assistant install?
The addon indeed creates a new configuration file every time. The addon is designed for WYSIWYG users, and you're not supposed to make manual changes to the configuration file.
Hello - In the Z2M configuration there is a standard option in the configuration.yaml
''' homeassistant = false
It used to be that I could set this to true via SSH until more recent updates of your addon.
What it does is format the MQTT messages that get sent/received so they seamlessly get picked up by Home Assistant.
Im unfortunatley not a coder otherwise I could have a crack at this myself but an answer to this would be to add a configuration option in the WYSIWYG for this "homeassistant" setting or better yet allow in the code for a fully custom configuration.yaml e.g. you could almost have an advanced option to just paste into a multiline box the required configuration file and then use that as your configuration?
Ah I see.
Could you perhaps do a small test for me?
This command will allow you to edit the addon's code without the security features blocking the now modified addon.
mkdir ~/.webthings/addons/zigbee2mqtt/.git
nano ~/.webthings/addons/zigbee2mqtt/zigbee2mqtt-adapter.js
Around line 336 you will see: let base_config = "homeassistant: false\n" +
change false to true
there.
save the file (ctrl-x, ctrl-y)
Then reboot.
Does the addon still function normally with the change?
This should be fixed. If the issue persists, please re-open this issue.
Hi, Really like the addon and have had it working beautiful as a gateway transmitting to homeassistant in the past. Now that I wish to push forward with my project I cannot figure out how I got it to work previously and I think there is something awry with the configuration files.
I have things connected and correctly transmitting to home assistant and the home assistant integration is sniffing the payloads off the broker (example below). But the formatting of them is I believe not what homeassistant is expecting. The original z2m project has a configuration for this to make it easy to pass data through to HA but when I manually adjust the configuration.yaml this is continually overwitten.
Here is an example of a payload not in HA format:
Here is an example of a payload showing the bridge configuration - note homeassistant: false even though I have configured it.