Wyze sense sensor integrations

Might have something to do with incorrectly calling the hidraw number based on which USB port it’s in.

There was a pull request I actually tried and seemed to work just fine, may be an option to try on your side as well?

So to be clear I need to be on the master version and then changing it to auto or is there another script I need to run. I followed most of that thread I think :slight_smile:

I don’t think it’s merged to the master branch.

Here’s what I did:

  1. Copy the binary_sensor.py file from here to your custom components folder in place of the existing binary_sensor.py file.

  2. Edit your binary sensor in your configuration from

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

To

- platform: wyzesense
  device: "auto"
1 Like

Dang you are the man…seeing all my sensors. Thanks for the help.

Anytime.

I’m seeing weird issues with this component (I think either PIR related or hub related) I’m still trying to work out so I’m glad I can help others.

I just had my hub switch from hidraw2 to hidraw3 without me rebooting anything. All my sensors stopped working at 2am-ish. Took me a while to figure out what had happened. So auto configure would be nice (but still gonna have to pass through a bunch of options via docker).

Is there no way to customize/permanently set what the name is? I did that with my Zwave USB stick so instead of /dev/ACM0 it’s now /dev/zwave.

Looking for a little help. Can’t get VMware Workstation to pass this dongle through to my HassOS VM. I’ve tried installing the CH341S98 driver on my machine but I’m not sure it’s actually updating the driver. My device manager isn’t showing any conflicts. When I try to mount the drive in Workstation it’s listed as QinHengh USB Input Device but it’s always unsuccessful.

Has anyone been able to get theirs working in the same manner?

What host operating system are you running the VMware on (Windows, Mac OS,…)?

I’m not super familiar with VMware but it can’t be much different than the rest. What does the device show up as in your device manager (on the host, not in the vm)?

Which CH341 drivers did you install and where?

Sorry for all the questions, just want to better understand your setup and what you did.

Well I moved my wyze hub to a USB port on the back of my PC an it’s working now. Thanks for the follow-up questions.

Just to answer, host OS is Win 10 1809
Downloaded my drivers from here: https://www.srishtirobotics.com/more/blog/154-arduino-uno-r3-clone-ch340-ch341-usb-driver / installed the 64 bit version.

There was some discussion, but it was unclear whether anyone was able to successfully get the ha-wyzesense component to work using Hassio on Synology. On my system, the wyze dongle is mounted as /dev/usb/hiddev8, which is obviously not the hidraw that the component requires. Here’s the error that I get:

2019-11-09 21:24:00 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.wyzesense
2019-11-09 21:24:00 DEBUG (SyncWorker_4) [custom_components.wyzesense.binary_sensor] WYZESENSE v0.0.4
2019-11-09 21:24:00 DEBUG (SyncWorker_4) [custom_components.wyzesense.binary_sensor] Attempting to open connection to hub at /dev/usb/hiddev8
2019-11-09 21:24:00 DEBUG (SyncWorker_4) [custom_components.wyzesense.wyzesense_custom] Start Inquiry...
2019-11-09 21:24:00 DEBUG (SyncWorker_4) [custom_components.wyzesense.wyzesense_custom] ===> Sending: Packet: Cmd=4327, Payload=<None>
2019-11-09 21:24:00 DEBUG (SyncWorker_4) [custom_components.wyzesense.wyzesense_custom] Sending: b'aa55430327016c'
2019-11-09 21:24:26 WARNING (MainThread) [homeassistant.components.binary_sensor] Setup of platform wyzesense is taking over 10 seconds.
2019-11-09 21:24:28 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up platform wyzesense
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 150, 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 82, in setup_platform
    ws = beginConn()
  File "</usr/local/lib/python3.7/site-packages/decorator.py:decorator-gen-2>", line 2, in beginConn
  File "/usr/local/lib/python3.7/site-packages/retry/api.py", line 74, in retry_decorator
    logger)
  File "/usr/local/lib/python3.7/site-packages/retry/api.py", line 33, in __retry_internal
    return f()
  File "/config/custom_components/wyzesense/binary_sensor.py", line 80, in beginConn
    return Open(config[CONF_DEVICE], on_event)
  File "/config/custom_components/wyzesense/wyzesense_custom.py", line 561, in Open
    return Dongle(device, event_handler)
  File "/config/custom_components/wyzesense/wyzesense_custom.py", line 297, in __init__
    self._Start()
  File "/config/custom_components/wyzesense/wyzesense_custom.py", line 492, in _Start
    self._Inquiry()
  File "/config/custom_components/wyzesense/wyzesense_custom.py", line 398, in _Inquiry
    resp = self._DoSimpleCommand(Packet.Inquiry())
  File "/config/custom_components/wyzesense/wyzesense_custom.py", line 393, in _DoSimpleCommand
    self._DoCommand(pkt, cmd_handler, timeout)
  File "/config/custom_components/wyzesense/wyzesense_custom.py", line 379, in _DoCommand
    self._SendPacket(pkt)
  File "/config/custom_components/wyzesense/wyzesense_custom.py", line 331, in _SendPacket
    pkt.Send(self.__fd)
  File "/config/custom_components/wyzesense/wyzesense_custom.py", line 106, in Send
    ss = os.write(fd, pkt)
