Openzwave logfile not written

Hello,

I’m looking to use a zwave adapter (Z-Wave.Me ZME_UZB1 USB Stick), it’s properly detected but when i try to add any device with it, it does not seem to work. The biggest problem is I have no feedback (/home/homeassistant/.homeassistant/OZW_Log.txt does not exists), it complains about it in the home assistant logs, and i have no feedback on how adding / removing or operating the zwave network is going.

I then tried to change /opt/homeassistant/lib/python3.6/site-packages/python_openzwave/ozw_config/options.xml to force but it does not seem to make any difference.

Any idea on how i can get the openzwave log file to be written ? or to diagnose / reset anything that could be useful about openzwave ?

Best regards,

Stephane

What exactly is the error?

The error appear when i’m browsing to the zwave configuration item in the configuration menu.

2018-01-28 00:40:49 INFO (MainThread) [homeassistant.components.http] Serving /api/zwave/ozwlog to 127.0.0.1 (auth: True)
2018-01-28 00:40:49 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/opt/homeassistant/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 410, in start
    resp = yield from self._request_handler(request)
  File "/opt/homeassistant/lib/python3.6/site-packages/aiohttp/web.py", line 325, in _handle
    resp = yield from handler(request)
  File "/opt/homeassistant/lib/python3.6/site-packages/aiohttp/web_middlewares.py", line 93, in impl
    return (yield from handler(request))
  File "/opt/homeassistant/lib/python3.6/site-packages/homeassistant/components/http/ban.py", line 58, in ban_middleware
    return (yield from handler(request))
  File "/usr/lib/python3.6/asyncio/coroutines.py", line 213, in coro
    res = yield from res
  File "/usr/lib/python3.6/asyncio/coroutines.py", line 213, in coro
    res = yield from res
  File "/opt/homeassistant/lib/python3.6/site-packages/homeassistant/components/http/__init__.py", line 430, in handle
    result = yield from result
  File "/opt/homeassistant/lib/python3.6/site-packages/homeassistant/components/config/zwave.py", line 52, in get
    response = yield from hass.async_add_job(self._get_log, hass, lines)
  File "/usr/lib/python3.6/asyncio/futures.py", line 332, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.6/asyncio/tasks.py", line 250, in _wakeup
    future.result()
  File "/usr/lib/python3.6/asyncio/futures.py", line 245, in result
    raise self._exception
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/opt/homeassistant/lib/python3.6/site-packages/homeassistant/components/config/zwave.py", line 59, in _get_log
    with open(logfilepath, 'r') as logfile:
FileNotFoundError: [Errno 2] No such file or directory: '/home/homeassistant/.homeassistant/OZW_Log.txt'

I’m “too young” to attach the logfile to the forum but you can find it here : https://pastebin.com/LB9mEd9z

Hello,

I tried to reinstall everything, in a new venv, and I still have the same problem.

So I’m still looking for help if anyone have an idea :slight_smile:

I’m very interested in home assistant so I hope there is a way to fix the problem.

Best regards,

Stephane

Hello, it’s me again.

I am still out of luck with this problem.

If nobody have a solution i will have to try other home automation servers but that will make me :slightly_frowning_face: :cry:

As a last attempt and before I have to commit this act of blasphemy, i will tag @anderson110 @anon43302295 and @Tinkerer as I have been reading other z-wave topics and saw you bravely save people from different kind of z-wave problems. But feel free to ignore my message if you don’t have the answer for this one.

Have a nice evening,

Stephane

So, my check would be:

  • Does homeassistant own /home/homeassistant/.homeassistant/?
  • Does /home/homeassistant/.homeassistant/OZW_Log.txt exist?

What does this show?

ls -ald /home/homeassistant/.homeassistant/ /home/homeassistant/.homeassistant/OZW_Log.txt
2 Likes

you could also just try

cd /home/homeassistant/.homeassistant/
touch OZW_Log.txt
chmod 777 OZW_Log.txt

that will create an empty file and make it world-writeable. It doesn’t solve the larger issue that HA isn’t creating that file in the first place. My guess is @Tinkerer is correct in asking if your permissions are correct on your ~./homeassistant/ directory.

2 Likes

Thanks a lot for the directions.

Could not abolish the problem yet, but here is the extra info…

@Tinkerer : the directory seems ok but files does not exists

# ls -ald /home/homeassistant/.homeassistant/ /home/homeassistant/.homeassistant/OZW_Log.txt
ls: impossible d'accéder à '/home/homeassistant/.homeassistant/OZW_Log.txt': Aucun fichier ou dossier de ce type
drwxr-xr-x 1 homeassistant homeassistant 408 févr. 26 23:00 /home/homeassistant/.homeassistant/

And i also checked that homeassistant is running with the homeassistant process, but as a matter of trying superstitious things, i changed it to 777 also.

@ha_steve : I did not think of that. But unfortunately, while your suggestion get ride of the error message, no content is added during operations so i still have effectively no logs (except if i forcibly put stuff in the file i can check that it’s displayed on the zwave homeassistant web config page).

For example, if i run “add node” i can see in syslog that the call is made :

Feb 26 23:36:06 poinsart hass[24473]: INFO:homeassistant.core:Bus:Handling <Event call_service[L]: domain=zwave, service=add_node, service_data=, service_call_id=140420622509896-3>
Feb 26 23:36:06 poinsart hass[24473]: INFO:homeassistant.components.zwave:Z-Wave add_node have been initialized
Feb 26 23:36:06 poinsart hass[24473]: INFO:homeassistant.core:Bus:Handling <Event service_executed[L]: service_call_id=140420622509896-3>

But without the OZW_Log.txt it’s hard to understand why nothing gets added.

There is one more thing i can try : i can run a new homeassistant install on a different computer, see if i have the same result or if i can think of something while doing it.

I will try that this week, but don’t hesitate to tell me if you have other suggestions.

Best regards,

Stephane

Check options.xml in your homeassistant config directory.

Find

  <Option name="SaveLogLevel" value="3" />
  <Option name="QueueLogLevel" value="3" />
  <Option name="DumpLogLevel" value="3" />

and change them to 1 instead of 3.

Source of the info.

Alternatively you can play with the logger:

logger:
  default: debug
  logs:
    homeassistant.components.zwave: debug

This will dump tons of info for you to sift.

Hello,

How do you make your ozw cfg file retain the changes? Every time I add the central command class, it gets deleted when I reboot HASSIO.

Thanks for the help!

got it. I did not realize you had the stop the z-wave network before making the changes