[RELEASE] Alpha WyzeSense Integration [Code no longer being updated]

That did it, much appreciated!

It's nice to get this off of my Pi so I can free it up for something else. It's now successfully running on an Ubuntu VM from my Synology.

@dadarkgtprince @kellykoehn128

I moved my WyzeSense setup to a VM on my Synology thanks to @dadarkgtprince. I purchased a few more motion sensors to mess with and am having issues adding them properly. Here are the steps I follow since it is slightly different.

  • Shutdown the Telnet session
  • SSH into the VM
  • Execute sudo python sample.py --device /dev/hidraw1
  • Press P to pair
  • Hold reset on the device until the red light blinks
  • Press L to list, there's an additional device listed
  • Press X to exit
  • Start the Telnet Session
  • Start the Bridge
  • Verify the motion sensor is sensing motion by means of the red light

Unfortunately that's all, no child device is added. Anyone have any thoughts?

Ignore, it finally showed up. Leaving for reference for anyone else doing the same

1 Like

I had EXACT same thing happen with a few motion sensors where it took 10+ minutes before the device was created. The contact sensors were created immediately. Weird huh????

Slightly :stuck_out_tongue: But hey, it works!

@kellykoehn128 Lately, I have had all of the sensors stop reporting on occasion but the Wyze Telnet device in HE is still showing as connected to Telnet & the Bridge with no indication in the HE logs that something went wrong. It used to happen rarely but is happening more often recently. Are there any additional logs generated on the RPi that I might be able to look at to see why the integration stops working or get notice that it has?

Its usually easily fixed by disconnecting then restarting Telnet session and bridge.

Ironically I’m experiencing the same thing. What version is your hub on? I wonder if HE has changed something during an update that is affecting the telnet connection. I just thought it was the shifty wireless connection I had my Pi temporarily on :slight_smile:

I am on ver 2.2.2.129 and my Pi is connected via ethernet cable.

I experience the same but I on a wireless instead of ethernet cable and I'm also on Version 2.2.2.129.

I’ll do some sniffing tonight. Mine will still show connected but it seems to be a dead connection. Reporting back soon...

So I checked and I'm on 2.2.2.125 still... I'm going to dig into the Pi and see what the logs tell me. More to come.

Following up on what I've found...

Surprisingly the connection to my Pi has been up for nearly two weeks, which was a surprise to me.

pi@wyzebridge:~ $ w
 19:08:44 up 22 days,  3:28,  2 users,  load average: 1.13, 1.14, 1.19
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
pi       pts/0    hubitat.koehn.ml 29Jul20 13days 18days  0.27s -bash
pi       pts/1    192.168.0.138    19:08    2.00s  0.29s  0.01s w

Puzzled by this I went to look at the hubitat.py output to see if the sensors themselves were causing the problem. I killed the script and ran hubitat.py from an SSH session and the sensors appear to be responding quickly. This is good news because it indicates this isn't a WyzeSensePy issue or something related to the Pi/Radio. I did notice that I got one or two invalid packet errors -- but this may have been happening all along. I think it is a red herring at this point. (notice the good packet, then a bad packet below).

[2020-08-12 19:29:53][777885E7]StateEvent: sensor_type=switch, state=open, battery=87, signal=87
ERROR 2020-08-12 19:30:00,262 Invalid packet: 55aa53193500000173e539304ba2a23737373838354501010009090636
ERROR 2020-08-12 19:30:02,854 Mismatched checksum, remote=0636, local=0694

Next I decided to check out Hubitat logs while the scripts were running... this is what leads me back to something changing on the hub. Nothing was received. Occasionally I would get responded, sometimes out of order, and other times I'd get nothing at all as if the script wasn't working (which we know it is). I suspect something has changed in the telnet libraries of Hubitat or potentially how my device drivers are reading the telnet stream. I'll need to dig into this one further.

No changes or updates have been made to the WyzeSensePy code since 8/1/2019 (which is the release I'm using).

If you reboot your hub, it will still show connected but not actually be connected. I got around this by setting a rule that runs every 6 hours to disconnect telnet, then reconnect telnet, then reconnect the bridge. I added some logic to it so it waits until it's connected then it continues the rest. This way it refreshes the connection every 6 hours

Ty for this. Dont know why I missed it before. I have been using Home assistant for devices that I cant use with hubitat and there is a 3rd party integration wyze-sense that works great. I just got this working however and so far seems to be working. One tip I would give is if you have wyze cam then pair the devices motion\contact via the wyze app with the bridge in the camera. All I had to do was move the bridge to the pi, restart telnet and bridge and the paired devices were there.

also maybe add the hubitat.py file to the master download then can move it to the master directory instead of copy paste.

If I understand stand you correctly you can put the bridge into the camera and go through Wyze app and install motion and contact sensors and then move the bridge back to the PI and the contact and motion sensors will show up as devices in Hubitat?

I created a Node Red flow when I started using this integration that basically does same thing. It's a 6 hour Deadman switch. If no motion, contact or battery message is received in 6 hours, it disconnects, reconnects and sends notification. It also sends a notification at 4 hours that says there might be a problem.

It also reconnects 5 minutes after a hub reboot.

That's brilliant but makes sense that the pairing info is stored in bridge. The SD in my RPi bricked but all I had to do was reinstall integration; I didn't have to re-pair all of my devices to bridge.

That is good to know. Thanks

yes. I already have my devices paired to the bridge. all I had to do was restart telnet and wyze bridge

Thanks I think that is a better way.

Found it out in another thread, but in HE one of the Location attributes is SystemStart (HE boots up). I added that as a trigger, so it now auto connects when I reboot my HE :slight_smile:

1 Like