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

I wanted to post again and to say that I am 99% sure I figured out why I was having the sensors just stop working without warning and I hate to admit IT WAS MY FAULT!!!

I was not going to device and restarting Telnet and Bridge after re-booting hub. UGH!!!!

In the device screen, it still said that the Telnet Session and the Bridge is connected after reboot when it really isn't.

1 Like

Thanks to @fblackburn creating Hubitat nodes in Node Red, I was able to figure out a way to Disconnect Telnet, Reconnect Telnet, and Start Bridge in a Node Red Sequence. I could never find the commands to do so in RM under Custom Actions.

Now, I have a sequence in Node Red that tells me if none of the Wyze sensors have reported activity in 4 hours and then again at 6 hours. I can then just flip a virtual switch and it will restart the Telnet & Bridge connection. I have also set up a Rule that flips that switch 2 minutes after a hub reboot. Of course, now that I have all of this backup for a failure, it's running like a charm and I haven't needed it. KNOCK ON WOOD!!!

Once again, Great Integration!!! I am surprised more people haven't commented on their use of it. You can't beat the price of the Wyze sensors and door contacts and they have been as fast as hoped using this integration

I’m glad it’s working great for you! Mine has been exceptionally stable, even with a few additional sensors. I’ve got two WyzeLocks on the way so that’ll be the next project.

1 Like

NOOOO!!!!! YOU ARE NOT ALLOWED TO INTEGRATE A WYZELOCK BECAUSE THEN I WILL BE FORCED TO BUY ONE AND I AM ALREADY TEMPTED. I DON'T THINK MY MARRIAGE WOULD SURVIVE IT THOUGH. :grinning:

I have a mixture of 10 door contacts and motion sensors running with another motion sensor sitting in a box waiting for a need.

I use this alot and have replacement all my windows contact sensors and use all Wyze contacts and they are doing a good job. Thanks goes to @kellykoehn128 for doing this and I'm for the Wyze locks as I already have one and I like it and it works great. @stephen_nutt can you share how you set up the node that you have set up for pi? Thanks.

