Wyze sense sensor integrations

I hope this helps others.

5 Likes

Don’t know if it’s just me, but I updated to latest version of ha-wyzesense through HACS (d4079eb) and now none of my sensors are showing up. The entity ID’s seemingly never show up, it’s like it’s not loading at all. I am running Hassio on a RPi3B+ with latest stable version of HA. Didn’t touch the Wyze configuration or basically anything else today, besides updating HACS to v13 and WyzeSense to latest.

And unlike other integrations in HACS this doesn’t seem to use versions/releases so there is no way for me to roll back to the previous version (through HACS at least).

It was working perfectly fine a few hours ago and I was even saying in Discord and Reddit that I had no issues, so I guess I jinxed myself haha :stuck_out_tongue:

Love this integration and all the work @kevinvincent and HcLX did. Amazing job! Had to do proper video after the live stream as it was just too good. I’m all about the DIY and doing the ESP8266 thing with PIR sensors without batteries but wow, these are stupid simple and just work.

2 Likes

The only that was made was to the readme file. I am upgrading now to see if there is an issue on my end.

Update:
@SeanM, I just finished the update and all my sensors are working.

Thanks for checking, I’ve got it working now after a few more restarts (knock on wood). One time the motion sensor showed up but not the contact sensors, which was kinda weird. Not sure what caused this seemingly out of the blue, but I posted my logs on Kevin’s Github repo.

On a side note, I didn’t realize that majority of the updates through HACS were solely for minor changes to the readme file, I could’ve saved a bunch of unnecessary restarts (kinda time consuming on my Pi). Thanks for pointing that out as well :slight_smile:

Makes me wonder if this isn’t related to hassio. I am running Ubuntu 18.04 on some beefy hardware and then the docker version of home assistant. I know I saw Kevin post on github that there may be issue with the alpine change for hassio and this component.

@SeanM So the motion sensor showing up but not the contact sensor is a built in recovery mechanism. Basically when the component starts up it tries to get a list of paired sensors and add them to HA with the last known state. It is technically okay if that fails (your sensors will just show unavailable). However whenever the sensor triggers, it will be added to your entity list and updated to the correct state even if the first step fails. Basically what happened in that case is the sensor listing at the beginning failed but at some point it got an event from the motion sensor and added it the list when that happened. The same would have occurred for the contact sensors if they were triggered.

I have some thoughts on how to increase the reliability. I may send you a modified copy to test it out if I can’t reproduce it on my end tonight.

Also I have yet to update to the latest alpine linux based container but I will get to that tonight and report back.

EDIT: Looks like hass.io has always been and will continue to be based on Alpine Linux. As a result, nothing is changing there so it can’t be that.

That makes sense. But the problem is that even after I open a window/door and witness the red light blink on the sensor it’s still not making the entity appear in HA (except for the one time with the motion sensor i mentioned).

For me at least, the only way to get them to show up is to restart HA, sometimes more than once. And this only started happening for me yesterday for some reason, was working 100% perfectly before that.

I’ll enable debug logging and will keep an eye on things.

Out of curiosity are all of you, @SeanM, having issues since switching the wyze hub from the camera or new setup’s?

Something to try is call the wyze.remove and remove all your sensors. Reboot and then rrsync them. This is starting to sound like an issue I had.

Go to services, select wyzesense.remove and past the following change the mac address(you will need to do this for each install).

{
  "mac" : "777A4656",
  "mac" : "777A4657"
}

Wyze sense was connected to the camera, paired everything and then switched. After doing the above steps everything has been rock solid.

1 Like

Right after unboxing the starter kit I plugged it into my RPi and set the sensors up through the wyzesense.scan service. So the hub was never plugged into the camera and none of the sensors were ever added to the app or anything like that - 100% through Home Assistant. I haven’t migrated devices or changed my setup in any way either, that’s why this is so weird to me.

That’s something I could try though if this keeps happening.

@SeanM I created an issue for you on Github: https://github.com/kevinvincent/ha-wyzesense/issues/11

