ha-wyzeapi icon indicating copy to clipboard operation
ha-wyzeapi copied to clipboard

[Feature Request] Add Motion to V3 and V2 Cameras

Open Ace0510 opened this issue 2 years ago • 23 comments

After installing all my cameras show as switches.

Describe the solution you'd like I would like to turn Motion on and off as well as Notifications

Ace0510 avatar Oct 06 '21 15:10 Ace0510

"NOTE: Disabled following API usage incident with Wyze" I really wonder what happened... I wonder if it feasible since it requires Wyze API to have a callback system, because polling will DDOS Wyze. I assume Wyze callbacks only works with Android, Apple and IFTTT... PS: You can have what you need using IFTTT. That's what I'm doing now ...

jflecool2 avatar Oct 15 '21 02:10 jflecool2

I think that Ace0510 mega that they rant a toggle to disable motion detection per camera, not to get motion detection alerts.

JoeSchubert avatar Oct 22 '21 00:10 JoeSchubert

I wish there was a better way to implement their camera feeds instead of the very unstable RTSP implementation they currently have. I’ve since bought some PoE ReoLink cameras I have yet to install that’s going to slowly replace what Wyze cameras I use. Honestly I think the only thing I’m going to use due to the lack of functionality is their lock. And that’s only cause it pairs and works with ZHA.

Having toggles to shut off camera notifications is meh at best. No disrespect intended.

Benjamin T Powers

On Oct 21, 2021, at 7:13 PM, Joe Schubert @.***> wrote:



I think that Ace0510 mega that they rant a toggle to disable motion detection per camera, not to get motion detection alerts.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/JoshuaMulliken/ha-wyzeapi/issues/265#issuecomment-949093884, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACGXNJDZVLZYKXYJP2YRJS3UICUDDANCNFSM5FO4EMHA.

LordNex avatar Oct 22 '21 00:10 LordNex

I wish there was a better way to implement their camera feeds instead of the very unstable RTSP implementation they currently have.

Their cameras supposedly support WebRTC, and from my understanding, it's how Google and Amazon devices can display them. Unfortunately, I don't have any of my FireTVs rooted to be able MITM their handshakes, but I also don't know enough about WebRTC to really reverse engineer it either. If someone could figure out the handshake then I don't see why it wouldn't be possible for someone (not necessarily me) to add them as WebRTC cameras into home assistant with something like https://github.com/AlexxIT/WebRTC

JoeSchubert avatar Oct 22 '21 12:10 JoeSchubert

There’s an integration built into HA for WebRTC. But I have no idea how to use it to access the cameras. I’ll play around with it a bit but I just picked up a Jetson Nano so I think I’ll load up DeepStack and see if I can tie the feeds in through that. Like I said though. I just don’t think the Wyze cameras have the stability over RTSP to really be viable outside of a quick look camera

Benjamin T Powers

On Oct 22, 2021, at 7:26 AM, Joe Schubert @.***> wrote:



I wish there was a better way to implement their camera feeds instead of the very unstable RTSP implementation they currently have.

Their cameras supposedly support WebRTC, and from my understanding, it's how Google and Amazon devices can display them. Unfortunately, I don't have any of my FireTVs rooted to be able MITM their handshakes, but I also don't know enough about WebRTC to really reverse engineer it either. If someone could figure out the handshake then I don't see why it wouldn't be possible for someone (not necessarily me) to add them as WebRTC cameras into home assistant with something like https://github.com/AlexxIT/WebRTC

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/JoshuaMulliken/ha-wyzeapi/issues/265#issuecomment-949583479, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACGXNJGKGRCWP4BXRQA7JD3UIFJ6FANCNFSM5FO4EMHA.

LordNex avatar Oct 22 '21 13:10 LordNex

Actually that worked perfect. Just load the WebRTC add in through HACS, then add the integration, you’ll then have a custom card for adding your cameras. Works way better than ffmpeg or generic and allows for audio. Looks like there might even be some PTZ controls. And yes I tested it from the outside on my iPhone and everything comes up fine.

Might just have solved that issue bro. Thanks 👍

Benjamin T Powers

On Oct 22, 2021, at 8:23 AM, Benjamin Powers @.***> wrote:

 There’s an integration built into HA for WebRTC. But I have no idea how to use it to access the cameras. I’ll play around with it a bit but I just picked up a Jetson Nano so I think I’ll load up DeepStack and see if I can tie the feeds in through that. Like I said though. I just don’t think the Wyze cameras have the stability over RTSP to really be viable outside of a quick look camera

Benjamin T Powers

