Wyze sense sensor integrations

I’m most likely looking/asking in the wrong place but I’m curious if anyone has gotten the Wyze sensors working with the dongle plugged into the back of the cam? I can’t really plug the dongle into my HA machine and it’s a far ways from where I’ll be mounting the sensors/camera.

That is how the sensors are designed to work. They work fine plugged into the cam as designed- of course they can’t talk to HA directly in that configuration. The sensors talk to the cam which talks to the wyze servers which talks to IFTTT which can then talk to your HA instance.

Anyone able to get it working in NUC (venv)? I keep getting Permission denied: '/dev/hidraw0' whatever I do.

I run gosenseapp on a raspberry pi. if i start the docker with

sudo docker run -it --rm -v /home/pi/gosenseapp/app.yaml:/app.yaml -p 9999:8080 --privileged dariob/gosenseapp-pi:latest

it run perfectly, but as soon as I close down the ssh connection to the pi the docker seems to stop.
Therefor I tried to use docker-compose

  gosense:
    image: dariob/gosenseapp:latest
    volumes:
      - /home/pi/gosenseapp/app.yaml:/app.yaml
network_mode: host
    privileged: true
    restart: always
    ports:
      - 9999:8080

but the log file shows an error:

ha-gosenseapp starting...
time="2019-12-07T19:47:50Z" level=info msg="Looking for sense dongle in /dev/hidraw*"
time="2019-12-07T19:47:50Z" level=info msg="Found sense dongle in [/dev/hidraw0]"
time="2019-12-07T19:47:50Z" level=info msg="NewWyzeSense: trying to open device: [/dev/hidraw0]"
time="2019-12-07T19:47:50Z" level=error msg="Failed opening device: {open /dev/hidraw0: no such file or directory}"
time="2019-12-07T19:47:50Z" level=error msg="open /dev/hidraw0: no such file or directory"

Any one know how to correct this error?

Hey @PatrikPatrik, I think what you are looking for is the -d option, so your command line would look like this:

sudo docker run -d -it --rm -v /home/pi/gosenseapp/app.yaml:/app.yaml -p 9999:8080 --privileged dariob/gosenseapp-pi:latest

That option will detach it from your ssh session and it should run in the background.

1 Like

Any chance wyzesense is causing .103 update to fail?

My first time trying wyze devices and I have an issue that hopefully someone can help with. So I bought two sense kits and figured I’d try one sensor before I start replacing them all. Since my mailbox sensor recently died for good I figured I’d start with that. At first it was reporting correctly but after trying again a few hours later I noticed a lot of inconsistency. It’s been reporting open now for the last two hours even though I could see the red light blink each time I opened and closed it. I’m pretty sure it’s either due to the distance between the hub or the fact that the mailbox is all metal. Or maybe even a combination of the two. However when my zwave sensor was working it remained consistent in the same metal mailbox so I don’t know what to make of that besides having a few repeaters upstairs that may have helped.

Anyway, my question is since I have two sense hubs is there a way I can use the second one as a repeater by hooking it up to one of my wyze cams or something? Or do wyze sensors not work like zwave does? I suppose since my HA instance is on a VirtualBox on a windows laptop I could try moving it a little closer to the mailbox but I’d rather not do that if there is another solution since I have the computer tucked away nicely in my network closet at the moment. Any insight would be greatly appreciated.

Also rssi is reading - 102. What’s the lowest it can safely be?

You may have gotten lucky at first. Your metal mailbox is effectively acting as a Faraday cage, blocking all electromagnetic signals from escaping. I would test it with the mailbox open and use a spare magnet to trigger the switch. I bet it will work then. I’m not sure how to solve this except to create a plastic enclosure on the outside of the mailbox to store the sensor in and keep it out of the elements.

I’m taking a few educated guesses here. So these answers may be proven wrong.

I don’t believe the “hub” can be used as a repeater. However, if you use gosenseapp, there’s no reason you can’t have more than one RasPi in the same place you’d put a repeater to have basically the same effect.

There’s no exact value for an acceptable rssi. However, I’d say anything less than -75 will likely be unreliable.

Thanks for the reply. I figured that might be the case. I moved my laptop about 15 feet closer to the mailbox and even attached the hub to a 6ft USB extension cable but the rssi hasn’t changed at all.

I found a thread yesterday where someone posted a picture of a copper wire connected to the internal antenna of the sensor, coming out of the enclosure, to boost the signal. The comments from people who have tried it suggests that it works based on the signal increase it reported after. Do you think it might help if I try this and take the end of the wire and stick it through one of the holes at the bottom of the mailbox? Or would it still act as a faraday cage since the sensor will remain inside?

Thanks for the suggestion. I thought about doing this but since I don’t have an extra Rpi laying around it would be an expensive way to get this sensor working. If I ever do get another pi as a gift I will be sure to try this.

Has anybody used the door and window senors in the cold? I imagine it would kill the battery, right? I’d like to put one on my garage door, but it can get down to -30F here so I wonder if it is even worth trying.

I have 7 contact sensors on exterior doors for over three months. They have been repeatedly exposed to 20f for days on end with 13f the lowest they’ve gotten. They have been working fine so far. Around here we only get to about -10f at its worst so time will tell.

I also have a few of the motion senors mounted outside without issue (so far). One is in what I’d call extreme conditions. It’s near a lake side and gets blasted with rain and wind driven snow. I tested it during the worst point of a recent ice storm and it worked.

