core: Amcrest Camera error: Bad request for VideoMotion
The problem
After I upgraded from Home Assistant Core 0.107.7 to 0.108.1, I see the following warnings and errors from my Amcrest Camera:
It retries 30 times:
WARNING (Amcrest Amcrest Camera) [amcrest.http] <Camera Name> Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://camera-ip:80/cgi-bin/eventManager.cgi?action=attach&codes=%5BVideoMotion%5D')
Followed by:
ERROR (Amcrest Amcrest Camera) [homeassistant.components.amcrest] Amcrest Camera camera offline: Too many errors
This repeats every couple of seconds.
The camera model is IP2M-841-V3
Removing the motion_detected binary sensor from the config fixes the issue.
Environment
- Home Assistant Core release with the issue: 0.108.1
- Last working Home Assistant Core release (if known): 0.107.7
- Operating environment (Home Assistant/Supervised/Docker/venv): Docker
- Integration causing this issue: Amcrest
- Link to integration documentation on our website: https://www.home-assistant.io/integrations/amcrest/
Problem-relevant configuration.yaml
amcrest:
- host: !secret amcrest_ip
username: !secret amcrest_username
password: !secret amcrest_password
resolution: low
binary_sensors:
- motion_detected
- online
Traceback/Error logs
WARNING (Amcrest Amcrest Camera) [amcrest.http] <Camera Name> Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://camera-ip:80/cgi-bin/eventManager.cgi?action=attach&codes=%5BVideoMotion%5D')
ERROR (Amcrest Amcrest Camera) [homeassistant.components.amcrest] Amcrest Camera camera offline: Too many errors
Additional information
I think this may have been caused by #32818, but I don’t have a good understanding of the Amcrest API, so I may be wrong.
Motion detection used to work in 0.107.7.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 32 (14 by maintainers)
Hi @GeorgeSG, the problem I have and I am sure many others, is that Dahua only support firmwares for a short while. For example this is the last firmware for mine… as far as i know
Device Type IPC-HDW4300S Software Version 2.420.0009.0.R, build : 2015-11-06 WEB Version 3.2.1.305503 ONVIF Version 2.4.1So given that the cameras clearly have a bug for not being able to accept a proper encoded URL, ill flag a bug on Python Amcrest and see if any miles are achieved.
I have the same issue upgrading from 0.107.7 to 0.108.6, with the 400 Client Errors on generic Dahau cameras. They don’t like the command URLencoding the []. I did a quick and dirty patch to event.py, and got it working…
The param appends without URLencoding. Hope that helps!
/Mike