Let’s discuss this there. It’s easier to triage and communicate on there.

1 Like

Thanks @kevinvincent

For those reading the messages above about instability during a restart, a new update I pushed out seems to have improved that a lot. Seems to be affecting Pi’s mainly. Please update through HACS or manually depending on your install.

I’ve been playing around with both setups and so far they are working great for me. I have Wyze Sense Component configured in HA running on Intel NUC Hassio setup. which communicates with the sensor in the house. For my detached garage/workshop I setup a Raspberry PI with ha-gosenseapp to send the garage sensor data back via MQTT. Really appreciate the work.

Hi everyone, I’m trying to integrate the hub into my HA setup but I’m struggling. Im running HA in a NUC that runs Ubuntu 18.04.3 LTS and Hassio in a docker. The issue is that ubuntu doesn’t recognize the usb hub. I followed the instructions on the video by @digiblur without success. Any suggestion?

me@hass:~$ ls /dev/hidraw*
ls: cannot access ‘/dev/hidraw*’: No such file or directory

and

core-ssh:~# ls /dev/hidraw*
ls: /dev/hidraw*: No such file or directory

do you need to manually pass that into your container?

I don’t think so, other usb devices like the zigbee2mqtt dongle shows up automatically.

Now, it’s working after testing with different usb devices.

I am running hass.io on my synology and I installed it using the instructions from Frenk here. I am struggling to get /dev/hidraw0 to be visible in the docker container that is running hass.io.

I tried updating the file: /usr/sbin/hassio-supervisor with the --device param - but no luck:

#!/bin/sh
set -e

# Load configs
CONFIG_FILE=/root/snap/docker/common/hassio/hassio.json

SUPERVISOR="$(jq --raw-output '.supervisor' ${CONFIG_FILE})"
HOMEASSISTANT="$(jq --raw-output '.homeassistant' ${CONFIG_FILE})"
DATA="$(jq --raw-output '.data // "/usr/share/hassio"' ${CONFIG_FILE})"

# AppArmor Support
if command -v apparmor_parser > /dev/null 2>&1 && grep hassio-supervisor /sys/kernel/security/apparmor/profiles > /dev/null 2>&1; then
    APPARMOR="--security-opt apparmor=hassio-supervisor"
else
    APPARMOR="--security-opt apparmor:unconfined"
fi

# Init supervisor
HASSIO_DATA=${DATA}
HASSIO_IMAGE_ID=$(docker inspect --format='{{.Id}}' "${SUPERVISOR}")
HASSIO_CONTAINER_ID=$(docker inspect --format='{{.Image}}' hassio_supervisor || echo "")

runSupervisor() {
    docker rm --force hassio_supervisor || true

    # shellcheck disable=SC2086
    docker run --name hassio_supervisor \
        --privileged \
        $APPARMOR \
        --security-opt seccomp=unconfined \
        --device /dev/hidraw0 \  <--------- THIS IS THE LINE I ADDED
        -v /var/run/docker.sock:/var/run/docker.sock \
        -v /var/run/dbus:/var/run/dbus \
        -v "${HASSIO_DATA}":/data \
        -e SUPERVISOR_SHARE="${HASSIO_DATA}" \
        -e SUPERVISOR_NAME=hassio_supervisor \
        -e HOMEASSISTANT_REPOSITORY="${HOMEASSISTANT}" \
        "${SUPERVISOR}"
}

# Run supervisor
mkdir -p "${HASSIO_DATA}"
([ "${HASSIO_IMAGE_ID}" = "${HASSIO_CONTAINER_ID}" ] && docker start --attach hassio_supervisor) || runSupervisor

Any ideas for me?

Thanks for any help you can provide!

Tom

…and replying to my own question - it doesn’t matter that I don’t see a device named /dev/hidrawx.

Configuration worked worked fine and everything working so far. Thank you so much for this, I’m thinking of replacing some finicky xiaomi sensors!