On Oct 22, 2021, at 7:26 AM, Joe Schubert @.***> wrote:



I wish there was a better way to implement their camera feeds instead of the very unstable RTSP implementation they currently have.

Their cameras supposedly support WebRTC, and from my understanding, it's how Google and Amazon devices can display them. Unfortunately, I don't have any of my FireTVs rooted to be able MITM their handshakes, but I also don't know enough about WebRTC to really reverse engineer it either. If someone could figure out the handshake then I don't see why it wouldn't be possible for someone (not necessarily me) to add them as WebRTC cameras into home assistant with something like https://github.com/AlexxIT/WebRTC

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/JoshuaMulliken/ha-wyzeapi/issues/265#issuecomment-949583479, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACGXNJGKGRCWP4BXRQA7JD3UIFJ6FANCNFSM5FO4EMHA.

LordNex avatar Oct 22 '21 13:10 LordNex

Only one I can’t do is my Outdoor cam. Of course it doesn’t do RSTP and I have no idea how to bring it into HA

Benjamin T Powers

On Oct 22, 2021, at 8:50 AM, Benjamin Powers @.***> wrote:

 Actually that worked perfect. Just load the WebRTC add in through HACS, then add the integration, you’ll then have a custom card for adding your cameras. Works way better than ffmpeg or generic and allows for audio. Looks like there might even be some PTZ controls. And yes I tested it from the outside on my iPhone and everything comes up fine.

Might just have solved that issue bro. Thanks 👍

Benjamin T Powers

On Oct 22, 2021, at 8:23 AM, Benjamin Powers @.***> wrote:

 There’s an integration built into HA for WebRTC. But I have no idea how to use it to access the cameras. I’ll play around with it a bit but I just picked up a Jetson Nano so I think I’ll load up DeepStack and see if I can tie the feeds in through that. Like I said though. I just don’t think the Wyze cameras have the stability over RTSP to really be viable outside of a quick look camera

Benjamin T Powers

On Oct 22, 2021, at 7:26 AM, Joe Schubert @.***> wrote:



I wish there was a better way to implement their camera feeds instead of the very unstable RTSP implementation they currently have.

Their cameras supposedly support WebRTC, and from my understanding, it's how Google and Amazon devices can display them. Unfortunately, I don't have any of my FireTVs rooted to be able MITM their handshakes, but I also don't know enough about WebRTC to really reverse engineer it either. If someone could figure out the handshake then I don't see why it wouldn't be possible for someone (not necessarily me) to add them as WebRTC cameras into home assistant with something like https://github.com/AlexxIT/WebRTC

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/JoshuaMulliken/ha-wyzeapi/issues/265#issuecomment-949583479, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACGXNJGKGRCWP4BXRQA7JD3UIFJ6FANCNFSM5FO4EMHA.

LordNex avatar Oct 22 '21 13:10 LordNex

Actually that worked perfect. Just load the WebRTC add in through HACS, then add the integration, you’ll then have a custom card for adding your cameras. Works way better than ffmpeg or generic and allows for audio. Looks like there might even be some PTZ controls. And yes I tested it from the outside on my iPhone and everything comes up fine. Might just have solved that issue bro. Thanks 👍 Benjamin T Powers On Oct 22, 2021, at 8:23 AM, Benjamin Powers @.> wrote:  There’s an integration built into HA for WebRTC. But I have no idea how to use it to access the cameras. I’ll play around with it a bit but I just picked up a Jetson Nano so I think I’ll load up DeepStack and see if I can tie the feeds in through that. Like I said though. I just don’t think the Wyze cameras have the stability over RTSP to really be viable outside of a quick look camera Benjamin T Powers On Oct 22, 2021, at 7:26 AM, Joe Schubert @.> wrote:  I wish there was a better way to implement their camera feeds instead of the very unstable RTSP implementation they currently have. Their cameras supposedly support WebRTC, and from my understanding, it's how Google and Amazon devices can display them. Unfortunately, I don't have any of my FireTVs rooted to be able MITM their handshakes, but I also don't know enough about WebRTC to really reverse engineer it either. If someone could figure out the handshake then I don't see why it wouldn't be possible for someone (not necessarily me) to add them as WebRTC cameras into home assistant with something like https://github.com/AlexxIT/WebRTC — You are receiving this because you commented. Reply to this email directly, view it on GitHub<#265 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACGXNJGKGRCWP4BXRQA7JD3UIFJ6FANCNFSM5FO4EMHA.

I'm assuming that you're doing that with rtsp firmware?

JoeSchubert avatar Oct 29 '21 23:10 JoeSchubert

