kevinvincent / ha-wyzesense

A Home Assistant Component to interface with the WYZE Sense hub and sensor system
369 stars 101 forks source link

Set up failure - Will not recognize Wyze hub #91

Closed clandestine-avocado closed 4 years ago

clandestine-avocado commented 4 years ago

Running HASSIO on Oracle VM; installed WyzeSense via HACS with no apparent issues. Files show up in the /config/custom_components folder

I had it set up a few weeks ago with no issues. VM crashed (unrelated issue) and I had to rebuild - and can't get WyzeSense to work now.

kevinvincent commented 4 years ago

Try changing "Auto" to "auto".

EDIT: Actually just kidding it should work either way. I'll continue taking a look.

TimothyLeeAdams commented 4 years ago

I'm having this exact same issue. Identical error logs and everything. I've been running this component for the past couple of months and it had been flawless up until yesterday. I'm running Home Assistant in Docker on an unRaid host. Have also tried all three of the following configs:

binary_sensor:
  - platform: wyzesense
    device: auto

binary_sensor:
  - platform: wyzesense
    device: "/dev/hidraw0"

binary_sensor:
  - platform: wyzesense
    device: "/dev/hidraw1"

Just to try and isolate the issue, I set up a fresh instance of Home Assistant with only HACS and WyzeSense component installed and am still having the same issue.

I updated to WYZESENSE v0.0.7 and Home Assistant 0.104.2 at the same time, so not sure it wasn't something that changed in Home Assistant that is causing the issue. I might try downgrading Home Assistant and/or WyzeSense versions to see if I can find a working combination and will report back here if I find anything.

clandestine-avocado commented 4 years ago

Try changing "Auto" to "auto".

EDIT: Actually just kidding it should work either way. I'll continue taking a look.

I'll try anything at this point - tons of automations triggering off these sensors when I had them working a few weeks ago - appreciate you taking a look!

kevinvincent commented 4 years ago

Hmm so to me it looks like in all cases it’s unable to detect the dongle plugged into your host. Can you try sshing in (to both your host and the HA vm) and running ‘dmesg | grep hidraw‘ and post the output?

TimothyLeeAdams commented 4 years ago

I get the following output from my host:

root@Tower:~# dmesg | grep hidraw
[   10.524462] hidraw: raw HID events driver (C) Jiri Kosina
[   11.076451] hid-generic 0003:0764:0501.0001: hiddev96,hidraw0: USB HID v1.10 Device [CPS  CP 1500C] on usb-0000:00:14.0-10/input0
root@Tower:~# 

I'm not able to execute dmesg inside the docker shell, I don't think it's installed. Output result:

root@Tower:~# docker exec -it home-assistant-DEBUG-0.103.6 /bin/bash
bash-5.0# ls
automations.yaml      deps                  home-assistant_v2.db  secrets.yaml
configuration.yaml    groups.yaml           scenes.yaml           tts
custom_components     home-assistant.log    scripts.yaml
bash-5.0# dmesg | grep hidraw
dmesg: klogctl: Operation not permitted
bash-5.0# 

I do still have the USB device passed through to my docker instance, just as it was previously when it was working.

clandestine-avocado commented 4 years ago

Hmm so to me it looks like in all cases it’s unable to detect the dongle plugged into your host. Can you try sshing in (to both your host and the HA vm) and running ‘dmesg | grep hidraw‘ and post the output?

I have a remote desktop connection with the host (Windows 10) and it's running a VM (Ubuntu with the Hassio VDI) on that host - I don't know how to SSH into the HA VM (haven't needed to up to this point), but I CAN get to the Hassio CLI thru the VM. But the available commands are pretty limited.

image

TimothyLeeAdams commented 4 years ago

Ahhh sorry, I didn't have the Wyze dongle plugged in when I ran that command. Here is the output of 'dmesg | grep hidraw' with it plugged in:

root@Tower:~# dmesg | grep hidraw
[   10.524462] hidraw: raw HID events driver (C) Jiri Kosina
[   11.076451] hid-generic 0003:0764:0501.0001: hiddev96,hidraw0: USB HID v1.10 Device [CPS  CP 1500C] on usb-0000:00:14.0-10/input0
[ 3054.856442] hid-generic 0003:1A86:E024.0002: hiddev97,hidraw1: USB HID v1.00 Device [HID 1a86:e024] on usb-0000:00:14.0-11/input0
root@Tower:~# 
TimothyLeeAdams commented 4 years ago

Okay, I think I've figured out what happened with my system. It seems that my Wyze USB receiver changed from /dev/hidraw0 to /dev/hidraw1, probably after I rebooted my server. Not sure WHY that happened, but it has. I apologize for not figuring that out before posting. In summary, what I did to get it working again (on latest version of Home Assistant and WyzeSense 0.0.7) was to change the passthough device for my docker instance to dev/hidraw1, and change my config to:

binary_sensor:
  - platform: wyzesense
    device: "/dev/hidraw1"

Unfortunately, this probably doesn't help with @ha14937 's problem, but I'm happy to help test further if needed.

kevinvincent commented 4 years ago

@TimothyLeeAdams It may periodically switch hidraw numbers on restart. The most bulletproof solution is to use the method described in this issue to give it a permanent /dev/ name and pass it into docker: https://github.com/kevinvincent/ha-wyzesense/issues/66

After that you can just set it to auto (or use the permanent /dev/ name) and it should work fine.

@ha14937 I'll continue trying to figure out whats going on with yours.

clandestine-avocado commented 4 years ago

@kevinvincent: I'm embarrassed to say I figured it out. I messed up the USB pass through on the VM - which I swear I double checked. Anyway, I got it working; apologies for wasting your time!

kevinvincent commented 4 years ago

@ha14937 No worries! There are so many small details getting devices like this passed through. Beware that the hidraw device number may change across restarts and if you have it hardcoded I recommend following the steps in https://github.com/kevinvincent/ha-wyzesense/issues/66 to fix the /dev/ name.