natekspencer / hacs-vivint

Home Assistant integration for a Vivint home security system.
MIT License
66 stars 5 forks source link

Binary Sensor Motion on Vivint Outdoor Pro Camera Not Changing States #32

Closed garettharnish closed 2 years ago

garettharnish commented 2 years ago

I can't seem to get a state change from the motion detector on my Vivint Outdoor Pro Camera (ODC300), even when I trigger the linger detection it remains at Clear/off.

Is this a change I need to make on the Panel or in my mobile app to expose that information to this integration or is it a bug?

natekspencer commented 2 years ago

You might need to change the detection window and sensitivity in the app for that camera. Are you seeing events in your activity history for "Person detected" or "Person lingering" on that camera in the app?

garettharnish commented 2 years ago

I am getting the motion alerts in the Vivint app, it's just not making it to the Home Assistant side of things.

natekspencer commented 2 years ago

What version of HA are you on? Are you getting other events like door open/close, etc? It's possible pubnub stopped responding if you aren't seeing instant updates from doors and windows, which usually corrects itself on a HA restart.

If a restart doesn't work, you'll probably need to enable debugging and see if there are any errors or anything showing up from the Vivint integration:

logger:
  default: error
  logs:
    custom_components.vivint: debug
    vivintpy: debug
garettharnish commented 2 years ago

I'm on 2021.12.2.

I haven't really checked the other components. I do have one automation that attaches to arming/disarming the alarm that seems to work. I just wrote a quick automation to use the motion sensor in my living room to turn on the lights and it doesn't appear to have done anything (even though the Vivint app shows motion when I was there).

I'll enable debugging and see what comes up.

garettharnish commented 2 years ago

Looks like some kind of permission problem on my side. 1s after I triggered the motion sensor, this error appeared:

2021-12-31 10:35:38 ERROR (MainThread) [pubnub] take message interrupted: [Errno 13] Permission denied: '.pubnub.log'

Since that is what you're using to subscribe, I'm assuming it crashing because it can't log is an issue ... not sure exactly where it is trying to write to though.

natekspencer commented 2 years ago

Yup, that would do it. Can you try creating a file called .pubnub.log in your HA config directory? That should at least allow it to work for now

garettharnish commented 2 years ago

It looks like my pubnub.py in vivintpy was modified. I've restored it to the version from tag 2021.10.1 and I think that is going to fix it.

natekspencer commented 2 years ago

Odd. The vivintpy on the web doesn't have that OUTPUT_FILE in it ... where did pip find this version?

My guess, I published from my local repo that has that code in it as I was doing some debugging 🤦🏻

garettharnish commented 2 years ago

Wherever it was trying to write the file, it didn't have access to. Restoring that file to 2021.10.1 has fixed the internal motion sensor (and I suspect the driveway one as well). Thank you for your help on this.