OSError: [Errno 22] Invalid argument

Silly question but do you have a USB Controller attached to your VM?
I was using the HassOS VM and after some troubleshooting I found that image is missing the USB Controller, after adding that I was able to pass the Wyze USB device into my VM.

That was my first issue. Once I added the controller I ran into the other issue, but that has been resolved. For some reason my front USB ports weren’t passing the info along, but the back ones work just fine.

Is anybody else having problems with this integration as of late? I keep getting this in my logs, but I’m not sure how to fix it. The problem is mentioned on the GitHub for the plugin, however it does not offer a solution.

I have tried downgrading both HassIO and the plugin, as well as completely removing the plugin and reinstalling.

Error while setting up platform wyzesense

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 150, 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 85, in setup_platform
    result = ws.List()
  File "/config/custom_components/wyzesense/wyzesense_custom.py", line 507, in List
    sensors = self._GetSensors()
  File "/config/custom_components/wyzesense/wyzesense_custom.py", line 479, in _GetSensors
    self._DoCommand(Packet.GetSensorList(count), cmd_handler, timeout=self._CMD_TIMEOUT * count)
  File "/config/custom_components/wyzesense/wyzesense_custom.py", line 384, in _DoCommand
    raise TimeoutError("_DoCommand")
TimeoutError: _DoCommand

I had the same problem and I tried a bunch of things, and sorry not sure what actually fixed the issue as I had some other things going on at the time, but eventually have it working again.

I did try using this custom code and had the antena working for a bit
https://github.com/kevinvincent/ha-wyzesense/issues/29#issuecomment-533622774

Then it stopped again after another reboot.

I did put the antenna back in my camera and removed a couple of sensors that were listed. Reinstalled the antenna back in HASSIO and was able to scan and remove again. I made sure to remove all sensors that were listing in /config/.storage/core.entity_registry. I used the wyzesensor remove utility to remove them. I then re added and I seem to be good again.

I think the issue might be from having sensors left in the antenna when I had it on the camera? Just a theory.

btw: do you have a solid blue light on the antenna?

On my system, the wyze dongle is mounted as /dev/usb/hiddev8 , which is obviously not the hidraw that the component requires.

I have the same Problem on my Xpenology Nuc - is there any way to get this working?
I bought them in the US and shipped them to Germany through a friend - would be a disaster if i couldn’t use them.

Recently been having a similar issue - wyzesense sensors disappear when restarting/rebooting HASSIO. Also, wyzesense.scan/remove services disappear.

Environment:

  • Hassio (0.101.3)
  • Running on a Virtualbox VM
  • Host OS: Windows 10 Pro.
  • Wysesense custom component by Kevin Vincent (Installed via HACS).

Might have been a coincidence but the issue seems to have started when I added a contact sensor that did not return the mac address portion when I ran the wysesense.scan service. In other words, instead of returning something like: binary_sensor.wysesense_xxxxxxxx it just returned binary_sensor.wysesense. (I assume the sensor was defective). (Could this have corrupted a device table stored within the bridge causing the bridge firmware to crash?)

Based on a comment in github (/kevinvincent/ha-wyzesense/issues) I found the following solution that works for me:

  • Press the square button on the wysesense bridge to reboot it (Note: blue light on bridge will flicker when you press and release the button and will turn solid blue again after a while). Restart/reboot hassio to restore the sensors. Please note, pressing and holding the button on the wyzesense bridge will reset it completely (turning light yellow) and you’ll have to re-add all your sensors again.

Hope this works for/helps those that are having similar issues.

1 Like

I had the exact same issue with the no-MAC sensor, it was quite strange honestly. Ended up resolving my own issue, but wasn’t aware of that solution so something to keep in mind.

@dariopb How do I install gosense on a separate raspi/linux box? I went and checked your github page but I couldn’t follow how to install and get it to work on a machine that did not have my HA instance. thanks.

@dariopb I ran the command from my pi:
sudo docker run -it --rm --net host -v /home/pi/gosenseapp/app.yaml:/app.yaml --privileged dariob/gosenseapp-pi:latest

Then got this message:

Unable to find image ‘dariob/gosenseapp-pi:latest’ locally
latest: Pulling from dariob/gosenseapp-pi
numbers and letters: Pull complete
Digest: sha256:bunch of numbers and letters
Status: Downloaded newer image for dariob/gosenseapp-pi:latest
ha-gosenseapp starting…
ERRO[0000] read app.yaml: is a directory

Not sure what this means. Please help!

has anyone had the problem of no mac address?
my two door sensors are both showing up like this and I’m only able to add one. any idea?
mac: “\0\0\0\0\0\0\0\0”
device_class: door
timestamp: ‘2019-11-30T12:07:17.507000’
rssi: -59
battery_level: 80
friendly_name: patio door