kevinvincent / ha-wyzesense

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

WYZE Sense not working in VirtualBox on Windows 10 #136

Open cortexgaming101 opened 4 years ago

cortexgaming101 commented 4 years ago

When trying to run wyzesense.scan, nothing comes up and throws an error

"Failed to call service wyzesense/scan. Service not found."

Running HASS.IO 0.109.6 with the HACS component 0.0.7. My hub on my computer has an orange light.

Getting this error in the log:

2020-05-18` 17:02:18 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 178, in _async_setup_platform await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT) File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for return fut.result() File "/usr/local/lib/python3.7/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 _LOGGER.debug("Attempting to open connection to hub at " + config[CONF_DEVICE]) TypeError: can only concatenate str (not "NoneType") to str

Heres my config

binary_sensor:

  • platform: wyzesense device: auto
gterpstra75 commented 4 years ago

You need a blue light on the hub in order for wyzesense.scan to run. Have you checked hidraw for the hub?

You can confirm the hidraw name of the device by running dmesg | grep hidraw to find out what hidraw number the bridge grabbed.

cortexgaming101 commented 4 years ago

@gterpstra75 Where would I run that command? Is it in HASS.IO? I am using VirtualBox if that effects it.

gterpstra75 commented 4 years ago

No, it is ubuntu or Linex command. What are you running VirtualBox on? I did try running this with VirtualBox running on ubuntu but that didn't solve the problem which I was having so I am running HASS.IO in docker under ubuntu. Did you enable the USB port in VirtualBox to HASS.IO VM machine (https://www.eltima.com/article/virtualbox-usb-passthrough/)?

cortexgaming101 commented 4 years ago

@gterpstra75 I am running it on Windows 10. I've never used docker so I have no idea how I would do that. Is it pretty easy to copy everything over to it? I've heard from other people it has more support for things. I also do have the USB passthrough setup.

gterpstra75 commented 4 years ago

There would be a steep learning curve to switch, so I would recommend trying to get your setup working. It looks like when installed hassio on virtualbox, you installed the Linux version. So you should be able to run dmesg | grep hidraw in hassio window.

From looking at your logs (but I am not expert here), it looks to me that wyzesense isn't finding the hub. Which USB controller did you select (https://www.virtualbox.org/manual/ch03.html#settings-usb)? I know that I was using USB-3 port with xhci drivers.

cortexgaming101 commented 4 years ago

@gterpstra75 I was using USB-2 and just tried it with USB-3 and no success. Where would I run that command? I've never done this before so sorry if it seems like I'm a major noob. Probably almost a year ago this used to work on VirtualBox and then it stopped working in an update and I didn't need it back then. So I know it works, it's just an issue of getting it to work again.

gterpstra75 commented 4 years ago

refer to https://dummylabs.com/post/2020-01-20-hassio-for-virtualbox/. Try to run the command at the console.

cortexgaming101 commented 4 years ago

So I think I put it in the right spot and it said

Error: unknown command "dmesg" for "ha"

gterpstra75 commented 4 years ago

log into the host machine first (type login). Then at the # type dmesg | grep hidraw

Sorry, I am not running VirtualBox. Hopefully, this will help you figure it out.

cortexgaming101 commented 4 years ago

It says

hidraw: raw HID events driver (C) Jiri Kosina

Caustik314 commented 4 years ago

Hello! I'm up to this point and I'm showing two devices, one is my mouse and the other I'm assuming is the bridge! It's saying hiddev96,hidraw1 using: device: "/dev/hidraw1/" I can now see at the bottom of my entity list: "wyzesense 77xxXXxx" (which is the MAC address of my pre-paired sensor through the wyae app. I'm new to HA, just trying to get local control of my sensors)

Everything seems to be working great for me! (Win10 VMbox I also do NOT have a blue light, I have NO light (but that's probably because I turned off the bridge status led indicator in Wyze before moving to HA).

I DO know my HA installation (Supervisor) is a newer version than you posted, I'm also running 0.0.8 of wyzesense. Hope any of this helps!