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

that got it. thanks so much!

Your welcome. If you come up with a better rule please share. I been meaning to go back and revisit that rule so that If one was disconnected then it would restart the app but it been working good as is so I haven't.

Stephen, would you mind posting the export of the WyseSense flows you created?

If you look at around post 67 it is there just copy and paste.

Ah, missed that some how, thanks!

I'm not doing too much with it, just having it refresh every day at a specific time, but I do want to try teaming it up with @jwetzel1492's [UPDATED] iPhone WiFi Presence Sensor, so if I ever reboot the linux instance, I'll have it automatically restart the telnet and bridge. Probably gonna test that this weekend

I set up my rules like this:

  • install nginx on ubuntu server (need port 80 for presence device to work)
  • use iphone wifi presense device to ping server
    • I created a rule to ping it every 10 seconds. i also altered the rule to quickly mark the device as present/not present
  • create rule to run when device arrives

Since I'm running a Ubuntu VM, it's presence will be available before the Telnet can connect, so I put it on repeat. Outside of that, it's pretty similar to your rule

Thanks for the update. I like what you doing with the Ubuntu VM.

I noticed you said you were using an Ubuntu VM for your WyzeSense host. Did you do anything special to get it working? I've got one built and for the life of me can't get the telnet connection going between Hubitat and the new VM. In the logs it says the following.

dev:2702020-07-02 06:17:04.994 pm errorTelnet connection dropped...

dev:2702020-07-02 06:17:04.991 pm infotelnetStatus - error: receive error: Stream is closed

However, if I SSH into the VM and run sudo systemctl status inetd to show the status I see the following, emphasis on "Hubitat."

Active: active (running) since Thu 2020-07-02 22:08:11 UTC; 10min ago
Docs: man:inetd(8)
Main PID: 1832 (inetd)
Tasks: 2 (limit: 2317)
CGroup: /system.slice/inetd.service
├─1832 /usr/sbin/inetd
└─2679 in.telnetd: Hubitat

If I click disconnect from within Hubitat that connection goes away.

Thoughts?

Yes. I had to change the code to reflect a portion of my welcome message for Ubuntu. By default it's expecting the welcome message from a RPi

if (msg.contains("Welcome to Ubuntu")) {
    sendEvent(name: "TelnetSession", value: "Connected"); 
    log.debug "Telnet session opened!";
}

I also changed the def startBridge() function

def startBridge() {
    def msg = "sudo reset && sudo sh -c ${wyzeSensePyScriptPath}";
    log.debug "Starting Wyze Hub software...";
    sendMsg(msg);
}

The reason I did this was since I was running a VM, my Wyze hub wasn't the default device, so I had to update it to /dev/hidraw1 (your device may vary depending on how many USB devices you have). Then in my device, I specified my full path. Since I need to use quotes, I also have quotes listed in my path.

"/home/>user</WyzeSensePy-master/hubitat.py --device /dev/hidraw1"
image

I made the changes to the telnet link driver so it's now looking for the Ubuntu welcome message, which worked, so thank you very much for that!

I confirmed my dongle is hidraw1, so I made the changes to the driver you suggested above and still can't get the bridge to start. Looking at the HE log I see the following is being executed when I attempt to start the bridge:

sudo reset && sudo sh -c "/home/stircwazy/WyzeSensePy/hubitat.py --device /dev/hidraw1"

Running that same command while connected to the VM via SSH it works without issue displaying information about the dongle.

Gateway info:
MAC:779C5B94
VER:0.0.0.30 V1.4 Dongle UD3U
...

I greatly appreciate your assistance thus far, any chance you have any thoughts on this one?

I just remembered, one last thing I did was remove the password prompt for sudo on the VM.

I believe I had that issue because it was prompting for the sudo password. I was testing playing around having the code enter the password but it was too inconsistent, so I instead turned off the VM for asking for the sudo password using the steps in the link above

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.