zewelor / bt-mqtt-gateway

A simple Python script which provides a Bluetooth to MQTT gateway, easily extensible via custom workers. See https://github.com/zewelor/bt-mqtt-gateway/wiki for more information.
MIT License
549 stars 116 forks source link

Error message if bt-mqtt-gateway is started as home assistant addon #260

Open Micha70 opened 1 year ago

Micha70 commented 1 year ago

Describe the bug Following error message appears if bt-mqtt-gateway is started as homeassistant addon (https://github.com/FaserF/hassio-addons/tree/master/bt-mqtt-gateway): Found config file at /share/bt-mqtt-gateway.yaml . Copying it now. Starting bt-mqtt gateway in normal mode If there are any bugs occurring below this line, please report it to the bt-mqtt-gateway developer and not to @FaserF - thanks. Traceback (most recent call last): File "./gateway.py", line 63, in from config import settings File "/application/config.py", line 4, in with open(os.path.join(os.path.dirname(os.path.realpath(file)), "config.yaml"), "r") as f: IsADirectoryError: [Errno 21] Is a directory: '/application/config.yaml'

To Reproduce Steps to reproduce the behavior:

  1. Install bt-mqtt-gateway as home assistant addon
  2. start add on
  3. add on does not start, error message posted above appears

Expected behavior Addon can be started, and addon is working

Server (please complete the following information):

Additional context running the bt-mqtt-gateway in an virtual environment since several month works very well. Created also a issue on addon (https://github.com/FaserF/hassio-addons/issues/86), however error message above refers to this developer of bt-mqtt-gateway.

antoniomolram commented 1 year ago

I have the same issue as @Micha70

Micha70 commented 1 year ago

I have the same issue as @Micha70

@antoniomolram: Have a look on https://github.com/FaserF/hassio-addons/issues/86. You can have a quick fix it by modifying start.h.

antoniomolram commented 1 year ago

I am checking this, but I don't know where this repo is located, and you mean start.sh, right? How looks your start.sh. Any help? :)

Micha70 commented 1 year ago

@antoniomolram the repo is located at /usr/share/hassio/addons/git/605cee21/bt-mqtt-gateway. Here I modified the start.sh and added the line sed -i -e 's|"config.yaml"|"../config.yaml"|' ./config.py directly after echo "Found config file at $config_path . Copying it now." cp $config_path /config.yaml

After restart is working. I'm not sure if pressing the button "Rebuild" (the right one) is necessary. I did it.

now log file looks like this: Found config file at /share/bt-mqtt-gateway.yaml . Copying it now. Starting bt-mqtt gateway in normal mode If there are any bugs occurring below this line, please report it to the bt-mqtt-gateway developer and not to @FaserF - thanks. 17:47:46 Starting 17:47:46 Adding 2 thermostat devices 17:47:46 Updating 2 thermostat devices 17:48:46 Updating 2 thermostat devices 17:49:46 Updating 2 thermostat devices

I hope I could help you and you get it running as well!

antoniomolram commented 1 year ago

Hi, thank you for the info, now I get other error.... xD

Found config file at /share/bt-mqtt-gateway.yaml . Copying it now.
Starting bt-mqtt gateway in normal mode
If there are any bugs occurring below this line, please report it to the bt-mqtt-gateway developer and not to @FaserF - thanks.
23:30:25 Starting
Traceback (most recent call last):
  File "./gateway.py", line 77, in <module>
    workers_requirements.verify()
  File "/application/workers_requirements.py", line 25, in verify
    requirements = configured_workers()
  File "/application/workers_requirements.py", line 16, in configured_workers
    return _get_requirements(workers)
  File "/application/workers_requirements.py", line 66, in _get_requirements
    for worker_name in workers:
TypeError: 'NoneType' object is not iterable

any idea about this new one? I tried to find it on internet but not too much info about it

Micha70 commented 1 year ago

Looks like you have a problem with your bt-mqtt-gateway.yaml.... Did you ever used the bt-mqtt-gateway standalone? Or do you start directly using it as HA add-on?

antoniomolram commented 1 year ago

I was doing it with the HA add-on directly. I will try the standalone option.

antoniomolram commented 1 year ago

thank you for your comments Micha70, it was as you said a bt-mqtt-gateway.yaml error, some whitespaces issue.