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

Hi, thanks for the excellent implementation. Been using this for Wyze plugs that last few days and everything seems to be working as expected. Even have them showing up in HomeKit through Hubitat with MakerAPI.

I have a lot of the original Wyze bulbs, not color and was wondering if this can be added? I tried looking at some Wyze API python code and they don't seem to have the correct commands for older Wyze bulbs in there, as no control worked, but I could see properties, when I tried to change your color bulb driver code.

If I could help in some way with testing or if you can point me in the right direction for getting PIDs from the bulb I'd try a crack at the driver again.

Thanks!

As I recall I wasn't in love with how the light vs camera power was being handled and was hoping for some additional input/feedback from other floodlight owners. I don't own one so my opinion at the moment isn't all that important ... so if no one else has any objections, I can just merge it in if it's been working for you.

1 Like

This should be easy but I will be shooting in the dark since I haven't been able to get my hands on one.

I can add a driver for you to test but be ready for it not to work first few tries, ha. Should be simple but any time I code blind something silly seems to happen at least once.

If you have a spare and want to send one my way shoot me a dm.

The alternative would be taking the primary switch function on off for the floodlights and using a boolean toggle for the camera, however I was trying to remain consistent with your other drivers. Is this what you were seeing done differently?

Love the integration with Wyze. Ow i can control the Wyze light strip pro with my Zooz Zwave button remote. So happy.

My question is... Can we get the motion trigger from the Wyze cameras in order to trigger lights and screens in Hubitat?

Hey @jakelehner! Is there a chance to add the Wyze Bulb (old, not color)? Thanks!

1 Like

Is the doorbell cam supported? Great work by the way!

1 Like

Is anyone able to sync devices using these drivers through to a google home? I've integrated Hubitat with my google home and the devices show in the list of devices during the sync process, but it doesn't seem to matter if I check the box to pull these Wyze devices in...they won't pull in. It seems to work with other third part devices...ie I have some kasa switches integrated into hubitat, which then pass into google home via Hubitat.

A workaround is to connect google to my Wyze account, and that's fine. But it's a head-scratcher for me.

Another user has offered to send me one of these, so I'll add once that is received.

1 Like

Not yet. I don't have the hardware so either someone else will need to write the driver or I'll need to get my hands on the hardware.

That said, cam support in general is lacking. It's not easy to get screenshots from Wyze or from the cams directly, and I imagine the doorbell cam would be the same.

1 Like

As I recall I was thinking it would be better to have toggle switches to control the floodlights rather than discreet on/off buttons. But in the end it doesn't impact me and I haven't heard any other opinions on the matter.

I'll merge this in this weekend.

Thanks @jakelehner for the work on all of this. I'm a relative n00b to HE, so I can't offer any programming support at this point. However, has there been any thought to adding in support for the contact and motion sensors (both V1 and V2)?
I know there is support for this via Homebridge--and I suppose I could figure out some sort of automation to run virtual devices on HE--but it would be better (IMO) to have direct instances in HE.

Can't win for losing with this API it seems.

Good news: @smcallah sent me a CT bulb to add support for.
Bad news: I can no longer get either my API Client (Postman) or WyzeHub to authenticate and get an access token. I get 429 Too Many Requests even though it's the first request. Tried updating the API key to what the python package is using with no luck.

Anyone else having issues authenticating with WyzeHub?

Man ... Wyze is annoying.

So it appears the "429" message is tied to my IP and not my account. Trying to log in with different credentials results in the same error. I was able to get tokens by connecting to a VPN then doing the auth request in Postman. Annoying.

Still can't get my Hubitat to log in though, since it doesn't go through the VPN.

So I added a hack where you can manually enter your access token and refresh token on the auth config page. If you have values in those fields, it will skip the user auth attempt and just use whatever tokens you give it. Otherwise it tries to log in.

Regular CT bulb added and I imported the PR for the flood light changes.

And we'll try this again. Here's the Postman collection I use. I think I got all the sensitive info removed.

https://www.getpostman.com/collections/dd502e637cd2950f8946

You'll need to create an environment with the referenced variables or add to your globals list. Here's the defaults:

authBaseUrl: https://auth-prod.api.wyze.com
apiBaseUrl: https://api.wyzecam.com
appName: com.hualai
appVer: com.hualai___2.24.34
appVersion: 2.24.34
sc: a626948714654991afd3c0dbd7cdb901
xApiKeyHeader: RckMFKbsds5p6QY3COEXc2ABwNTYY0q18ziEiSEm

The rest will change based on your setup.

I would need access to the hardware and a closer look at the Python package to see if this is possible. I have a feeling this will have the same challenges as the cameras. Getting "push" type notifications from the Wyze API (i.e. motion detection) may be difficult or not possible.

That makes sense. If you are getting too many requests from a single IP, then you block that IP. It's got nothing to do with the credentials you are using. That's how I've implemented anti-DOS code in the past at ${day_job}.

There area several Homebridge plugins out there that have successfully implemented the contact sensors and motion sensors, both the v1 and v2. Perhaps they can be used as a source?

I don't have any spare hardware, but I would be happy to collaborate on testing.

Two Examples:

and

2 Likes

Thanks for the quick turn around time for adding the bulb. Glad I could help.

I'm trying the CT bulb with WyzeHub today and it's not working though.

Steps I took:

  1. Updated WyzeHub through HPM, everything updated and installed.
  2. Added CT bulb devices to Hubitat
  3. Went to each bulb and tried on/off/ct/level and didn't change the bulb. If I did refresh it showed me the bulb was still in original state.
  4. Refreshed login to Wyze through WyzeHub
  5. Removed bulbs and readded, still not working.
  6. Repaired WyzeHub with HPM, refreshed login, and tried bulbs again, still not working
  7. Removed a bulb and readded one more time, not working

2 Wyze Plugs that I am using with WyzeHub were working during all of this.

Let me know if there is anything else I should try or info you would need from me.

Typical.

Can you turn on debug mode and see what shows up in the logs when you try to send the commands? Also, just curious ... are your bulbs the one with the "two logos" or "single logo"? If you have some of each ... do you get the same results across them all?

When I paired the bulb you sent it asked me about the logos. It's quite possible the two bulb types respond to different command sets. The driver I configured uses a "set property" approach whereas the color bulbs use a "run action" approach. It's possible the newer gen CT bulbs use the "run action" commands instead.