[RELEASE] WyzeHub - Wyze Device Integration (minimal cam support)

oh so i dont understand what can we do when having the wyze cam? sorry im confused

You would need to find a different way to get these notifications to Hubitat, this integration will not provide these events unfortunately at this time although that could change the future if someone figures out how to get the events from the API.

I use IFTTT currently to do this which will turn on a virtual switch:

Virtual switch in Hubitat:

It's setup to automatically turn off after 5 seconds but you can modify that to your liking. I have another one setup for motion just like I do for sound as shown above.

As I mentioned, Tasker is another option but never really tried it before. There could be other ways to do it from Alexa or Google Home using a Virtual device instead of IFTTT, some people don't like to use IFTTT since it's slower for some people although for me just using it for this purpose it seems to be pretty close to instant even with the free version of IFTTT.

2 Likes

At this point camera integration is limited to detecting online status and enabling/disabling select features...
Power on/off
Enable motion recording
Enable motion/sound notifications

1 Like

ok thanks!

Wyze has two models of LED strips. Wyze LED strip lights Pro has the abilities: single color, multi color, music interesting mode. The regular model can change to different colors only.

Alright I THINK my bug fix for the refresh token flow worked. I'll merge that in this evening.

I may also add the non-pro version of the color strip as an extension of the mesh light. Based on the info given by @lmosenk, I would like to get some more information and have a better plan for the pro and have a plan for controlling the individual segments. My guess is this will need to be a new device with child devices for the segments. Or maybe just a new device with separate color controls for each segment.

1 Like

Pushed v1.3 which addresses the refresh token issue and also adds the non-pro light strip.

I added the light strip completely blind ... so if it doesn't work, it'll be up to one of ya'll to help figure it out :wink:

Also unsupported devices will now print the model number and the product type to the debug log.

1 Like

Non+Pro Wyze LED strips. Yey and :sob: . Really want to integrate them as Alert lights for SHM. Will update the driver and see if the Token issue I reported prior is working. Thanks for your great work @jakelehner .

Thanks for this. Just discovered the thread, and installed it via HPM.
Question: How do I go about getting the Camera images on a dashboard?

I don't think this is supported yet for cams. Other users have been supplying the functionality for cameras for the most part.

I think it only allows for control of camera on/off and then reporting of event status (but nut "push" from what I understand).

afaik getting images or video streams from the cameras into hubitat will require a bit more work and possibly a tie in to the RTSP package mentioned earlier.

2 Likes

The current challenge with the pro strip is not knowing what it looks like in the API. Since it allows for different colors per segment, I think the correct approach will be to have a new device with a control for each segment plus a control for all segments. But this assumes it all shows up as one device in the API with different PIDs for each segment.

Assuming that's the case, the PIDs need to be identified for each segment as well as details for how the RGB value is set separate from CT.

Or ... if Wyze treats this like the outdoor plug, it could be advertised in the API as a master device with a bunch of sub devices. Meaning each segment would have it's own MAC address etc. This would change the implementation approach significantly.

This morning I found that I'd lost my auth token again:

app:2832021-12-13 08:01:43.511 am errorgroovy.lang.MissingMethodException: No signature of method: user_app_jakelehner_WyzeHub_145.refreshAccessTeoken() is applicable for argument types: (user_app_jakelehner_WyzeHub_145$_validateApiResponse_closure24) values: [user_app_jakelehner_WyzeHub_145$_validateApiResponse_closure24@101958e] on line 973 (method deviceEventsCallback)

app:2832021-12-13 08:01:43.457 am debug[WyzeHub] {"ts":1639400502161,"code":"2001","msg":"AccessTokenError","data":{}}

app:2832021-12-13 08:01:43.455 am error[WyzeHub] Access Token Invalid. Attempting to refresh token.

app:2832021-12-13 08:01:43.445 am debug[WyzeHub] validateApiResponse()

app:2832021-12-13 08:01:43.443 am debug[WyzeHub] deviceEventsCallback() for device 7C78B218BB99

app:2832021-12-13 08:01:42.817 am debug[WyzeHub] asyncapiPost()

app:2832021-12-13 08:01:42.804 am debug[WyzeHub] [mac:7C78B218BB99, model:WLPA19C, actionList:[[pid:P3, pvalue:1]]]

app:2832021-12-13 08:01:42.799 am debug[WyzeHub] apiRunActionList()

app:2832021-12-13 08:01:42.790 am info[WyzeHub] [Computer desk] 'On' Pressed

Prior to this but after you released the update, I had updated via habitat package manager.

Ok I was able to reproduce. It's just a syntax issue with calling the refresh token method. Will try and get a fix together soon.

3 Likes

Ok I pushed a fix for the refresh token issue.

After a failed call, I would like for it to retry the last attempted call after refreshing the token, but I haven't gotten this right yet.

A better option may be to implement a heartbeat so hopefully when the token expires the heartbeat will catch it rather than a call to a device.

1 Like

Just updated. You’re rad. Someday I hope to get smart enough to contribute to things like this!

This is fantastic! I've been looking for a way to not rely on IFTTT and this is perfect! My use case is fairly simple - turn the camera off when we're home and on when we're away. I realize there are many ways to do this, even simply plug the camera into a smart plug, etc. etc., but ain't nobody got time for that. With this, I can ditch my virtual switches and IFTTT, make a quick rule in Rule Machine, and presto!

TL;DR - shut up and take my money! but for real, happy to donate to @jakelehner or to whoever/whatever has helped along the way. Many thanks!

2 Likes

hahaha

I just noticed the pull request for the floodlights is still pending. Were there issues that needed to be remediated?

Hi there, just found your Wyze device handler!

I only have Wyze cams/doorbells, and looking at the device status, is there a way for Hubitat to know if the cams/doorbells detects motion (or someone rings the doorbell?)

Unfortunately no. I haven't yet figured out an effective way to pull event data from the API for cameras but even if we could, we are polling for that data so it will not be real-time.

The closest integration to real-time is by using a solution like IFTTT or a tasker based setup.

Alexa also has (limited) ability to turn on a virtual switch. Requires Cam Plus and only recognizes person detection.

2 Likes