[RELEASE] Alpha WyzeSense Integration

So I posted a teaser a few days ago on Twitter and /r/hubitat that I've been working on a WyzeSense device handler -- well here it is!

The system relies on the work of the WyzeSensePy project by HclX and uses a Raspberry Pi to act as a host for the WyzeSense bridge device. Instructions are on the GitHub page as to how you need to setup and configure the Pi.

There are three device handlers currently -- one for the Telnet Link, one for the Motion Sensor and one for the Contact Sensor. I'm not positive (I haven't looked) to see if they've come out with other sensors but those are what I have from the original kit.

Why'd you do this?
Selfish reasons really... I went on a spree of converting the whole house to Lutron switches and the wife cut off my HA spending for a while. I needed a motion sensor and these were collecting dust :slight_smile: -- thus a project was born!

This code is very Alpha and is coded with only the most perfect of situations in mind. There may be odd errors that I haven't accounted for so please feel free to suggest and/or update. This is also my first time pushing out a fresh/new device handler so go easy please :smiley:

https://github.com/kk3844/wyzebridge

6 Likes

Looking forward to trying this after the holidays. Thank you for sharing this!

I don't own a Pi. Can this be installed on Ubuntu server?

Absolutely! Most distros should work but you may have to alter the package names and/or dependencies based on what is installed with that particular distro.

1 Like

Would this conflict with anything else that might be running on the Pi 4 that i already own and have running. It's currently running Pi Hole and Node Red. If so, could this integration be handled by something as simple as a Pi Zero? I am a bigger newbie with Raspberrry Pi than I am with Hubitat.

Also, any chance a device handler could be created to pull information from their cameras? I would love a local way to get that information too.

I don't see why it would conflict with anything... unless something tries to interact with that hidraw0 device. Everything is pretty self-contained. The only issue you might is the telnet port being used already in which case you'd just change the port. You may need to adjust firewall/iptables rules, too.

As far as the cameras go, I'm not aware of any communication that the cameras have with the sensors other than what the bridge devices tells the camera. The cameras just really act as the host for the sensors and as a gateway to the internet/ecosystem. You'd be better off trying to see if an API is available for the cameras or direct endpoints that you can interact with.

If time and family permit, I'll try this on a VM of a Pi.

thanks for this. I am trying to install this on my raspberry pi. but getting an error at the part where I have to install python-builtins.
it says "E: Unable to locate package python-builtins"
please look into.
thanks.

I believe the python-builtins package was a mistake. The python-future includes the packages you need. I was trying to go through my .bash_history and mistakenly tried to install that which is where it probably came from.

I've got some other Pi's at home that I'll test a new install on to get the package list correct. In the meantime, I'll update the documentation when I get home.

I skipped installing python-builtins package and finish all the steps.
Rest installed good.
In hubitat,
TelnetSession : Connected
WyzeHubUSB : Disconnected
pressing start bridge button will not change status to connected.
and also I looked at habitat.py file it calls for python-builtins.
I don't know if that is the problem.

After working with joypixel, some changes were made to the installation process. The updated readme file should have the correct installation instructions so the device handler can run the scripts correctly.

1 Like

I just got my starter kit today and installed everything in less than 20 minutes using a Pi 4. I do want to get a USB extension cable to get the bridge away from the case of my Pi. I had a couple of small things that I wanted to mention about my experience.

In step 10 "Ensure that hubitat.py is executable: chmod +x /home/pi/WyzeSensePy-master/hubitat.py" I did that and nothing happened so I wasn't sure that told me that the file was actually an executable. I went on to step 11 but unsure. Evidently, it is/was because everything is working.

My motion sensor paired fine but I could never get it to register motion while in Terminal on my Pi. Even after going back to Hubitat and re-starting the Telnet Link and Bridge, the motion sensor still wouldn't register motion so there was no child device. Then, after about 10 minutes, all of a sudden the red light blinked on the sensor and the child device was created. All is well!!!

My comments are more for newbies like me going thru the process who barely comprehend what they are doing. I can't wait to put this thru its paces but it seems to have awesome potential. You are indirectly contributing to Wyze's income stream while simultaneously depleting my checking account. THANK YOU!

1 Like

I have had this running for just over a week, and twice, Telnet said it was connected and bridge said it was connected and motion sensors are detecting motion but the virtual device was not changing. I Each time, I disconnected Telnet, reconnected it, and then Started Bridge and it started working again. Anyone else experience the same?

I was able to successfully add 4 more contact sensors and 2 motion sensors now for a total of 9 devices. It was easy to pair them to bridge but I struggled getting the child apps to be created. With the original 3, as soon as the device did any activity, I could go to device page and they were created. This time, it took multiple tries. I had given up on #9 last night but it was created when I looked this morning. I wasn't sure if there was a way to force the parent app to look for children or not in another way.