I figure for $5 I can replace a sensor here or there as needed. Several years ago I invested in a “high-end” driveway motion sensor alarm system. I wanted reliability with no false alarms. It is designed specifically for outdoors and driveways. Under 32f and it doesn’t work consistently and the false alarms are common. These cheap wyse sensors have actually proven more reliable at this point.

Furthermore, to the previous comments, I’ve found the signal strength to go out to about 200’ LOS. It does vary dramatically when inside based on construction. I use five Raspberry Pi Zeros in five different houses running the GoSense docker. Only issue so far has been the Pi’s would randomly lock up. That was traced back the the Pis WIFI power management. After turning that off all the Pi’s have been working great for 2 months now.

i’m curious if anybody has a solution for implementing the “auto” mode on Docker. I appreciate not having to update the binary_sensor config as just putting /hidraw/auto works fine, but having to adjust/find the correct entity after a reboot/random hidraw change and update the docker device command is…annoying.

I am seeing Permission denied: '/dev/hidraw0' error. Can someone confirm the file permissions that I am seeing? Do these look right? I am using a venv installation on an Intel NUC.

arsaboo@aloknuc:/home/homeassistant/.homeassistant$ ls -la /dev/hid*
crw-rw-r-- 1 root homeassistant 241, 0 Dec 15 20:14 /dev/hidraw0
arsaboo@aloknuc:/home/homeassistant/.homeassistant$ ls -la /etc/udev/rules.d/
total 76
drwxr-xr-x 2 root root  4096 Dec  5 11:07 .
drwxr-xr-x 4 root root  4096 Dec  5 08:52 ..
-rw-r--r-- 1 root root   923 Aug 31  2018 70-snap.canonical-livepatch.rules
-rw-r--r-- 1 root root 58549 Feb 19  2018 70-snap.core.rules
-rw-r--r-- 1 root root    75 Dec 17 12:28 99-com.rules

Im in the same situation, any help would be appreciated a lot.

I also have this installed via Hassio / Docker on Ubuntu. My Zotac Z-Box rebooted today when I cut the power to install a replacement device, and the computer would not boot back up while the Wyze hub was connected - I have it on a USB extension cable since the hub won’t sit flush with any of the USB ports on the Z-Box, so that may be a contributing factor, but I kept getting a USB enumeration error (-110, indicating a power issue). Unplugging the Wyze hub and rebooting allowed things to proceed just fine, and once the computer booted I plugged the hub back in and seems to be working fine (I have it set to auto and it seems to have correctly discovered the hub as the sensors are working). Would like to make sure the computer can boot up correctly without manual intervention, though. Any suggestions on how to accomplish this?

I’m trying to set this up but having issues.
Running hass container in ubuntu, which is installed in virtualbox in windows. I’ve installed extension pack so usb is visible to ubuntu.

$ ls -la /dev/hid*
0 crw------- 1 root 244, 0 Jan  5 12:57 /dev/hidraw0
0 crw------- 1 root 244, 1 Jan  5 13:26 /dev/hidraw1

rule file added:

$ cat /etc/udev/rules.d/99-com.rules
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0664", GROUP="hass"

note the group is hass since this is the group I found at /etc/group

config:

binary_sensor:
  - platform: wyzesense
    device: auto

however upon restart hass container, it shows error on wyzesense:

2020-01-05 13:56:57 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 91, 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 89, 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 285, in __init__
    self.__fd = os.open(device, os.O_RDWR | os.O_NONBLOCK)
FileNotFoundError: [Errno 2] No such file or directory: '/dev/hidraw1'

looks like it does detected hidraw1 is the bridge but why FileNotFoundError? thanks for any help.

edit: the bridge shows solid yellow LED. when it is on wyzecam, it shows blue, not sure if this is related.

I had a working install and tried to fix it and i am now getting pretty identical errors on mine. Something appears to be broken right now.

2020-01-06 21:35:07 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 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’m trying to install too, and for the life of me can’t get past this error:

2020-01-08 14:33:51 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for wyzesense which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2020-01-08 14:33:51 ERROR (MainThread) [homeassistant.config] Platform error: sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config.py", line 761, in async_process_component_config
    platform = p_integration.get_platform(domain)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 232, in get_platform
    f"{self.pkg_path}.{platform_name}"
  File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'custom_components.wyzesense.sensor'

I’ve installed via HACS and things look ok (I think) on the file system:

root@homeauto:/var/opt/homeassistant/custom_components/wyzesense# ll
total 48
drwxr-xr-x 3 homeautouser homeautouser  4096 Jan  4 15:40 ./
drwxr-xr-x 4 homeautouser homeautouser  4096 Jan  4 15:27 ../
-rw-r--r-- 1 homeautouser homeautouser  6992 Jan  4 15:27 binary_sensor.py
-rw-r--r-- 1 homeautouser homeautouser     0 Jan  4 15:27 __init__.py
-rw-r--r-- 1 homeautouser homeautouser   281 Jan  4 15:27 manifest.json
drwxr-xr-x 2 root         root          4096 Jan  4 15:40 __pycache__/
-rw-r--r-- 1 homeautouser homeautouser   258 Jan  4 15:27 services.yaml
-rw-r--r-- 1 homeautouser homeautouser 17966 Jan  4 15:27 wyzesense_custom.py

Config is:

# wyze.yaml

  - platform: wyzesense
    device: auto

I’m running the docker version of Hass and I’m up date, so version 0.103.5. Any ideas? It looks more like a problem with the install than config.