You will need to add the following pallets:
node-red-contrib-hubitat (@fblackburn's hard work: Node-RED nodes for hubitat)
node-red-contrib-mytimeout
Some sort of notification method. I use Join on Android.

I added Hubitat Device Nodes for each Wyze Sense device. Basically, I have it setup so that any activity from any of the Wyze sensors will reset the mytimeout timer. The mytimeout timer allows you to send on a message at a warning threshold and final. I use a 4 hour warning and 6 hour final and get a text message at each point.

Then, in Hubitat I created a virtual switch called WyzeSense Rebooter. I next created another Node Red Sequence that triggers when WyzeSense Rebooter turns on (it turns off 2 seconds later automatically). That triggers a Hubitat Command Node that disconnects Telnet, waits 10 second, triggers another Command Node to reconnect Telnet, waits 20 seconds, then a 3rd Command Node to restart bridge.

If you do this, your Hubitat nodes will look different. In the original, all of the nodes are the same color but have different icons. I change it so that the backgrounds for each node type are different but all have the Hubitat logo icon. Blue are device nodes and red/orange are command nodes. I don't use them here but my Mode Nodes are yellow. It makes it easier for me to distiguish the node types.

I am new to Node Red so this might not be the quickest and most efficient way to do it but it works. You could probably do it with a lot less nodes using Function Nodes but to me, if I am using a Function Node, I am going against the point of Node Red being a graphical way to create code. Plus I have no idea how to write JSON.

Finally, even if you decide that you don't want to do this, I highly recommend going ahead and downloading the Hubitat pallet that @fblackburn created. It has simplified a bunch of the sequences that I had already created using HTTP requests and allowed me to make new sequences that I wouldn't have attempted otherwise. I believe that I have been able to take a lot of stress off of my hub. That thread I linked to has lots of great info and is over 400 posts long as of today.

1 Like

@stephen_nutt Thanks for the info. I will work on it this weekend, by the way are you using it on the same pi that you have the Wyzesense on?

I only have a Pi Zero running Pi-hole (as 2nd DNS) and then a Pi 4.it is is also running Pi-hole as 1st DNS address. The Pi 4 has Node Red and WyzeSense on it and haven't noticed any issues. If thw Pi 4 fails I have bigger issues than WyzeSense because I converted about half of my HE Rules to Node Red flows

@stephen_nutt thank you for that info. Right now i'm only running an Pi 3B+ and like it and was considering a Pi 4. I'm going to put the Node Red on the Pi that I have and run it that way. Is making a Node Red flows easy or hard ? Thanks

It's easier than learning JSON I would imagine. Check out the thread linked above about the Node Red integration. IT'S A LONG READ!

@stephen_nutt Thanks for the help on the node red. I finally got it working where I can see the Wyze motion, etc working. Can you share how you did the node "msg.payload" in green and the one that "set.msg.payload" in yellow? Thanks

Is this what you are looking for?
image

image

Yes thanks for the info.

Knock on wood, mine has been solid as a rock lately. I even tried to recommend this integration to someone on the ST forum looking to connect to Wyze Sensors until I was taught that ST doesn't allow telnet like the HE does so they are SOL. ST can't telnet to a Lutron Pro Hub either

@stephen_nutt thanks for the info and sharing. I would like to ask how you did the Switch and the nodes where you have the Wyze Sense may be now and has been down for 6 Hours? I guess my question is how did you built the Switch nodes and the two wyze sense ones. I been having a hard time as I not a programmer by any means. But I like a learning new things and I like the node red. I try to pass a command with RM 4.0 but never could get it to work. I really appreciate the help.

I'm out of town but will send details when I'm back.

Thanks

This is the first time I have tried to export a flow but see if this imports and can answer your questions. I changed the info in my config file so you don't have my token (I hope). :smiley:

Give it a shot. Copy everything below and then goto Import in Node Red and paste this in window. I think it will work. If the experts could chime in and correct me, please do so.

[{"id":"2a2f0656.32a61a","type":"tab","label":"WYZESENSE HEALTH CHECK","disabled":false,"info":""},{"id":"5957923.ca57a6c","type":"mytimeout","z":"2a2f0656.32a61a","name":"Countdown Timer","outtopic":"","outsafe":"","outwarning":"Warning","outunsafe":"Dead","warning":"7200","timer":"21600","debug":false,"ndebug":false,"ignoreCase":false,"repeat":false,"again":false,"x":690,"y":260,"wires":[["7cfe903f.5f358"],]},{"id":"5bd07d3.42ded84","type":"hubitat device","z":"2a2f0656.32a61a","name":"Living Room Motion","server":"e2175bd0.e82808","deviceId":"1350","sendEvent":true,"x":170,"y":340,"wires":[["907aad44.344b","15dfbd28.c872e3"]]},{"id":"907aad44.344b","type":"change","z":"2a2f0656.32a61a","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"ON ","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":260,"wires":[["5957923.ca57a6c"]]},{"id":"c9a1945f.d9d948","type":"hubitat device","z":"2a2f0656.32a61a","name":"Declans Bedroom Door","server":"e2175bd0.e82808","deviceId":"1225","sendEvent":true,"x":160,"y":140,"wires":[["907aad44.344b","15dfbd28.c872e3"]]},{"id":"a8c6735d.483be","type":"hubitat device","z":"2a2f0656.32a61a","name":"Master Gun Closet Safe","server":"e2175bd0.e82808","deviceId":"1224","sendEvent":true,"x":150,"y":380,"wires":[["907aad44.344b","15dfbd28.c872e3"]]},{"id":"fb50ed08.71929","type":"hubitat device","z":"2a2f0656.32a61a","name":"Closet Gun Safe","server":"e2175bd0.e82808","deviceId":"1354","sendEvent":true,"x":180,"y":100,"wires":[["907aad44.344b","15dfbd28.c872e3"]]},{"id":"da8d7ea2.10288","type":"hubitat device","z":"2a2f0656.32a61a","name":"Garage Freezer","server":"e2175bd0.e82808","deviceId":"1318","sendEvent":true,"x":180,"y":220,"wires":[["907aad44.344b","15dfbd28.c872e3"]]},{"id":"e5935989.b77518","type":"hubitat device","z":"2a2f0656.32a61a","name":"Declans Motion Sensor","server":"e2175bd0.e82808","deviceId":"1226","sendEvent":true,"x":160,"y":180,"wires":[["907aad44.344b","15dfbd28.c872e3"]]},{"id":"aa5a17f9.8b1b88","type":"hubitat device","z":"2a2f0656.32a61a","name":"Garage Refrigerator","server":"e2175bd0.e82808","deviceId":"1352","sendEvent":true,"x":170,"y":260,"wires":[["907aad44.344b","15dfbd28.c872e3"]]},{"id":"784bc38b.8ce36c","type":"hubitat device","z":"2a2f0656.32a61a","name":"Ainsleys Bedroom Motion","server":"e2175bd0.e82808","deviceId":"1353","sendEvent":true,"x":150,"y":60,"wires":[["907aad44.344b","15dfbd28.c872e3"]]},{"id":"311609ec.5deda6","type":"hubitat device","z":"2a2f0656.32a61a","name":"Kitchen Fridge-Freezer","server":"e2175bd0.e82808","deviceId":"1351","sendEvent":true,"x":160,"y":300,"wires":[["907aad44.344b","15dfbd28.c872e3"]]},{"id":"15dfbd28.c872e3","type":"debug","z":"2a2f0656.32a61a","name":"","active":false,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":450,"y":140,"wires":},{"id":"14da3435.f099fc","type":"hubitat device","z":"2a2f0656.32a61a","name":"Kids Bathroom","server":"e2175bd0.e82808","deviceId":"1994","attribute":"","sendEvent":true,"x":180,"y":420,"wires":[["15dfbd28.c872e3","907aad44.344b"]]},{"id":"7cfe903f.5f358","type":"switch","z":"2a2f0656.32a61a","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Alive","vt":"str"},{"t":"eq","v":"Warning","vt":"str"},{"t":"eq","v":"Dead","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":570,"y":380,"wires":[,["bde0bb8f.e39458"],["2664c925.223df6"]]},{"id":"2664c925.223df6","type":"join-message","z":"2a2f0656.32a61a","name":"","text":"WyzeSense has been down for 6 hours. Click to reboot.","title":"WYZESENSE -- URGENT!!","url":"https://cloud.hubitat.com/api/749578fe-e553-4a39-b7a5-894d6132d2f9/apps/4/dashboard/2090?access_token=fe910056-0568-4997-89f6-80bac54dbb67&local=false","notificationicon":"","joinConfig":"a9299c99.7096","x":920,"y":420,"wires":[[]]},{"id":"bde0bb8f.e39458","type":"join-message","z":"2a2f0656.32a61a","name":"","text":"WyzeSense may be down","title":"WYZESENSE","url":"","notificationicon":"","joinConfig":"a9299c99.7096","x":830,"y":380,"wires":[]},{"id":"ca81f0f6.730d5","type":"hubitat command","z":"2a2f0656.32a61a","name":"Wyze Telnet Link - Disconnect","server":"e2175bd0.e82808","deviceId":"1223","command":"disconnectTelnet","commandArgs":"","x":600,"y":520,"wires":[["f5a726cd.789db8"]]},{"id":"51ca7e60.0258c","type":"hubitat command","z":"2a2f0656.32a61a","name":"Wyze Telnet Link - Re-Connect","server":"e2175bd0.e82808","deviceId":"1223","command":"connectTelnet","commandArgs":"","x":610,"y":660,"wires":[["709a89cf.981a98"]]},{"id":"b13aa56c.b9b958","type":"hubitat command","z":"2a2f0656.32a61a","name":"Wyze Telnet Link - Start Bridge","server":"e2175bd0.e82808","deviceId":"1223","command":"startBridge","commandArgs":"","x":1090,"y":660,"wires":[["59d5684.d1d6f98"]]},{"id":"f5a726cd.789db8","type":"delay","z":"2a2f0656.32a61a","name":"","pauseType":"delay","timeout":"10","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":600,"y":580,"wires":[["51ca7e60.0258c"]]},{"id":"709a89cf.981a98","type":"delay","z":"2a2f0656.32a61a","name":"","pauseType":"delay","timeout":"20","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":840,"y":660,"wires":[["b13aa56c.b9b958"]]},{"id":"59d5684.d1d6f98","type":"join-message","z":"2a2f0656.32a61a","name":"","text":"Telnet WyzeSense has been restarted","title":"WYZESENSE -- URGENT!!","url":"","notificationicon":"","joinConfig":"a9299c99.7096","x":1090,"y":580,"wires":[]},{"id":"60cd8537.89fdec","type":"inject","z":"2a2f0656.32a61a","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":450,"y":320,"wires":[["5957923.ca57a6c"]]},{"id":"4f742305.3475ac","type":"hubitat device","z":"2a2f0656.32a61a","name":"WyzeSense Rebooter","server":"e2175bd0.e82808","deviceId":"1926","sendEvent":true,"x":160,"y":520,"wires":[["65e13e40.3f74b"]]},{"id":"65e13e40.3f74b","type":"switch","z":"2a2f0656.32a61a","name":"","property":"payload.currentValue","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":370,"y":520,"wires":[["ca81f0f6.730d5"]]},{"id":"e2175bd0.e82808","type":"hubitat config","z":"","name":"MAIN HUB","usetls":false,"host":"192.168.68.124","port":"80","token":"bd2c7881-7a20-45ca-b891-df1f0xxxxxxx","appId":"383","nodeRedServer":"http://192.168.xx.xxx:1880"},{"id":"a92xxxx.7096","type":"join-config","z":"","name":"Stephens Cell Phone","register":true}]

Thanks for all of your flow I will try to import it this weekend when I get back to the house. What node did you for the Message WyzeSense down, restarted? I don't recognized them thanks.

It's a Tasker Join node.