@Ace0510 before the issue that derailed... was I right that you wanted to toggle motion on a per camera basis? I don't see any way to do this in the app. I can toggle notifications on a per device basis it looks like, but if notifications are on for it, motion is.

Can you screenshot the setting in the official app that you're trying to toggle? (And maybe what options it's under?)

JoeSchubert avatar Nov 10 '21 11:11 JoeSchubert

Hi Yoinx, correct toggle motion per camera. The app allows for motion (events) and for notifications for each camera. IFTTT allows for both events and motion as well as to record a 12s video to the cloud.

FFA1B24D-EF69-428B-BC4E-B106780B9948 6D2F4FD2-4BE7-42F1-908D-0E70A9C5CAD5 9CB7F221-3E50-4775-98F3-54775AE8B712

Ace0510 avatar Nov 10 '21 18:11 Ace0510

Thanks. That makes a bit more sense. My app had the other options locked out because I had event recording off. They became enabled once I turned that on. I'll see if I can't figure out the endpoints for that. I'm telling to bet that it's likely one endpoint per camera, which may be more load on the API than it's worth for the title (and polling it to keep it updated). But, we'll see how it goes, no ETA of course.

JoeSchubert avatar Nov 10 '21 19:11 JoeSchubert

Thanks for letting me know!

On Wed, Nov 10, 2021 at 11:09 AM Joe Schubert @.***> wrote:

Thanks. That makes a bit more sense. My app had the other options locked out because I had event recording off. They became enabled once I turned that on. I'll see if I can't figure out the endpoints for that. I'm telling to bet that it's likely one endpoint per camera, which may be more load on the API than it's worth for the title (and polling it to keep it updated). But, we'll see how it goes, no ETA of course.

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/JoshuaMulliken/ha-wyzeapi/issues/265#issuecomment-965653939, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIHY5LCENOFSO3YHYWNECD3ULK7MXANCNFSM5FO4EMHA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Ace0510 avatar Nov 10 '21 19:11 Ace0510

Actually that worked perfect. Just load the WebRTC add in through HACS, then add the integration, you’ll then have a custom card for adding your cameras. Works way better than ffmpeg or generic and allows for audio. Looks like there might even be some PTZ controls. And yes I tested it from the outside on my iPhone and everything comes up fine. Might just have solved that issue bro. Thanks 👍 Benjamin T Powers On Oct 22, 2021, at 8:23 AM, Benjamin Powers @.> wrote:  There’s an integration built into HA for WebRTC. But I have no idea how to use it to access the cameras. I’ll play around with it a bit but I just picked up a Jetson Nano so I think I’ll load up DeepStack and see if I can tie the feeds in through that. Like I said though. I just don’t think the Wyze cameras have the stability over RTSP to really be viable outside of a quick look camera Benjamin T Powers On Oct 22, 2021, at 7:26 AM, Joe Schubert _@**.**_> wrote:  I wish there was a better way to implement their camera feeds instead of the very unstable RTSP implementation they currently have. Their cameras supposedly support WebRTC, and from my understanding, it's how Google and Amazon devices can display them. Unfortunately, I don't have any of my FireTVs rooted to be able MITM their handshakes, but I also don't know enough about WebRTC to really reverse engineer it either. If someone could figure out the handshake then I don't see why it wouldn't be possible for someone (not necessarily me) to add them as WebRTC cameras into home assistant with something like https://github.com/AlexxIT/WebRTC — You are receiving this because you commented. Reply to this email directly, view it on GitHub<#265 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACGXNJGKGRCWP4BXRQA7JD3UIFJ6FANCNFSM5FO4EMHA.

I'm assuming that you're doing that with RTSP firmware?

Yes, I have them on the older version of the RSTP firmware because I just haven't taken the time to grab them and reflash them since they are in weird places outside. Im slowly phasing them out for Amcresh AD410 Doorbells and Reolink RCL520A PoE cameras. I'll probably repurpose the Pan Cams I have for some indoor work ( We just had a litter of kittens so kitten cam going up).

My current setup is Frigate Running on an ESXi 7 Server with a GPU For basic Object detection which gets passed via MQTT to DeepStack on Jetson Nano 4gig to do Facial Recognition. Then I'm using the Double-Take Integration to pull all of those services together in Home Assistant with a Front End to Create New Users and Train new models based upon clips gathered or photos I already have. Works really well. Enough that I have it tied into my locks to unlock the doors when it sees one of us(Few other checks in there for safety like is there phone home)

LordNex avatar Dec 22 '21 02:12 LordNex

I think that Ace0510 mega that they rant a toggle to disable motion detection per camera, not to get motion detection alerts.

