ha-wyzesense icon indicating copy to clipboard operation
ha-wyzesense copied to clipboard

Error, sensors shown as unavailable

Open DennisGarvey opened this issue 4 years ago • 4 comments

I'm seeing this too, but I have a different set of errors:

2020-08-25 20:12:52 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up wyzesense platform for binary_sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 184, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/wyzesense/binary_sensor.py", line 76, in setup_platform
    config[CONF_DEVICE] = findDongle()
  File "/config/custom_components/wyzesense/binary_sensor.py", line 67, in findDongle
    df = subprocess.check_output(["ls", "-la", "/sys/class/hidraw"]).decode('utf-8').lower()
  File "/usr/local/lib/python3.8/subprocess.py", line 411, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/local/lib/python3.8/subprocess.py", line 512, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ls', '-la', '/sys/class/hidraw']' returned non-zero exit status 1.

This appears to be an inability to find the Bridge itself. However, it appears to be there:

% ls -la /sys/class/hidraw

lrwxrwxrwx  1 root root 0 Aug 25 20:51 hidraw0 -> ../../devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/0003:1A86:E024.0001/hidraw/hidraw0

pickerin avatar Aug 26 '20 04:08 pickerin

Any fix?

DennisGarvey avatar Aug 28 '20 14:08 DennisGarvey

I seem to be getting the same errors as @pickerin It just doesnt setup the component and can't call any of the wyze services and everything shows as unavailable.

tripp396 avatar Sep 01 '20 15:09 tripp396

I've been able to fix this multiple times, with a reboot of the underlying host (without the bridge plugged in), then plug it in. When it's happening the light on the bridge is orange. I'm looking for a way to monitor the bridge status myself and alert me when it's happening (Yea, I could do it off of the sensors "availability", but it's a bit unreliable for me).

pickerin avatar Sep 01 '20 16:09 pickerin