[RELEASE] Alpha WyzeSense Integration

So looking through your debug logs, it looks like the Telnet driver is having issues on the Hubitat controller (hence the Java errors). Since you're getting the telnet session opened, that is a sign that the Pi is configured with telnet correctly so we can rule out base connectivity issues.

Have you tried running the WyzeBridge software manually? You can do this by connecting to your Pi with SSH and the supplied credentials. Once logged in, run the following command:

sudo reset && sudo sh -c /home/pi/WyzeSensePy-master/hubitat.py

If it runs successfully, you should see some output showing the USB information and then you can test a sensor (if you have one paired). If you get an error here, post that because that may tell us what is going on. Likely the telnet command/script is getting an unexpected result and throwing an error in the driver handler. To close that window, just CTRL-C to close it and log out (exit) the SSH session.

Let me know what you find.

No problem and I understand the work issues anyhow after I redone the Pi software and reinstall the WyzeSense . Here is my logs. I also ran the sudo reset and I get the folloowing error on the SSH "syntax error: newline unexpected"

dev:32742020-01-21 07:01:22.340 am debugSending msg = sudo reset && sudo sh -c /home/pi/WyzeSensePy-master/hubitat.py

dev:32742020-01-21 07:01:22.339 am debugStarting Wyze Hub software...

dev:32742020-01-21 07:01:18.863 am debugTelnet session opened!

Are you using another language on your Pi other than English or UTF-8 character sets? If so, that could be part of the problem. The 'newline unexpected' indicates that there may be a problem with the script on your particular installation due to locality settings on the Pi. I do develop on a Mac but Github should make sure the line endings are correct no matter where you download it.

Another issue could arise if you copied the text from the Github page instead of downloading the zip file or using the raw output -- that could add incorrect quotes (think of the jacked up quotes that Windows sometimes uses) or other strange characters to be added to the text.

Without having access to your Pi, I'm not sure what other options to give you since this is something very specific to your installation. The software isn't great but, at least in my installation, it has been extremely stable without any issues.

Just reading back up on this thread...

Adding the Device Name or Device Label wouldn't really be easy to do in the debug since that is just parsing the input from the serial line. You could always modify the device handler to hard code your own names instead of the sensor raw output name if you'd like. Such example in psuedocode might be:

