Wyze sense sensor integrations

HA 0.110.5. Wyze sensor integration failed to start with below error. anyone has this? how to fix it?

2020-06-07 18:35:49 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 78, in setup_platform
    _LOGGER.debug("Attempting to open connection to hub at " + config[CONF_DEVICE])
TypeError: can only concatenate str (not "NoneType") to str

I’m new to HA so I may be missing something obvious…

I had several devices connected to my WyzeCam and functional through IFTTT. I moved the USB “sense” dongle to my Raspberry Pi running Home Assistant v4.8 image.

I downloaded the .zip and moved the “wyzesense” directory to /config/custom_components.

It didn’t work. The “retry” Python component doesn’t seem to exist in this image. But I found that extra online and added it as a “retry” directory under “wyzesense” and now it seems to work. The dongle shows a blue light instead of a yellow one. (I also tried commenting-out the import and the @retry decorator, which also let it run.)

Everything seems happy but none of the devices I had previously paired appear in HA. Nor are there any Notifications about new devices or integrations. Activating a open/close sensor does nothing.

There is talk of various services (e.g. scan, remove) but I don’t understand how I’m suppose to call them from the HA UI.

How do I get my paired devices to appear?

– Brian

In Home Assistant, open the sidebar and select “Developer Tools” and then select the “States” tab on this page. That will show all your entities in alphabetical order - look to see if you have any starting with binary_sensor.wyzesense_ which I believe is the default naming scheme.

The “Services” page is one tab over and if you select the dropdown and type in “wyze” you will see the scan and remove services. To pair you just select wyzesense.scan from the dropdown, then press the “Call Service” button underneath, and you will have 30 seconds to pair it (by inserting the pin into the sensor until the red light flashes). If it was successful you will get a notification in Home Assistant.

Thanks! That’s what I was missing. I’m now able to turn on/off my window fan when the window opens/closes.
– Brian

There doesn’t seem to be any support or development on the wyze_sense custom component or the underlying WyzeSensePy project that it is based on. I use these sensors a lot and I’m toying with turning this into an official integration. It doesn’t really buy us much as far as functionality, but at least it can be supported better going forward. Thoughts?

@kevinvincent, would you be interested in submitting the first go at this or should we take your code and adapt it?

@hassbrad Unfortunately I don’t have time to support the integration anymore or work on submitting this as an official integration but if someone else would like to I’d appreciate it!

I appreciate the response. I hope my comment didn’t come across as me complaining about you as I completely understand not having time to support every hobby I have all the time. I’ll get the dev environment setup and see what I can do!

1 Like

Oh not at all! Honestly I feel really bad creating this and not being able to support it. I’ve got work and school thats been taking way too much of my time :frowning: Good luck!

1 Like

Greatly appreciate all the work you’ve done on this integration! It has been rock solid for me after all these months of use.

Hopefully others like @hassbrad can build upon it further and eventually get it into core. It would be a very popular core integration as these sensors are so cheap and readily available.

Just here to say thanks to @kevinvincent its been working great for me, in a venv on an actual computer running core with no docker/etc…occasionally drops all sensors until a reboot. Very much appreciated for the work. Dont feel bad you’ve made my setup awesome with it.

Also. looking forward to any new updates/official integration. Thanks for picking it up @hassbrad

Thanks for creating it. It works very well for me using these very inexpensive sensors.

Another thank you from a nobody for creating it. I hope someone can pick up where you need to leave off for now. Truly one of the most useful integrations I run.

@henry8866 i am getting the same error. I think it has to do with the last upgrade of home assistant. It was working on 110 and now that i am on 111 it is dead. I get the same exact error as you. Nothing works and the component does not show up in services.

Tim

check if your bridge is working, unplug it and plug it in, restart HA. this fixed for me.

I am so completely new to all of this, so I apologize for my ignorance and ask for patience. I setup my Raspberry Pi 4b today and loaded all of my wyze bulbs, outlets and sensors into Home Assistant. At this point, I have absolutely no idea how to get them integrated together, for example, if the bathroom sensor senses motion, then turn on bathroom bulbs 1, 2 and 3. If anyone would be so kind as to help me out with perhaps an example that I can then modify for all of my things, I would be beyond appreciative. I have no idea what the next step is to get things linked and automated.

I just had my second sensor fail due to no mac address. Battery level showed over 85% before the failure. Not sure why a battery going dead would cause the device to lose it’s MAC address? Should be store in ROM. Has anyone been able to recovery the device after this failure?

Check out this thread on the Wyze forums. Seems like an issue that may only be resolved by sending in your sensor for a replacmeent. It’s probably a good idea to start replacing batteries around the 85% mark to avoid this issue.

Ha, nevermind, looks like you already commented there!

I got one working again (not sure why), the other one still blinks 5 times instead of 3. Called support and they are replacing it. Why did you pick 85%?

85% is just a made up number based on how my devices are draining over time and the Wyze recommendation that the batteries last about 12 months. The problem is that these sensors do not report battery life until they are actuated. So just because HA reports battery at 85% does not mean that matches reality. The sensor is sitting there in a low power state very slowly draining the battery and not letting you know.

I have roughly 20 sensors in my house right now, but only 2 are down to 87% so far. They are working fine, but it depends on if you want to chance them running out by the next time you use them and see the battery is low. I’m going to trend all of my Wyze sensor battery levels and see when they start to drop off. I’ve got several spares so I’m going to see if I can get some to brick themselves and try to revive them.

The last one that failed was used on my mailbox. I have an automation that runs daily. The last time it reported correctly it read 85% battery.