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

Mine are all the same as the one I sent to you, just the Wyze logo, 2019 version, model # should be WLPA19. I bought them and got some free from before they came out with the Wyze "White" bulb when the color bulb came out. I'm guessing the white bulbs are more like the color ones.

Here are the debug logs from me trying to turn on a bulb that is off and turn off a bulb that is on, neither command worked:

app:1012022-02-13 08:13:07.082 pm debug[WyzeHub] [Office Lamp 1] createEventsFromPropertyList()
app:1012022-02-13 08:13:07.033 pm debug[WyzeHub] validateApiResponse()
app:1012022-02-13 08:13:07.029 pm debug[WyzeHub] deviceEventsCallback() for device 2CAA8E30E217
app:1012022-02-13 08:13:06.455 pm debug[WyzeHub] asyncapiPost()
app:1012022-02-13 08:13:06.451 pm debug[WyzeHub] [mac:2CAA8E30E217, model:WLPA19, actionList:[[pid:P3, pvalue:0]]]
app:1012022-02-13 08:13:06.447 pm debug[WyzeHub] apiRunActionList()
app:1012022-02-13 08:13:06.423 pm info[WyzeHub] [Office Lamp 1] 'Off' Pressed
app:1012022-02-13 08:14:08.071 pm debug[WyzeHub] [name:switch, value:off, unit:null, description:Office Lamp 2 switch is off, isStateChange:true]
app:1012022-02-13 08:14:08.068 pm debug[WyzeHub] Sending event data...
app:1012022-02-13 08:14:08.063 pm debug[WyzeHub] doSendDeviceEvent()
app:1012022-02-13 08:14:08.050 pm info[WyzeHub] [Office Lamp 2] Updating Property 'switch' to off
app:1012022-02-13 08:14:08.041 pm debug[WyzeHub] [Office Lamp 2] createEventsFromPropertyList()
app:1012022-02-13 08:14:08.016 pm debug[WyzeHub] validateApiResponse()
app:1012022-02-13 08:14:08.011 pm debug[WyzeHub] deviceEventsCallback() for device 2CAA8E389808
app:1012022-02-13 08:14:07.269 pm debug[WyzeHub] asyncapiPost()
app:1012022-02-13 08:14:07.257 pm debug[WyzeHub] [mac:2CAA8E389808, model:WLPA19, actionList:[[pid:P3, pvalue:0]]]
app:1012022-02-13 08:14:07.254 pm debug[WyzeHub] apiRunActionList()
app:1012022-02-13 08:14:07.246 pm info[WyzeHub] [Office Lamp 2] 'Off' Pressed
1 Like

Yeah see that call to apiRunActionList() isn't right. That's what the color bulb uses. When you press on or off it should call apiSetDeviceProperty().

Looks like your driver code is out of sync. Can you run a repair in HPM and see if that resolves it?

1 Like

That was definitely the case, but I'm not sure what Hubitat or HPM was doing.

I repaired with HPM, and I saw that it said it was downloading Wyze CT Bulb driver. Tried on/off again, still same apiRunActionList in debug.

I deleted the bulbs from devices and deleted the Wyze bulb driver and then ran HPM repair again. It said it was downloading the driver, but it did not. So I put it in there manually and it worked.

I also noticed that HPM did not install the Wyze Bulb Group driver, so I had to install that manually after trying repair.

Take a look at this from "Drivers Code" in Hubitat:

WyzeHub Bulb jakelehner	2022-02-14 8:48:42pm EST
WyzeHub Bulb Group jakelehner	2022-02-14 8:50:24pm EST
WyzeHub Camera jakelehner	2022-02-14 8:54:46pm EST
WyzeHub Camera Group jakelehner	2022-02-14 8:54:46pm EST
WyzeHub Color Bulb jakelehner	2022-02-14 8:54:43pm EST
WyzeHub Color Bulb Group jakelehner	 2022-02-14 8:54:44pm EST
WyzeHub Plug jakelehner	2022-02-14 8:54:45pm EST
WyzeHub Plug Group jakelehner	2022-02-14 8:54:45pm EST

I ran an HPM repair after I manually installed the bulb drivers. The repair time was 8:54pm, but the bulb drivers did not repair.

Thanks for your help.