if (sensor == "7797936F") {
  sensorName = "LivingRoom"

and then in the script it'd be something like:

print "Sensor (" + sensorName + ")" .....

It's not ideal but it might get you what you want. Don't forget that you can change the Device Name of the child devices after they've been created so you can easily identify them in the rest of your system.

As far as creating the child devices... I found it best to have the log open and trip the device once or twice, then it will say that it doesn't exist and should process the AddChild process in Hubitat to create it.

Thanks for getting back to me and I look at the UTF-8 and the language in the Locale and it's as it should be and hopefully fix the Hubitat.py file and when I run it with the command

sudo reset && sudo sh -c /home/pi/WyzeSensePy-master/hubitat.py

I get the following error
OSError: [Errno 32] Broken Pipe any ideas what that is and Thanks for you help.

I have noticed that I will stop getting notices on the Wyze Telnet for the Wyze devices without warning. The Telnet is still connected as is the bridge; however HE isn't getting any notification of motion or open/close. It's easily corrected by stopping Telnet and then restarting it then restarting the bridge. First, any suggestions on what might be happening? As an alternative, is there a way to automate disconnecting Telnet, reconnecting Telnet, and re-starting the bridge either in RM or another way that I could do nightly? Maybe using Node Red on my Pi? In the meantime, I have set a health check Rule that runs as a dead-mans switch.

@joypixel I have the same problem that you had where the telnet was connected but no the Wyze hub can you share if and how you solve the problem? Thanks

@leeonestop For me, Step 10 fixed the problem. May I ask how did you copy hubitat.py file to raspberry pi?

How are you guys connecting your Pi to the network? Wifi by chance? I have mine on Ethernet and telnet to HE has been rock solid for weeks at a time. The Pi, especially the earlier models, isn't known for having exactly reliable wireless connectivity. Also what version of HE are you running (software and hardware). I have the C-5 hub running (latest I believe). I should note that I have a Lutron hub, too, that connects via telnet and it seems to maintain a constant connection with no problems either.

I do need to come up with a few update items but time just hasn't allowed right now -- seems like someone is either sick or in the hospital in my house every day this month!

  • Auto reconnect (telnet mostly)
  • Some kind of monitoring for the WyzeHub service so if it is down, it will fire off a disconnect and connect event that will 'reset' everything.

I don't know what the feasibility of some of these items are going to be since a lot of HE is undocumented... but I'll see. I got this far with a lot of Googling with a sprinkling of trial and error.

I forgot to mention that make sure you have a quality power supply on your Pi. It is a finicky beast when it comes to power requirements and a slightly dirty/cheap power supply from the Big Rock Candy Mountain (aka China) will give it grief. Make sure that your power supply is at least 2A (preferably 2.5A) or higher as well.

@joypixel I will go back and look at step 10. I when to the code and pull up the raw version and copy and save as? Is that the way to do it or should I do it another way? Thanks

Just wanted everyone to know that I solve my problem with the WyzeSenseHub. I when into the hubitat.py and change the dev/hidraw0 to dev/hidraw3. Because of the keyboard and mice my Wyze defaulted to hidraw3. It took me a while to do this as I'm not good with code. But I found the following code ""dmesg | grep hidraw"" and try it and it work and show me the hidraw devices and from there I figured which one was for the Wyze.

Glad you got it fixed! It is noted in the documentation that your device may have a different name than hidraw0. If you continue to run with keyboard and mouse attached, there is a risk that hidraw3 may not always be the right device -- you may have to setup udev rules to lock your Hub into a specific device ID. That is outside the scope of this forum though!

Hint: here's an article that will get you down the right path... linux - How to bind USB device under a static name? - Unix & Linux Stack Exchange :smiley:

Setting up the bridge

Setting up your bridge is pretty simple. Simply plug in the USB device to your Pi and it should show up as /dev/hidraw0. If you have other hidraw devices, it may show up as hidraw1/2/3/etc. You should have an orange solid light on the bridge.

@kellykoehn128 I knew it was there but didn't know how to look for it but I'm learning. Thanks and I will look at how to set up a static name. One other question once I added a product a contact sensor to the Wyze hub the orange light on back of the hub is out? should it go back to the orange or stay off? I hit the X to exit sample.py. Really appreciate the help.

How do I going about changing the name of the devices once they are in as I try to change the name and it added another devices with the new name that didn't work but keep the original one that still works? The first one that I added gave me an Device number of ????????? Pic attached but the second get me a device number and I have been able to change name etc just that first with the ????

I'm not sure why you are getting the question mark... that is usually caused by non-printable characters. You've either got a locality issue on your Pi or .....? I'm not sure. The DeviceNetwork ID you cannot change and given you are having non-printable characters added, you're going to have problems. The Device Label, which is what shows up across the system, can be changed by just changing it.

I don't know either as I have unpair and re pair and get the same results. I will just use it and see how it goes. So, far it working good and the sensors are faster than what they were on the Wyze hub. Thanks for your work and help.

I have a strange issue in that I have three separate Wyze Contact Sensors that are using the same name and device ID which is the one with the question marks and I don't know how to separate them into three separate devices. I have delete them but when I rejoin them independently that all join as one if that make sense it seems like they are all just one sensor. I have never seen anything like this but I brought some new Wyze contact sensors and they join with there own device id and name? Any ideas what is causing this? Thanks

I wanted to follow up on an issue I am having. I am still experiencing the Bridge just stop registering any of the motion or contact sensors. I have a Rule that if none of the Wyze Sensors report for 6 hours, it sends me a notification that the bridge might not be working. I then go and disconnect telnet, reconnect telnet, and restart bridge and that fixes problem. Anyone else experiencing this?

First, any suggestions on why the bridge would stop? Second, is there any way within the driver that it can check that and warn the user immediately when it becomes unresponsive?

Barring that, I am curious if there is a way to automate disconnecting telnet, reconnecting telnet, and starting the bridge? I noticed in the driver that there is a command line for Raspberry pi "sudo reset && sudo sh -c ${wyzeSensePyScriptPath}/hubitat.py". Does that stop then restart the bridge? If yes, any issue if I set up an automation using RM and Node Red that runs that command on my Pi when my "Health Check" rule determines that there has been no activity for given time?

Thank you.

I had that problem yesterday and I had to stop and restart the bridge. It seems to be ok this morning. I also was wondering if there is any way to restart the bridge automatically also. Thanks