I thought that was the way it was implemented currently. That is to say, the current toggle switches for the camera entities only turn off notifications from that specific camera. Not turn the whole camera off. Although I cant remember the last time I did it minus my Outdoor cam and I rarely touch it since its not RSTP

LordNex avatar Dec 22 '21 02:12 LordNex

Is this something we’re still interested in? I’ve had part of this working for a while now by adding a switch for turning notifications on/off per camera.

7823E952-8C13-43CC-94BD-886ABCC8007A

Of course this adds an extra entity to be polled for each camera, but I’ve been running it on 6 cameras for several months now with no issues. What do you think @yoinx @JoshuaMulliken?

brg468 avatar Mar 26 '22 17:03 brg468

I am worried that if we enable this for the repo I will get an angry email from Wyze telling me that I am ruining there service. It was only a problem because of the large number of HA users.

Last time they threatened to disable access to all HA users...

SecKatie avatar Mar 26 '22 17:03 SecKatie

That’s fine, that’s why I never submitted a PR for it. I assume it’s probably only a small number of people that would actually find it useful.

brg468 avatar Mar 26 '22 20:03 brg468

Yes please, that will be great.

Ace0510 avatar Mar 27 '22 03:03 Ace0510

I am worried that if we enable this for the repo I will get an angry email from Wyze telling me that I am ruining there service. It was only a problem because of the large number of HA users.

Last time they threatened to disable access to all HA users...

Actually now that I think about it, this won't add any overhead. We're already polling the camera, we just need to update the switch based on that info. It's the same as what the siren entity is doing.

brg468 avatar Mar 27 '22 22:03 brg468

@brg468 oh gotcha so it is notifications to your phone and not through HA? I think the switch would be a valuable feature then!

SecKatie avatar Mar 28 '22 15:03 SecKatie

@brg468 oh gotcha so it is notifications to your phone and not through HA? I think the switch would be a valuable feature then!

Exactly! My use case is I want notifications from my outdoor cameras when I'm not home but disable them when I am home.

brg468 avatar Mar 28 '22 16:03 brg468

I've submitted the PR for the notification switch.

As far as a motion switch, I can't find a reliable way of implementing it. There is a camera property that supposedly indicates motion on/off, but its not always correct in my experience. And while I'm able to change it to what should be on or off, it doesn't seem to have any effect on the camera. If anybody else wants to take a stab at it or has any more info let me know.

brg468 avatar Mar 29 '22 19:03 brg468

Really love that there is still interest in this integration. Every WYZE ecosystem feature that can go through HA, I see as a win. Thanks everyone.

chrisvball avatar Mar 29 '22 20:03 chrisvball

There is a camera property that supposedly indicates motion on/off, but its not always correct in my experience.

I know that this issue is rather old... But I'm trying to catch up/clean up old/stale issues.

Is this still valid/open? Did you ever get a property that indicated it correctly? You mentioned a property, but is this not indicated by device_params - motion_alarm_switch ? I don't know that you have to dig through the getprops responses looking for this if it's provided in the get_devices endpoint dump.

It might actually be a combination of: records_events_switch == 1 and motion_alarm_switch == 1 as I seem to recall, and re-read in this issue, that the motion toggle is irrelevant if you don't have event recording enabled.

JoeSchubert avatar Jan 12 '23 23:01 JoeSchubert

I’ve had mixed luck getting properties to indicate correctly. Now that you say it, I think the device_params would work, but it didn’t seem like they were updating in real time..I’ll have to go back and look again.

Edit: I see now, it looks like we only pull params every 20 minutes.

brg468 avatar Jan 13 '23 01:01 brg468

Weird. I didn't think we set it that long. But that could easily be updated to pull once every 30 or something... basically, update it like any other single device.

edit Actually, I remember now... I set it for a ridiculously long time because we weren't querying on a fixed schedule originally. But there's ALOT of information that we can get from there that might knock down on how many devices need to be queried individually. I'm just not sure if that endpoint will cause a lot of undue strain on Wyze.... but their app pings it pretty aggressively anyway.

JoeSchubert avatar Jan 13 '23 23:01 JoeSchubert

So I updated the time to pull params every 30 seconds to test. motion_alarm_switch works fine on V3 cams, but on V2 cams its actually less reliable than the property (P1047 seems to be the one for V2's). It updates the first couple times then seems to just stop updating all together. I really don't get these cameras sometimes...

brg468 avatar Jan 17 '23 16:01 brg468

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Aug 15 '23 01:08 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Aug 20 '23 01:08 github-actions[bot]