nonsleepr / ha-eufy-security

Custom integration of Home Assistant with EufySecurity
168 stars 44 forks source link

Enable/disable motion detection #1

Closed nonsleepr closed 4 years ago

nonsleepr commented 4 years ago

Expose camera parameters as attributes as well.

Requires FuzzyMistborn/python-eufy-security#14 to be merged and published to PyPI as python-eufy-security==0.1.2.

FuzzyMistborn commented 4 years ago

This changes the setting per camera in the settings right? Ie Settings-->Motion Detection-->Toggle off detection mode? If so that's the main thing I've been looking for!

nonsleepr commented 4 years ago

Yes. It is per device. I have just a single device though, but the code targets specific device_sn.

FuzzyMistborn commented 4 years ago

Curious how you discovered the call/url to do this. Maybe there's some other settings we can mimic/mirror.

nonsleepr commented 4 years ago

I decompiled the Android app and pulled the parameters mapping from there. I tried to poke into other settings with no success. I changed the integration to expose all parameters in entity's state, so changing settings in the app and observing what changes in the state would be easy (need to implement forced update though).

FuzzyMistborn commented 4 years ago

Nice work!

FuzzyMistborn commented 4 years ago

Tested, so far so good! Very quick response. Few comments: 1) Probably shouldn't print the access token as an attribute in the states. Should try to find a way to suppress. 2) May also want to generally limit what shows just because it's a long state attribute. Things like the polygon may not need to be there.

nonsleepr commented 4 years ago

Yeah, I exposed it to see what's there. Probably only a couple of options should be actually shown. I guess the capacity could be a sensor, and maybe a snooze mode.

FuzzyMistborn commented 4 years ago

Yeah I'm going to open a new issue with some suggestions.

nonsleepr commented 4 years ago

BTW, access_token isn't the one from the API, it comes from HASS' mjpeg component.