Ok there were some issues with the HPM manifest file. Should be resolved now.

2 Likes

Thanks! Looks good from my end now. I did an update with HPM and then a repair and it downloaded all the drivers this time.

My bulbs appear to be working good through Hubitat.

The Tesla integration have an option for alerting via one of the notification device when the token has expired, it would be great if WyzeHub could do the same!

I have a Wyze Home Monitoring Hub and Keypad that I can donate for integration efforts. Is anyone else interesting in getting contact/motion sensor support added? If yes, can you donate a sensor or two? I don't have any of those spare.

1 Like

I originally did the manual install. How does one move from that to the HPM install without having to redo everything?

I believe you can just do a 'repair'? Or as I recall there's an option to scan for known packages in HPM.

Regarding the contact sensors, I'll have a peak at the Python library sometime here and make sure it looks like something I could easily port. Assuming so, and assuming enough hardware is available I can definitely add these devices.

2 Likes

I can definitely do local testing.

1 Like

For the Cam integration, I'm confused what I can actually do with this. Does it no trigger a motion sense event? I'd like to have a cam turn on a light if motion is detected, for example.

2 Likes

There have been a lot of questions in reference to events from cameras. I am testing a process now where we can poll the api for events. Still not real time but something.

Currently I am polling for the events, looking at the most recent and determining if it falls below a specified 'time since' threshold. If below that threshold, it would send a motion active event. Then at some specified interval later, send a inactive event automatically.

The key to getting accurate events seems to be in the polling interval vs threshold settings. A small enough polling interval as to catch all events but not so small that you overwhelm the hub or hit a api call limit.

Anyone have thoughts or suggestions on how to improve this? or a different process that has worked elsewhere?

2 Likes

Thanks for this integration!

I just installed a Floodlight with v3 Cam. I added this rule to enable or disable notifications from the cam (via the Wyze app) for motion detected on the driveway - basically, I didn't want us going outside to set off the notification. This seems to do what I want so far.

2 Likes

This integration has been amazing for my home ecosystem. Any plans or availability to include a few of the new WYZE items such as the Air Purifier or the Garage Door opener? What can I do to help this with very little JSON knowledge? Again, thank you and if you cant help it's fine with all you've already done.

2 Likes

I just installed a Wyze Garage Door Controller with integrated v3 camera. But they don’t have Alexa integration working with it yet (they’ve promised it and it’s printed on the box). I’d love to have that working with this Hubitat app.

I’m happy to test and help any way I can. I can pitch in and buy a Wyze Garage Door Controller if you’d like.

Very good job, I'm using it for the cameras and it's very useful. however, I cannot include the true or false value in the rules to know if it is online or not and launch warnings.

could you include the ability to presence, synchronized with the state of the camera?

greetings and thank you very much.

Thanks for this! Just needed the on/off control for cameras to save on battery. :slight_smile:

Thanks for the work on this.
I have a Wyze doorbell I would love to see that there was an event for doorbell pressed. I have deaf in-laws and it would be great to flash the lights when the doorbell was pressed. IFTTT has the functionality but the delay makes it useless.

With my Wyze Floodlight, I wanted to know when the floodlight got turned on. I see this is reflected in the cam device via the current state "floodlight_powerstate: false". I added a virtual switch and I thought I'd create a rule to change the state of the virtual switch depending upon that custom attribute. But RM doesn't like that the attribute type is a BOOL:

image

But then I was thinking - it might be better if the WyzeHub handled this directly. If there is a Floodlight connected to the v3 cam, perhaps it should create a virtual switch to reflect the state of the floodlight as a switch (noting that state is only updated at the rate the driver polls Wyze). Then I can write other automation that could easily be triggered by the floodlight going on.

Bruce states Boolean is not a supported type for an attribute in a driver. The suggestion in that thread (and in Rule Machine - Boolean Condition Custom Attribute) is to change the attribute from bool to an enum like this, which allows Rule Machine to act upon it as a custom attribute.

This change is in line 88 of the WyzeHub Camera driver:
(I created a pull request with it)

From:
attribute "floodlight_powerstate", "bool"
To:
attribute "floodlight_powerstate", "enum", ["true","false"]


With that change, I can finish adding the rule to make a virtual switch mirror the state of the floodlight: