pleasereset / ha-amcrest

Clone of the HomeAssistant core amcrest integration
MIT License
1 stars 0 forks source link

Unable to use camera.snapshot 500 Server error #1

Closed bryeartem closed 3 years ago

bryeartem commented 3 years ago

First off thank you, I have had to find alternatives for 4 years to handle my Amcrest nvr events… I would be thrilled to get a working integration. I have it setup as RTSP, which is how I manually use each of my cameras currently with ffmpeg and an RTSP url. When tried to use the camera.snapshot service I get this error: Trying again due to error: HTTPError('500 Server Error: Internal Server Error for url: http://192.168.1.108:80/cgi-bin/snapshot.cgi?channel=1') I kind of expected it to use whatever method HA uses to generate a snapshot of an ffmpeg camera stream with an RTSP url rather than trying to use the snapshot.cgi which in my experience has always been flakey on Amcrest stuff. (My apologies if vague, I’m at work currently and will try to update with more details later.. I just happened to realize my snapshots weren’t working while here)

bryeartem commented 3 years ago

From what I can figure out this appears to be an issue with Amcrest cameras and the snapshot.cgi Not sure if there is a way to get HA to try to snapshot with the same method it uses for the FFMPEG camera as that works fine. Any chance you know how I could disable the camera portion of this component just to get the binary sensors? Thanks for your work on this.

pleasereset commented 3 years ago

Hey hi! I'm actually surprised you managed to find this repo - been trying to contribute the changes back to HomeAssistant (https://github.com/home-assistant/core/pull/46095) but changes in policy would require to rework the entire configuration section of the integration in order to merge in, something completely perpendicular to my changes and I am not sure I have the bandwidth to take that on.

I think that to disable the camera portion, so tweaks need to be make to the code. Definitely doable - I can probably help with that on my spare time if needed.

bryeartem commented 3 years ago

I browse the pull requests from time to time to see what kind of stuff is in the works. I for my entire 4 years or so of using HA have had to find alternatives to get my motion events from cameras attached to my NVRs.. mostly https://github.com/psyciknz/CameraEvents so I was thrilled when I saw a component. I had in years past tried to get the original creator of the Amcrest component to support NVRs but he did not have one so he had no desire to do so. I even tried to teach myself python just for this purpose… lol… that didn’t go well.
So if I could somehow disable the camera stream part to just get the online and motion sensors that would be amazing.. I’ll see what I can figure out myself, and would appreciate if you had any pointers on stripping out the camera. Thank you again for your time!

also I forgot to mention I also seem to get this from the events and I’m not sure why.. they still seem to work.. ``` 2021-02-07 19:34:40 WARNING (Amcrest EventMonitor [192.168.1.108]) [custom_components.amcrestdev.event_monitor] Received invalid/truncated event information, best-effort parsing: Code=VideoMotion;action=Start;index