Is it possible to add the Device Name or Device Label in addition to the Device Network ID to this line in the logs without too much work?

I learned in another thread how I can add code to turn on/off this logging but no idea how I could add the Device Name or Label.

Overall, this is a great app and is detecting motion and open/close quickly. For anyone considering going this route, I would recommend this integration based on my 2 weeks of experience. @kellykoehn128 Thank you for all of your hard work.

Can someone point me into the right direction, I got the Telnet session connected but having no luck with WyzeHubUSB? Maybe I'm missing a step and I have gone back over the instruction? Thanks

Current States

  • TelnetSession : Connected
  • WyzeHubUSB : Disconnected

@kellykoehn128 I also seeing the errors in the log? is there something I need to change or do over?

dev:32742020-01-19 07:05:25.197 pm debugSending msg = sudo reset && sudo sh -c /home/pi/WyzeSensePy-master/hubitat.py

dev:32742020-01-19 07:05:25.196 pm debugStarting Wyze Hub software...

dev:32742020-01-19 07:05:22.608 pm debugTelnet session opened!

dev:32742020-01-19 07:05:22.195 pm errorjava.lang.InterruptedException: null on line 57 (telnetStatus)

dev:32742020-01-19 07:05:22.150 pm errorTelnet connection dropped...

dev:32742020-01-19 07:05:22.149 pm infotelnetStatus - error: receive error: Stream is closed

dev:32742020-01-19 07:05:22.060 pm debugTelnet session opened!

dev:32742020-01-19 07:04:42.062 pm debugResetting telnet session / initializing

dev:32742020-01-19 07:04:30.848 pm debugSending msg = sudo reset && sudo sh -c /home/pi/WyzeSensePy-master/hubitat.py

dev:32742020-01-19 07:04:30.847 pm debugStarting Wyze Hub software...

dev:32742020-01-19 07:04:28.709 pm debugTelnet session opened!

dev:32742020-01-19 07:04:05.075 pm errorjava.lang.InterruptedException: null on line 57 (telnetStatus)

dev:32742020-01-19 07:04:04.965 pm errorTelnet connection dropped...

dev:32742020-01-19 07:04:04.920 pm infotelnetStatus - error: receive error: Stream is closed

dev:32742020-01-19 07:04:04.909 pm debugResetting telnet session / initializing

dev:32742020-01-19 07:03:58.151 pm debugSending msg = sudo reset && sudo sh -c /home/pi/WyzeSensePy-master/hubitat.py

dev:32742020-01-19 07:03:58.150 pm debugStarting Wyze Hub software...

dev:32742020-01-19 07:03:54.502 pm debugSending msg = sudo reset && sudo sh -c /home/pi/WyzeSensePy-master/hubitat.py

dev:32742020-01-19 07:03:54.501 pm debugStarting Wyze Hub software...

dev:32742020-01-19 07:02:00.676 pm debugSending msg = sudo reset && sudo sh -c /home/pi/WyzeSensePy-master/hubitat.py

dev:32742020-01-19 07:02:00.675 pm debugStarting Wyze Hub software...

dev:32742020-01-19 06:56:28.163 pm errorjava.io.IOException: Stream is closed on line 146 (connectTelnet)

dev:32742020-01-19 06:56:26.445 pm errorjava.io.IOException: Stream is closed on line 146 (connectTelnet)

dev:32742020-01-19 06:56:23.936 pm errorjava.io.IOException: Stream is closed on line 146 (connectTelnet)

dev:32742020-01-19 06:55:15.947 pm debugSending msg = sudo reset && sudo sh -c /home/pi/WyzeSensePy-master/hubitat.py

@stephen_nutt I reinstalled all of the code and reinstall Debian for the Raspberry Pi but still getting the following. Can you explain how you was able to get a fix for the Disconnected
WyzeHubUSB?? Thanks

Current States

  • TelnetSession : Connected
  • WyzeHubUSB : Disconnected

I am afraid that part just worked following the instructions so I don't know why it worked for me and not for you. You need to ping @kellykoehn128 who created this.

@stephen_nutt Thanks for the info. @kellykoehn128 I have try this now and still having trouble with getting it to connect to the WyzeHubUSB? I just reinstalled the raspberry pi software and updated all software and when back over your information and reinstalled all but still no luck. I get the Telnet is connected but the WyzeHubUsb is disconnected? Is there something else that I need to do. Thanks I have an Raspberry 3B+ I don't think that is a problem.

My apologies for the delayed reply... I've been busy with work so personal things have taken a back seat! Let me look through your posts and I'll reply back shortly.