Code Monkey home page Code Monkey logo

amcrest2mqtt's People

Contributors

dchesterton avatar dependabot[bot] avatar sirgoodenough avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

amcrest2mqtt's Issues

Client error '403 Forbidden'

Since the last update been getting a 403 to the camera. Have confirmed the password is correct

21/11/2022 17:36:06 [INFO] App Version: 1.0.16
21/11/2022 17:36:06 [INFO] Fetching camera details...
21/11/2022 17:36:13 [INFO] Device type: AD110
21/11/2022 17:36:13 [INFO] Serial number: Z0568E8DDEB79
21/11/2022 17:36:13 [INFO] Software version: 1.000.00AC008.2.R (2022-09-07)
21/11/2022 17:36:13 [INFO] Device name: Front Door
21/11/2022 17:36:13 [INFO] Writing Home Assistant discovery config...
21/11/2022 17:36:13 [INFO] Fetching storage sensors...
21/11/2022 17:36:14 [INFO] Listening for events...
21/11/2022 17:36:16 [ERROR] Amcrest error: Client error '403 Forbidden' for url 'http://X.X.X.X/cgi-bin/eventManager.cgi?action=attach&codes=[All]'

HTTPError('400 Client Error: Bad Request for url:

getting this error , also getting like 10 pings per second for this domain from AMCREST doorbell 'drs.zencamcloud.com'

[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing...
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
16/02/2023 16:23:18 [INFO] App Version: 1.0.14
16/02/2023 16:23:18 [INFO] Fetching camera details...
16/02/2023 16:23:22 [INFO] Device type: AD110
16/02/2023 16:23:22 [INFO] Serial number: XYZ
16/02/2023 16:23:22 [INFO] Software version: 1.000.00AC009.0.R
16/02/2023 16:23:22 [INFO] Device name: Front_Doorbell_AD110
16/02/2023 16:23:22 [INFO] Writing Home Assistant discovery config...
16/02/2023 16:23:22 [INFO] Fetching storage sensors...
Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.1.95:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')
Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.1.95:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')
Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.1.95:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')
16/02/2023 16:23:24 [WARNING] Error fetching storage information 400 Client Error: Bad Request for url: http://192.168.1.95:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo
16/02/2023 16:23:25 [INFO] Listening for events...

`

image

image

Error fetching storage information 400 Client Error: Bad Request for url

Worked perfectly, but now not any MQTT messages the following in the log:

26/08/2021 09:10:01 [INFO] Fetching storage sensors...
Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.0.248:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')
Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.0.248:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')
Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.0.248:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')
26/08/2021 09:10:02 [WARNING] Error fetching storage information 400 Client Error: Bad Request for url: http://192.168.0.248:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo

Name does not resolve

I am trying to use Amcrest doorbell in Home assistant so I installed amcrest2mqtt using Truecharts on Truenas scale but I am facing this issue, could you help me which parameter is wrong?

I did not define the device name on amcrest2mqtt and it seems it is getting the name 'door' from the device it self.

2023-01-06 09:07:24.698301+00:0006/01/2023 09:07:24 [INFO] App Version: 1.0.16
2023-01-06 09:07:24.698789+00:0006/01/2023 09:07:24 [INFO] Fetching camera details...
2023-01-06 09:07:27.757485+00:0006/01/2023 09:07:27 [INFO] Device type: AD410
2023-01-06 09:07:27.757518+00:0006/01/2023 09:07:27 [INFO] Serial number: Z17A11EA73752
2023-01-06 09:07:27.757526+00:0006/01/2023 09:07:27 [INFO] Software version: 1.000.0000000.7.R (2021-02-20)
2023-01-06 09:07:27.757543+00:0006/01/2023 09:07:27 [INFO] Device name: door
2023-01-06 09:07:27.758553+00:00Traceback (most recent call last):
2023-01-06 09:07:27.758575+00:00File "/app/amcrest2mqtt.py", line 237, in <module>
2023-01-06 09:07:27.758721+00:00mqtt_client.connect(mqtt_host, port=mqtt_port)
2023-01-06 09:07:27.758751+00:00File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 914, in connect
2023-01-06 09:07:27.759313+00:00return self.reconnect()
2023-01-06 09:07:27.759333+00:00File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1044, in reconnect
2023-01-06 09:07:27.759689+00:00sock = self._create_socket_connection()
2023-01-06 09:07:27.759714+00:00File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3685, in _create_socket_connection
2023-01-06 09:07:27.760940+00:00return socket.create_connection(addr, timeout=self._connect_timeout, source_address=source)
2023-01-06 09:07:27.760964+00:00File "/usr/local/lib/python3.9/socket.py", line 823, in create_connection
2023-01-06 09:07:27.761299+00:00for res in getaddrinfo(host, port, 0, SOCK_STREAM):
2023-01-06 09:07:27.761321+00:00File "/usr/local/lib/python3.9/socket.py", line 954, in getaddrinfo
2023-01-06 09:07:27.761683+00:00for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
2023-01-06 09:07:27.761713+00:00socket.gaierror: [Errno -2] Name does not resolve

AD110 Front Door Motion Does Not Publish - "ProfileAlarmTransmit" is not used

It appears that under FW V1.000.00AC008.1.R (2021-07-12) for the AD110, "AlarmLocal" is now used for motion alerts. It appears "ProfileAlarmTransmit" is not used. No MQTT payloads have been pushed for motion alerts to HomeAssistant due to this nomenclature change.

05/08/2022 22:21:58 [INFO] {'Code': 'VideoMotion', 'action': 'Start', 'index': '0'}
05/08/2022 22:22:11 [INFO] {'Code': 'VideoMotion', 'action': 'Stop', 'index': '0'}
05/08/2022 22:24:25 [INFO] {'Code': 'VideoMotion', 'action': 'Start', 'index': '0'}
05/08/2022 22:24:26 [INFO] {'Code': 'AlarmLocal', 'action': 'Start', 'index': '6'}
05/08/2022 22:24:29 [INFO] {'Code': 'DoTalkAction', 'action': 'Pulse', 'index': '0', 'data': {'Action': 'Invite', 'CallID': '20220805182427@[email protected]', 'CallSrcMask': 4}}
05/08/2022 22:24:29 [INFO] {'Code': 'CallNoAnswered', 'action': 'Start', 'index': '0', 'data': {'CallID': '4'}}
05/08/2022 22:24:30 [INFO] {'Code': 'UpdateFile', 'action': 'Pulse', 'index': '0'}
05/08/2022 22:24:30 [INFO] {'Code': 'NewFile', 'action': 'Pulse', 'index': '55975043', 'data': {'File': '/mnt/sd/SnapShot/2022-08-05/18/18-24-27[0].jpg', 'Size': 276424}}
05/08/2022 22:24:39 [INFO] {'Code': 'AlarmLocal', 'action': 'Stop', 'index': '6'}
05/08/2022 22:24:39 [INFO] {'Code': 'CallNoAnswered', 'action': 'Stop', 'index': '0', 'data': {'CallID': '4'}}
05/08/2022 22:24:39 [INFO] {'Code': 'DoTalkAction', 'action': 'Pulse', 'index': '0', 'data': {'Action': 'Hangup', 'CallID': '20220805182427@[email protected]', 'CallSrcMask': 4, 'HangupReason': 'HangupByPhone'}}
05/08/2022 22:24:41 [INFO] {'Code': 'UpdateFile', 'action': 'Pulse', 'index': '0'}
05/08/2022 22:24:41 [INFO] {'Code': 'NewFile', 'action': 'Pulse', 'index': '31', 'data': {'File': '/mnt/sd/Record/2022-08-05/18/18.24.18-18.24.38[R][0@0][0].dav', 'Size': 2094136}}
05/08/2022 22:24:41 [INFO] {'Code': 'VideoMotion', 'action': 'Stop', 'index': '0'}
05/08/2022 22:26:12 [INFO] {'Code': 'TimeChange', 'action': 'Pulse', 'index': '0', 'data': {'BeforeModifyTime': '2022-08-05 18:26:12', 'ModifiedTime': '2022-08-05 18:26:11'}}
05/08/2022 22:26:12 [INFO] {'Code': 'NTPAdjustTime', 'action': 'Pulse', 'index': '0', 'data': {'Address': '200.160.0.8', 'Before': '2022-08-05 18:26:04', 'result': True}}
05/08/2022 22:26:33 [INFO] {'Code': 'VideoMotion', 'action': 'Start', 'index': '0'}
05/08/2022 22:26:45 [INFO] {'Code': 'VideoMotion', 'action': 'Stop', 'index': '0'}

This would need to be adjusted within amcrest2mqtt.py on line 423

Current:
if (is_ad110 and code == "ProfileAlarmTransmit") or (code == "VideoMotion" and not is_ad110):

Proposed:
if (is_ad110 and code == "AlarmLocal") or (code == "VideoMotion" and not is_ad110):

I am not sure at what FW version this changed.

Failing to login

When I startup the container I'm getting a login error

01/07/2021 23:38:14 [INFO] App Version: 1.0.5
01/07/2021 23:38:14 [INFO] Fetching camera details...
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/amcrest/http.py", line 114, in _generate_token
    resp = self._command(cmd).content.decode('utf-8')
  File "/usr/local/lib/python3.9/site-packages/amcrest/http.py", line 203, in _command
    raise LoginError
amcrest.exceptions.LoginError

i'm running docker compose 2.1 and my compose looks like so

amcrest2mqtt:
    container_name: amcrest2mtt
    image: dchesterton/amcrest2mqtt:latest
    restart: unless-stopped
    environment:
      AMCREST_HOST: 192.168.1.142
      AMCREST_PASSWORD: myCameraPassword
      MQTT_HOST: 192.168.1.67
      MQTT_USERNAME: mqttUser
      MQTT_PASSWORD: mqttPass
      HOME_ASSISTANT: "true"

I know that I've got the IP and the password correct, I used them to connect to the camera via Blue Iris.
Am I missing something?

HTTPError '400 Client Error: Bad Request for url

Hi,

I got this issue

[21:37:46] INFO: Read all configuration settings
[21:37:47] INFO: Start the amcrest2mqtt.py
30/10/2021 01:37:49 [INFO] App Version: 1.0.11
30/10/2021 01:37:49 [INFO] Fetching camera details...
30/10/2021 01:37:51 [INFO] Device type: AD110
30/10/2021 01:37:51 [INFO] Serial number: xxxxxxx
30/10/2021 01:37:51 [INFO] Software version: 1.000.00AC006.0.R
30/10/2021 01:37:51 [INFO] Device name: Doorbell
30/10/2021 01:37:51 [INFO] Writing Home Assistant discovery config...
30/10/2021 01:37:51 [INFO] Fetching storage sensors...
<Doorbell:xxxxxxxxxxx> Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.20.9:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Any idea?

FR: Better Versioning

Recently there has been a bug #67 where the fix appears to be to revert to a previous version. However, that is not as easy as it sounds as no versioning or releases are in place so one must manually find the commit before the changes were made that introduced the bug.
I suggest using GitHub releases and/or publishing amcrest2mqtt to PyPI

Error on Human detected

Getting an error on latest version when a human is detected by amcrest doorbell.

25/03/2022 22:06:09 [INFO] App Version: 1.0.16
25/03/2022 22:06:09 [INFO] Fetching camera details...
25/03/2022 22:06:14 [INFO] Device type: AD410
25/03/2022 22:06:14 [INFO] Serial number: REDACTED
25/03/2022 22:06:14 [INFO] Software version: 1.000.0000000.7.R (2021-02-20)
25/03/2022 22:06:14 [INFO] Device name: Front Door
25/03/2022 22:06:15 [INFO] Writing Home Assistant discovery config...
25/03/2022 22:06:15 [INFO] Fetching storage sensors...
25/03/2022 22:06:15 [INFO] Listening for events...
25/03/2022 22:08:46 [INFO] {'Code': 'TimeChange', 'action': 'Pulse', 'index': '0', 'data': {'BeforeModifyTime': '2022-03-25 05:08:46', 'ModifiedTime': '2022-03-25 05:08:46'}}
25/03/2022 22:08:46 [INFO] {'Code': 'NTPAdjustTime', 'action': 'Pulse', 'index': '0', 'data': {'Address': '200.160.0.8', 'Before': '2022-03-25 05:08:45', 'result': True}}
25/03/2022 22:09:41 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State', 'index': '0'}
25/03/2022 22:09:41 [INFO] {'Code': 'VideoMotion', 'action': 'Start', 'index': '0', 'data': {'Id': [0], 'RegionName': ['Region1']}}
25/03/2022 22:09:42 [INFO] {'Code': 'NewFile', 'action': 'Pulse', 'index': '0', 'data': {'File': '/mnt/sd/2022-03-25/001/jpg/17/09/42[M][0@0][0].jpg', 'Size': 39803, 'StoragePoint': 'NULL'}}
an error occurred during closing of asynchronous generator <async_generator object AsyncClient.stream at 0x7f9eb4040820>
asyncgen: <async_generator object AsyncClient.stream at 0x7f9eb4040820>
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
    return future.result()
  File "/app/amcrest2mqtt.py", line 426, in main
    elif code == "CrossRegionDetection" and payload["data"]["ObjectType"] == "Human":
KeyError: 'ObjectType'

During handling of the above exception, another exception occurred:

RuntimeError: aclose(): asynchronous generator is already running
an error occurred during closing of asynchronous generator <async_generator object Http.async_stream_command at 0x7f9eb3c9e4c0>
asyncgen: <async_generator object Http.async_stream_command at 0x7f9eb3c9e4c0>
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
    return future.result()
  File "/app/amcrest2mqtt.py", line 426, in main
    elif code == "CrossRegionDetection" and payload["data"]["ObjectType"] == "Human":
KeyError: 'ObjectType'

During handling of the above exception, another exception occurred:

RuntimeError: aclose(): asynchronous generator is already running
an error occurred during closing of asynchronous generator <async_generator object Http._async_stream_command at 0x7f9eb4040790>
asyncgen: <async_generator object Http._async_stream_command at 0x7f9eb4040790>
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
    return future.result()
  File "/app/amcrest2mqtt.py", line 426, in main
    elif code == "CrossRegionDetection" and payload["data"]["ObjectType"] == "Human":
KeyError: 'ObjectType'

During handling of the above exception, another exception occurred:

RuntimeError: aclose(): asynchronous generator is already running
Traceback (most recent call last):
  File "/app/amcrest2mqtt.py", line 440, in <module>
    asyncio.run(main())
  File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
    return future.result()
  File "/app/amcrest2mqtt.py", line 426, in main
    elif code == "CrossRegionDetection" and payload["data"]["ObjectType"] == "Human":
KeyError: 'ObjectType'

Human Detection not passing to MQTT

I have a AD410 and my MQTT isnt getting events for human detection. I have enabled human detection in the app and the app will respond when i step in front of the camera but no topic published

I have used latest and, for testing, version 1.0.12

Issue with AD410

I am running the docker on Unraid and I am seeing these errors with an AD410. Let me know if I can provide any further information. Thanks!

an error occurred during closing of asynchronous generator <async_generator object AsyncClient.stream at 0x151197070820>
asyncgen: <async_generator object AsyncClient.stream at 0x151197070820>
Traceback (most recent call last):
File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/local/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
return future.result()
File "/app/amcrest2mqtt.py", line 426, in main
elif code == "CrossRegionDetection" and payload["data"]["ObjectType"] == "Human":
KeyError: 'ObjectType'

During handling of the above exception, another exception occurred:

RuntimeError: aclose(): asynchronous generator is already running

Storage Poll too frequent

interval is set near the top
storage_sensors_interval = 60 # 1 hour

and used in the timer start
Timer(storage_sensors_interval, refresh_storage_sensors).start()

Interval should be expressed in seconds instead of minutes. 1 hour would be 3600.

I changed a copy to 86400 because I only wanted it once a day.

Nice script by the way.
FYI, I have the AD410 but also have some other dahua cameras. I added support for defining the events through the environment and support for smart motion detection for human and vehicle for other cameras. Easy to follow and modify.

[BUG] Fatal Python error: init_interp_main: can't initialize time

When running on a Raspberry Pi 4, I get the following error:

Fatal Python error: init_interp_main: can't initialize time
Python runtime state: core initialized
PermissionError: [Errno 1] Operation not permitted

Current thread 0xb6f40390 (most recent call first):
<no Python frame>

Based on other project threads (ie. here), it appears to be a problem with Alpine and the RPi.

Installing libseccomp2 from backports is a workaround.

Imou flood light & siren

Works with Imou camera (IPC-C26E), wondered if it would be possible to have it have a switch for the siren and or the floodlight built into the camera?

Thanks

Abandoned Project

It's been nearly a year since this project has had any activity with numerous issues and PRs opened with no ability to address. Sad to say it looks like this current version of the project is now dead.

501 Server Error on AD110 and NA Entities in HA

Installed v1.0.16. Receiving the following errors. A 501 server error on container start, and async_generator errors when doorbell is rung. Rebooting doorbell & container does not improve the situation.

`28/07/2022 19:10:58 [INFO] {'Code': 'AlarmLocal', 'action': 'Start', 'index': '6'}
28/07/2022 19:10:58 [INFO] {'Code': 'AlarmLocal', 'action': 'Start', 'index': '7'}
28/07/2022 19:11:01 [INFO] {'Code': 'AlarmLocal', 'action': 'Stop', 'index': '6'}
28/07/2022 19:11:02 [INFO] {'Code': 'AlarmLocal', 'action': 'Stop', 'index': '7'}
28/07/2022 19:11:05 [INFO] {'Code': 'AlarmLocal', 'action': 'Start', 'index': '7'}
28/07/2022 19:11:06 [INFO] {'Code': 'AlarmLocal', 'action': 'Start', 'index': '6'}
28/07/2022 19:11:08 [INFO] {'Code': 'AlarmLocal', 'action': 'Stop', 'index': '7'}
28/07/2022 19:11:14 [INFO] {'Code': 'UpdateFile', 'action': 'Pulse', 'index': '0'}
28/07/2022 19:11:14 [INFO] {'Code': 'HotPlug', 'action': 'Pulse', 'index': '0'}
28/07/2022 19:11:16 [INFO] {'Code': 'AlarmLocal', 'action': 'Stop', 'index': '6'}
28/07/2022 19:11:23 [INFO] {'Code': 'VideoMotion', 'action': 'Stop', 'index': '0'}
28/07/2022 19:12:03 [INFO] Exiting app...
28/07/2022 19:12:07 [INFO] App Version: 1.0.16
28/07/2022 19:12:07 [INFO] Fetching camera details...
28/07/2022 19:12:09 [INFO] Device type: AD110
28/07/2022 19:12:09 [INFO] Serial number: ##Removed##
28/07/2022 19:12:09 [INFO] Software version: 1.000.00AC003.0.R (2019-11-13)
28/07/2022 19:12:09 [INFO] Device name: Front Door
28/07/2022 19:12:09 [INFO] Writing Home Assistant discovery config...
28/07/2022 19:12:09 [INFO] Fetching storage sensors...
<Front Door:##SN##> Trying again due to error: HTTPError('501 Server Error: Not Implemented for url: http://192.168.1.203:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')
<Front Door:##SN##> Trying again due to error: HTTPError('501 Server Error: Not Implemented for url: http://192.168.1.203:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')
<Front Door:##SN##> Trying again due to error: HTTPError('501 Server Error: Not Implemented for url: http://192.168.1.203:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')
28/07/2022 19:12:10 [WARNING] Error fetching storage information 501 Server Error: Not Implemented for url: http://192.168.1.203:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo
28/07/2022 19:12:10 [INFO] Listening for events...
28/07/2022 19:12:47 [INFO] {'Code': 'VideoMotion', 'action': 'Start', 'index': '0'}
28/07/2022 19:12:48 [INFO] {'Code': 'AlarmLocal', 'action': 'Start', 'index': '6'}
28/07/2022 19:12:50 [INFO] {'Code': 'AlarmLocal', 'action': 'Start', 'index': '7'}
28/07/2022 19:12:52 [INFO] {'Code': 'UpdateFile', 'action': 'Pulse', 'index': '0'}
28/07/2022 19:12:52 [INFO] {'Code': 'NewFile', 'action': 'Pulse', 'index': '1936614731'}
28/07/2022 19:12:52 [INFO] {'Code': 'UpdateFile', 'action': 'Pulse', 'index': '0'}
28/07/2022 19:12:52 [INFO] {'Code': 'NewFile', 'action': 'Pulse', 'index': '34234187'}
28/07/2022 19:12:55 [INFO] {'Code': 'AlarmLocal', 'action': 'Stop', 'index': '7'}
28/07/2022 19:12:55 [INFO] {'Code': 'AlarmLocal', 'action': 'Stop', 'index': '6'}
28/07/2022 19:12:58 [INFO] {'Code': 'AlarmLocal', 'action': 'Start', 'index': '6'}
28/07/2022 19:13:01 [INFO] {'Code': 'AlarmLocal', 'action': 'Stop', 'index': '6'}
28/07/2022 19:13:01 [INFO] {'Code': 'UpdateFile', 'action': 'Pulse', 'index': '0'}
28/07/2022 19:13:01 [INFO] {'Code': 'NewFile', 'action': 'Pulse', 'index': '34255631'}
28/07/2022 19:13:04 [INFO] {'Code': 'AlarmLocal', 'action': 'Start', 'index': '6'}
28/07/2022 19:13:04 [INFO] {'Code': 'AlarmLocal', 'action': 'Start', 'index': '7'}
28/07/2022 19:13:07 [INFO] {'Code': 'AlarmLocal', 'action': 'Stop', 'index': '6'}
28/07/2022 19:13:08 [INFO] {'Code': 'UpdateFile', 'action': 'Pulse', 'index': '0'}
28/07/2022 19:13:08 [INFO] {'Code': 'NewFile', 'action': 'Pulse', 'index': '1936614730'}
28/07/2022 19:13:08 [INFO] {'Code': 'AlarmLocal', 'action': 'Stop', 'index': '7'}
28/07/2022 19:13:08 [INFO] {'Code': 'UpdateFile', 'action': 'Pulse', 'index': '0'}
28/07/2022 19:13:08 [INFO] {'Code': 'NewFile', 'action': 'Pulse', 'index': '34234186'}
28/07/2022 19:13:11 [INFO] {'Code': 'AlarmLocal', 'action': 'Start', 'index': '6'}
28/07/2022 19:13:11 [INFO] {'Code': 'AlarmLocal', 'action': 'Start', 'index': '7'}
an error occurred during closing of asynchronous generator <async_generator object Http._async_stream_command at 0x7f02c8c29820>
asyncgen: <async_generator object Http._async_stream_command at 0x7f02c8c29820>
Traceback (most recent call last):
File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/local/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
return future.result()
File "/app/amcrest2mqtt.py", line 430, in main
doorbell_payload = "on" if payload["data"]["Action"] == "Invite" else "off"
KeyError: 'data'

During handling of the above exception, another exception occurred:

RuntimeError: aclose(): asynchronous generator is already running
an error occurred during closing of asynchronous generator <async_generator object Http.async_stream_command at 0x7f02c8c29790>
asyncgen: <async_generator object Http.async_stream_command at 0x7f02c8c29790>
Traceback (most recent call last):
File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/local/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
return future.result()
File "/app/amcrest2mqtt.py", line 430, in main
doorbell_payload = "on" if payload["data"]["Action"] == "Invite" else "off"
KeyError: 'data'

During handling of the above exception, another exception occurred:

RuntimeError: aclose(): asynchronous generator is already running
an error occurred during closing of asynchronous generator <async_generator object AsyncClient.stream at 0x7f02c88a4f70>
asyncgen: <async_generator object AsyncClient.stream at 0x7f02c88a4f70>
Traceback (most recent call last):
File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/local/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
return future.result()
File "/app/amcrest2mqtt.py", line 430, in main
doorbell_payload = "on" if payload["data"]["Action"] == "Invite" else "off"
KeyError: 'data'

During handling of the above exception, another exception occurred:

RuntimeError: aclose(): asynchronous generator is already running
Traceback (most recent call last):
File "/app/amcrest2mqtt.py", line 440, in
asyncio.run(main())
File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/local/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
return future.result()
File "/app/amcrest2mqtt.py", line 430, in main
doorbell_payload = "on" if payload["data"]["Action"] == "Invite" else "off"
KeyError: 'data'`

[ERROR] Error fetching camera details

Using pull 1.0.16 and confirmed the password to my AD110 camera. Also confirmed the IP address of the camera, per the Amcrest app. It appears to connect per the line in the log stating [INFO], but then logs the Error fetching camera details. I have no other information to provide. I have the latest firmware on the camera and can access the camera from the Amcrest app. I've also rebooted the camera numerous times but to no avail. Any thoughts? I also tried pull 1.0.15 and have the same issues.

16/07/2022 00:44:48 [INFO] Fetching camera details...
16/07/2022 00:44:48 [ERROR] Error fetching camera details

Motion events not sent to MQTT for AD110

I have 2 AD110 doorbells that work great. They detect motion events via BlueIris and record perfectly. But for some reason, the motion event isn't sent to MQTT and I don't even have a "motion" topic in my MQTT broker:
image

I did see that when there is a motion trigger event, the "event" topic displays the following (in this order):

{"Code": "VideoMotion", "action": "Start"}
{"Code": "AlarmLocal", "action": "Start"}
{"Code": "AlarmLocal", "action": "Stop"}
{"Code": "VideoMotion", "action": "Stop"}

As far as I can tell, we can just keep an eye out for the VideoMotion key and use that to signal any motion. I think this line in the python script directly contradicts that theory, hence not sending the motion signal to the MQTT server: if (is_ad110 and code == "ProfileAlarmTransmit") or (code == "VideoMotion" and not is_ad110):. I think we should check for both the keys ProfileAlarmTransmit OR VideoMotion and then send the "motion" signal to the MQTT server in order to solve issue #13 as well . Although I don't understand why the devices send different payloads when motion is detected, maybe my doorbell is setup in a different configuration?

MQTT connection issue

I set the MQTT Password, Username, address, port, and QOS but no connection maybe something else not sure

mqtt_client.connect(mqtt_host, port=mqtt_port)
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 941, in connect
return self.reconnect()
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1075, in reconnect
sock = self._create_socket_connection()
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3546, in _create_socket_connection
return socket.create_connection(addr, source_address=source, timeout=self._keepalive)
File "/usr/local/lib/python3.9/socket.py", line 843, in create_connection
raise err
File "/usr/local/lib/python3.9/socket.py", line 831, in create_connection
sock.connect(sa)
OSError: [Errno 113] Host is unreachable```

Request: Configurable HTTP time out and throttle / stop connection attempts until ping succeeds

The recent update seems to fix the offline state issue by using ping but I would like to suggest further stability improvements:

  1. The AD110 is VERY slow to respond to requests when booting or when it is constantly providing RTSP streams to an NVR, it looks like there is a hard coded 6.05s time out. I would suggest making this configurable to allow the user to adjust for their device.
    Trying again due to error: ReadTimeout(ReadTimeoutError("HTTPConnectionPool(host='192.168.103.8', port=80): Read timed out. (read timeout=6.05)"))
  2. While Ping seems to be used to figure out if the device is off the network, it doesn't stop repeated HTTP requests while the device is booting. I tested this with and without this docker running and the hammering while the device is booting seems to really slow it down. I would suggest that it should not attempt to sign in if ping hasn't succeeded at least 3-4 times.
    As an alternative the http connection also return if the Host is unreachable, this message could be used to back off connection attempts as it means that the device did not respond at all / is not online.
    Trying again due to error: ConnectionError(MaxRetryError("HTTPConnectionPool(host='192.168.103.8', port=80): Max retries exceeded with url: /cgi-bin/magicBox.cgi?action=getMachineName (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at ADDRESS>: Failed to establish a new connection: [Errno 113] **Host is unreachable**'))"))

In my environment I have noted that there are at least 3 failed HTTP connections after a restart of this docker, I think backing off / increasing the time out or letting the user control it would help this work better.

AD410 motion event code

Hello,

I just got this hooked up today with my new AD410. Everything other than the "motion" event is working great!

I noticed that line 255 of amcrest2mqtt.py is looking for the event "ProfileAlarmTransmit".

However, I'm not seeing that in my logs anywhere.

When there is a motion event, it looks like the AD410 is using "VideoMotion" instead. I also see "AlarmLocal"... both issue a "start" and "stop" event.

08/05/2021 19:03:36 [INFO] Fetching storage sensors...


08/05/2021 19:04:28 [INFO] {'Code': 'TimeChange', 'action': 'Pulse', 'index': '0', 'data': {'BeforeModifyTime': '2021-05-08 14:04:28', 'ModifiedTime': '2021-05-08 14:04:28'}}


08/05/2021 19:04:28 [INFO] {'Code': 'NTPAdjustTime', 'action': 'Pulse', 'index': '0', 'data': {'Address': '200.160.0.8', 'Before': '2021-05-08 14:04:27', 'result': 'true'}}


08/05/2021 19:04:36 [INFO] Fetching storage sensors...


08/05/2021 19:05:23 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:05:23 [INFO] {'Code': 'VideoMotion', 'action': 'Start', 'index': '0', 'data': {'Id': '[', 'RegionName': '['}}


08/05/2021 19:05:24 [INFO] {'Code': 'StorageChange', 'action': 'Pulse', 'index': '0', 'data': {'Group': 'ReadWrite', 'Path': '\\/mnt\\/sd'}}


08/05/2021 19:05:24 [INFO] {'Code': 'StorageChange', 'action': 'Pulse', 'index': '0', 'data': {'Group': 'ReadWrite', 'Path': '\\/mnt\\/sd'}}


08/05/2021 19:05:24 [INFO] {'Code': 'StorageChange', 'action': 'Pulse', 'index': '0', 'data': {'Group': 'ReadWrite', 'Path': '\\/mnt\\/sd'}}


08/05/2021 19:05:26 [INFO] {'Code': 'StorageChange', 'action': 'Pulse', 'index': '0', 'data': {'Group': 'ReadWrite', 'Path': '\\/mnt\\/sd'}}


08/05/2021 19:05:26 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:05:27 [INFO] {'Code': 'NewFile', 'action': 'Pulse', 'index': '0', 'data': {'File': '\\/mnt\\/sd\\/2021-05-08\\/001\\/jpg\\/14\\/05\\/27[M][0@0][0].jpg', 'Size': '47488,', 'StoragePoint': 'NULL'}}


08/05/2021 19:05:28 [INFO] {'Code': 'NewFile', 'action': 'Pulse', 'index': '0', 'data': {'File': '\\/mnt\\/sd\\/2021-05-08\\/001\\/jpg\\/14\\/05\\/28[M][0@0][0].jpg', 'Size': '47273,', 'StoragePoint': 'NULL'}}


08/05/2021 19:05:28 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:05:29 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:05:29 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:05:29 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:05:29 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:05:30 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:05:36 [INFO] {'Code': 'NewFile', 'action': 'Pulse', 'index': '0', 'data': {'File': '\\/mnt\\/sd\\/2021-05-05\\/001\\/dav\\/19\\/19.21.00-19.21.00[R][0@0][0].mp4_', 'Size': '117159593,', 'StoragePoint': 'NULL'}}


08/05/2021 19:05:36 [INFO] Fetching storage sensors...


08/05/2021 19:05:40 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:05:45 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:05:46 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:05:46 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:05:48 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:05:48 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:05:48 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:05:49 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:01 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:01 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:03 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:05 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:05 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:06 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:08 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:09 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:11 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:11 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:18 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:18 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:20 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:21 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:21 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:23 [INFO] {'Code': '_CallRemoveMask', 'action': 'Start'}


08/05/2021 19:06:23 [INFO] {'Code': 'AlarmLocal', 'action': 'Start'}


08/05/2021 19:06:23 [INFO] {'Code': '_DoTalkAction_', 'action': 'Pulse', 'index': '0', 'data': {'Action': 'Invite', 'CallID': '20210508140623@[email protected]', 'CallSrcMask': '4'}}


08/05/2021 19:06:23 [INFO] {'Code': 'CallNoAnswered', 'action': 'Start', 'index': '0', 'data': {'CallID': '2'}}


08/05/2021 19:06:23 [INFO] {'Code': 'PhoneCallDetect', 'action': 'Start'}


08/05/2021 19:06:23 [INFO] {'Code': 'StorageChange', 'action': 'Pulse', 'index': '0', 'data': {'Group': 'ReadWrite', 'Path': '\\/mnt\\/sd'}}


08/05/2021 19:06:23 [INFO] {'Code': 'StorageChange', 'action': 'Pulse', 'index': '0', 'data': {'Group': 'ReadWrite', 'Path': '\\/mnt\\/sd'}}


08/05/2021 19:06:23 [INFO] {'Code': 'StorageChange', 'action': 'Pulse', 'index': '0', 'data': {'Group': 'ReadWrite', 'Path': '\\/mnt\\/sd'}}


08/05/2021 19:06:24 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:25 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:25 [INFO] {'Code': 'StorageChange', 'action': 'Pulse', 'index': '0', 'data': {'Group': 'ReadWrite', 'Path': '\\/mnt\\/sd'}}


08/05/2021 19:06:25 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:26 [INFO] {'Code': 'NewFile', 'action': 'Pulse', 'index': '0', 'data': {'File': '\\/mnt\\/sd\\/2021-05-08\\/001\\/jpg\\/14\\/06\\/26[M][0@0][0].jpg', 'Size': '46808,', 'StoragePoint': 'NULL'}}


08/05/2021 19:06:27 [INFO] {'Code': 'NewFile', 'action': 'Pulse', 'index': '0', 'data': {'File': '\\/mnt\\/sd\\/2021-05-08\\/001\\/jpg\\/14\\/06\\/27[M][0@0][0].jpg', 'Size': '46769,', 'StoragePoint': 'NULL'}}


08/05/2021 19:06:27 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:27 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:28 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:28 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:33 [INFO] {'Code': '_DoTalkAction_', 'action': 'Pulse', 'index': '0', 'data': {'Action': 'Hangup', 'CallID': '20210508140623@[email protected]', 'CallSrcMask': '4,', 'HangupReason': 'HangupByPhone'}}


08/05/2021 19:06:33 [INFO] {'Code': 'AlarmLocal', 'action': 'Stop'}


08/05/2021 19:06:33 [INFO] {'Code': 'CallNoAnswered', 'action': 'Stop'}


08/05/2021 19:06:34 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:35 [INFO] {'Code': 'NewFile', 'action': 'Pulse', 'index': '0', 'data': {'File': '\\/mnt\\/sd\\/2021-05-05\\/001\\/dav\\/19\\/19.21.00-19.21.00[R][0@0][0].mp4_', 'Size': '117159593,', 'StoragePoint': 'NULL'}}


08/05/2021 19:06:36 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:36 [INFO] Fetching storage sensors...


08/05/2021 19:06:39 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:39 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:46 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:46 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:46 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:47 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:48 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:48 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:49 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:06:52 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:07:21 [INFO] {'Code': 'VideoMotion', 'action': 'Stop', 'index': '0', 'data': {'Id': '[', 'RegionName': '['}}


08/05/2021 19:07:36 [INFO] Fetching storage sensors...


08/05/2021 19:07:37 [INFO] {'Code': 'PhoneCallDetect', 'action': 'Stop'}


08/05/2021 19:07:37 [INFO] {'Code': '_CallRemoveMask', 'action': 'Stop'}


08/05/2021 19:08:36 [INFO] Fetching storage sensors...


08/05/2021 19:09:28 [INFO] {'Code': 'TimeChange', 'action': 'Pulse', 'index': '0', 'data': {'BeforeModifyTime': '2021-05-08 14:09:28', 'ModifiedTime': '2021-05-08 14:09:28'}}


08/05/2021 19:09:28 [INFO] {'Code': 'NTPAdjustTime', 'action': 'Pulse', 'index': '0', 'data': {'Address': '200.160.0.8', 'Before': '2021-05-08 14:09:27', 'result': 'true'}}


08/05/2021 19:09:36 [INFO] Fetching storage sensors...


08/05/2021 19:10:36 [INFO] Fetching storage sensors...


08/05/2021 19:11:00 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:11:00 [INFO] {'Code': 'VideoMotion', 'action': 'Start', 'index': '0', 'data': {'Id': '[', 'RegionName': '['}}


08/05/2021 19:11:00 [INFO] {'Code': 'StorageChange', 'action': 'Pulse', 'index': '0', 'data': {'Group': 'ReadWrite', 'Path': '\\/mnt\\/sd'}}


08/05/2021 19:11:00 [INFO] {'Code': 'StorageChange', 'action': 'Pulse', 'index': '0', 'data': {'Group': 'ReadWrite', 'Path': '\\/mnt\\/sd'}}


08/05/2021 19:11:00 [INFO] {'Code': 'StorageChange', 'action': 'Pulse', 'index': '0', 'data': {'Group': 'ReadWrite', 'Path': '\\/mnt\\/sd'}}


08/05/2021 19:11:03 [INFO] {'Code': 'StorageChange', 'action': 'Pulse', 'index': '0', 'data': {'Group': 'ReadWrite', 'Path': '\\/mnt\\/sd'}}


08/05/2021 19:11:04 [INFO] {'Code': 'NewFile', 'action': 'Pulse', 'index': '0', 'data': {'File': '\\/mnt\\/sd\\/2021-05-08\\/001\\/jpg\\/14\\/11\\/04[M][0@0][0].jpg', 'Size': '48281,', 'StoragePoint': 'NULL'}}


08/05/2021 19:11:05 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}


08/05/2021 19:11:17 [INFO] {'Code': 'NewFile', 'action': 'Pulse', 'index': '0', 'data': {'File': '\\/mnt\\/sd\\/2021-05-05\\/001\\/dav\\/19\\/19.21.00-19.21.00[R][0@0][0].mp4_', 'Size': '117159593,', 'StoragePoint': 'NULL'}}


08/05/2021 19:11:35 [INFO] {'Code': 'VideoMotion', 'action': 'Stop', 'index': '0', 'data': {'Id': '[', 'RegionName': '['}}


08/05/2021 19:11:36 [INFO] Fetching storage sensors...


08/05/2021 19:12:36 [INFO] Fetching storage sensors...

Polling Events?

Thank you for your work. I would love to use Amcrest2MQTT to automate turning on an outside light when someone presses the AD401 doorbell button after dark. However it looks like you are polling data with a default of 1 hour interval. Is this true even for events such as the doorbell button being pressed? If so, is it practical for Amcrest2MQTT to send a MQTT event when event occurs? Is shorting this interval to a few seconds practical? Thank you again.

events not available anymore

After updating the docker container to the latest version, the camera itself is recognized but none of the motion events are available over mqtt anymore.

image

404 for getDeviceAllInfo on container launch

I've got the AD110, and when I launch the container, I get a 404 error trying to access cgi-bin/storageDevice.cgi?action=getDeviceAllInfo which I can confirm returns the same through a browser window. My device is presumably running the latest firmware, and I can run other commands against the API, just not this. Any ideas?

Motion events not registering in mqtt

I have an AD110 (working perfectly) and some other cameras. I can see in the docker logs that motion is detected, for example.

amcrest2mqtt-patio       | 2021-05-15T00:41:57.435637534Z 15/05/2021 00:41:57 [INFO] Fetching camera details...
amcrest2mqtt-patio       | 2021-05-15T00:41:57.700560756Z 15/05/2021 00:41:57 [INFO] Device type: IP8M-T2599E
amcrest2mqtt-patio       | 2021-05-15T00:41:57.700589185Z 15/05/2021 00:41:57 [INFO] Serial number: AMC0636AF1B5805A55
amcrest2mqtt-patio       | 2021-05-15T00:41:57.700597661Z 15/05/2021 00:41:57 [INFO] Software version: 2.800.00AC000.0.R
amcrest2mqtt-patio       | 2021-05-15T00:41:57.700602234Z 15/05/2021 00:41:57 [INFO] Device name: cam-bdoor
amcrest2mqtt-patio       | 2021-05-15T00:41:57.701789070Z 15/05/2021 00:41:57 [INFO] Writing Home Assistant discovery config...
amcrest2mqtt-patio       | 2021-05-15T00:41:57.702758883Z 15/05/2021 00:41:57 [INFO] Fetching storage sensors...
<clipped>
amcrest2mqtt-patio       | 2021-05-15T00:44:53.414712795Z 15/05/2021 00:44:53 [INFO] {'Code': 'VideoMotionInfo', 'action': 'State'}
amcrest2mqtt-patio       | 2021-05-15T00:44:53.551512079Z 15/05/2021 00:44:53 [INFO] {'Code': 'VideoMotion', 'action': 'Start', 'index': '0', 'data': {'Id': '[', 'RegionName': '['}}
amcrest2mqtt-patio       | 2021-05-15T00:44:53.992132885Z 15/05/2021 00:44:53 [INFO] {'Code': 'NewFile', 'action': 'Pulse', 'index': '0', 'data': {'Data': '{', 'Id': '[', 'RegionName': '[', 'Event': 'VideoMotion', 'File': '\\/var\\/tmp\\/jpg\\/0\\/20210514204453922ch01.jpg', 'Index': '0,', 'Size': '558585,', 'StoragePoint': 'Temporary'}}
amcrest2mqtt-patio       | 2021-05-15T00:44:54.134519062Z 15/05/2021 00:44:54 [INFO] {'Code': 'NewFile', 'action': 'Pulse', 'index': '0', 'data': {'File': '\\/tmp\\/NFS1\\/cam-bdoor\\/2021-05-14\\/001\\/jpg\\/20\\/44\\/53[M][0@0][0].jpg', 'Size': '558545,', 'StoragePoint': 'NULL'}}
amcrest2mqtt-patio       | 2021-05-15T00:44:54.986224999Z 15/05/2021 00:44:54 [INFO] {'Code': 'NewFile', 'action': 'Pulse', 'index': '0', 'data': {'Data': '{', 'Id': '[', 'RegionName': '[', 'Event': 'VideoMotion', 'File': '\\/var\\/tmp\\/jpg\\/0\\/20210514204454921ch01.jpg', 'Index': '0,', 'Size': '548193,', 'StoragePoint': 'Temporary'}}
amcrest2mqtt-patio       | 2021-05-15T00:44:55.108112320Z 15/05/2021 00:44:55 [INFO] {'Code': 'NewFile', 'action': 'Pulse', 'index': '0', 'data': {'File': '\\/tmp\\/NFS1\\/cam-bdoor\\/2021-05-14\\/001\\/jpg\\/20\\/44\\/54[M][0@0][0].jpg', 'Size': '548153,', 'StoragePoint': 'NULL'}}
amcrest2mqtt-patio       | 2021-05-15T00:44:55.990669974Z 15/05/2021 00:44:55 [INFO] {'Code': 'NewFile', 'action': 'Pulse', 'index': '0', 'data': {'Data': '{', 'Id': '[', 'RegionName': '[', 'Event': 'VideoMotion', 'File': '\\/var\\/tmp\\/jpg\\/0\\/20210514204455921ch01.jpg', 'Index': '0,', 'Size': '560899,', 'StoragePoint': 'Temporary'}}
amcrest2mqtt-patio       | 2021-05-15T00:44:56.109361724Z 15/05/2021 00:44:56 [INFO] {'Code': 'NewFile', 'action': 'Pulse', 'index': '0', 'data': {'File': '\\/tmp\\/NFS1\\/cam-bdoor\\/2021-05-14\\/001\\/jpg\\/20\\/44\\/55[M][0@0][0].jpg', 'Size': '560859,', 'StoragePoint': 'NULL'}}

however, when i watch the messages that are published to mqtt, for the ad110, in the amcrest2mqtt topic, i see

status = online
storage
event = {"Code": "NTPAdjustTime", "action": "Pulse", "index": "0", "data": {"Address": "ntp.domain.com", "Before": "2021-05-14 07:53:46", "result": "true"}}
motion = off
doorbell = off

When motion is detected on the AD110, this motion topic changes from 0 to 1 accordingly, but with other cameras, I do not see this motion tag. If i look at the actual binary_sensor topics for _motion, there's actually no changing data here, for the ad110 or other cameras. Without the motion topic other cameras seem to not work, even though the container itself reports the motion.

I'm happy to provide additional information and/or logs as needed if that would be helpful.

here is an example of what i see from the ad110 (though i imagine you're familiar with this since you mention testing with an ad110

amcrest2mqtt-doorbell    | 2021-05-15T00:48:47.910596434Z 15/05/2021 00:48:47 [INFO] {'Code': 'VideoMotion', 'action': 'Start'}
amcrest2mqtt-doorbell    | 2021-05-15T00:48:48.343862751Z 15/05/2021 00:48:48 [INFO] {'Code': 'TimeChange', 'action': 'Pulse', 'index': '0', 'data': {'BeforeModifyTime': '2021-05-14 07:48:48', 'ModifiedTime': '2021-05-14 07:48:47'}}
amcrest2mqtt-doorbell    | 2021-05-15T00:48:48.606789318Z 15/05/2021 00:48:48 [INFO] {'Code': 'NTPAdjustTime', 'action': 'Pulse', 'index': '0', 'data': {'Address': '192.168.128.10', 'Before': '2021-05-14 07:48:46', 'result': 'true'}}
amcrest2mqtt-doorbell    | 2021-05-15T00:48:57.933003984Z 15/05/2021 00:48:57 [INFO] {'Code': 'VideoMotion', 'action': 'Stop'}
amcrest2mqtt-doorbell    | 2021-05-15T00:49:29.637682138Z 15/05/2021 00:49:29 [INFO] Fetching storage sensors...
amcrest2mqtt-doorbell    | 2021-05-15T00:50:29.637986985Z 15/05/2021 00:50:29 [INFO] Fetching storage sensors...
amcrest2mqtt-doorbell    | 2021-05-15T00:51:06.704531251Z 15/05/2021 00:51:06 [INFO] {'Code': 'VideoMotion', 'action': 'Start'}
amcrest2mqtt-doorbell    | 2021-05-15T00:51:07.025653615Z 15/05/2021 00:51:07 [INFO] {'Code': 'AlarmLocal', 'action': 'Start'}
amcrest2mqtt-doorbell    | 2021-05-15T00:51:08.263024721Z 15/05/2021 00:51:08 [INFO] {'Code': 'AlarmLocal', 'action': 'Start'}
amcrest2mqtt-doorbell    | 2021-05-15T00:51:10.220181852Z 15/05/2021 00:51:10 [INFO] {'Code': 'ProfileAlarmTransmit', 'action': 'Start', 'index': '0', 'data': {'SenseMethod': 'PassiveInfrared', 'UTC': '1621021870'}}
amcrest2mqtt-doorbell    | 2021-05-15T00:51:10.560296891Z 15/05/2021 00:51:10 [INFO] {'Code': 'UpdateFile', 'action': 'Pulse'}
amcrest2mqtt-doorbell    | 2021-05-15T00:51:10.591809227Z 15/05/2021 00:51:10 [INFO] {'Code': 'NewFile', 'action': 'Pulse', 'index': '36425423', 'data': {'File': '\\/mnt\\/sd\\/SnapShot\\/2021-05-14\\/19\\/19-51-10[0].jpg', 'Size': '115122'}}
amcrest2mqtt-doorbell    | 2021-05-15T00:51:27.954298687Z 15/05/2021 00:51:27 [INFO] {'Code': 'ProfileAlarmTransmit', 'action': 'Stop', 'index': '0', 'data': {'SenseMethod': 'PassiveInfrared', 'UTC': '1621021886'}}

Is amcrest MQTT broken?

This has been working fine for me until this week. Im no longer getting any topic updates at amcrest2mqtt/serialno/doorbell and amcrest2mqtt/serialno/human etc... the event updates are working and I can see motion / doorbell presses but the sensor topics aren't updating at all.

Really confused by this. Have amcrest changed something with a firmware update?

Not working anymore?

This seems to not be working anymore. I had two instances set up and working fine. Now, nothing seems to connect.

I get the following error over and over...

amcrest2mqtt2 | <Unconnected @ 192.168.4.113> Trying again due to error: ConnectTimeout(MaxRetryError("HTTPConnectionPool(host='192.168.4.113', port=80): Max retries exceeded with url: /cgi-bin/magicBox.cgi?action=getMachineName (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at ADDRESS>, 'Connection to 192.168.4.113 timed out. (connect timeout=6.05)'))"))

Amcrest doorbell AD110 button status always on

Forgive me if I am misunderstanding, but my new Amcrest doorbell AD110 is always showing the binary_sensor.doorbell as on. I was hoping that this device would toggle from off to on when the button is pressed but that's not what I'm experiencing. Here's what I see when the button is pressed (and also a bit of motion from my hand):

Message 4 received on amcrest2mqtt/XXXXXXXXXXXXXXXXXXXX/doorbell at 7:10 PM:
on
QoS: 0 - Retain: false

Message 5 received on amcrest2mqtt/XXXXXXXXXXXXXXXXXXXX/event at 7:10 PM:
{
    "Code": "_DoTalkAction_",
    "action": "Pulse",
    "index": "0",
    "data": {
        "Action": "Invite",
        "CallID": "XXXXXXXXXXXXXXXXXXXX@[email protected]",
        "CallSrcMask": 4
    }
}
QoS: 0 - Retain: false

Message 6 received on amcrest2mqtt/XXXXXXXXXXXXXXXXXXXX/event at 7:11 PM:
{
    "Code": "CallNoAnswered",
    "action": "Start",
    "index": "0",
    "data": {
        "CallID": "1"
    }
}
QoS: 0 - Retain: false

Any help fixing/understanding this better is greatly appreciated. Thanks!

Request: Need an online / offline state sensor

If amcrest2mqtt loses contact with the doobell due to failed requests there is currently no way in HomeAssistant to know this as the MQTT sensor states just stay at their last value.

Adding an offline / online sensor for when amcrest2mqtt is listening for events would be helpful.

400 Client Error: Bad Request

I deployed in Portainer and that's what I get from the logs:

29/05/2021 23:53:11 [INFO] Fetching storage sensors...

<Name:SERIAL> Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://AmcrestIP:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

<Name:SERIAL> Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://AmcrestIP:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

<Name:SERIAL> Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://AmcrestIP6:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

29/05/2021 23:53:12 [WARNING] Error fetching storage information 400 Client Error: Bad Request for url: http://AmcrestIP:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo

I don't know how to fix this. If I type "http://AmcrestIP:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo" on an Internet browser, it asks me for username and password (admin:MYPASSWORD). Then, it shows:

Error
Bad Request!

Container shutting down on connection loss.

It seems every time a ping reply is missed to the doorbell (AD410) the container shuts down. This also happens when my MQTT container is restarted. Is there a way for the app to just retry the connections (ping, MQTT login) instead of shutting down?

08/10/2021 15:14:15 [ERROR] Ping unsuccessful
08/10/2021 15:14:15 [INFO] Exiting app...

07/10/2021 15:52:48 [ERROR] Unexpected MQTT disconnection
07/10/2021 15:52:48 [INFO] Exiting app...

AD110 not pulling full Firmware version

I have noticed the AD110 is not pulling the full firmware version:
It only shows:
1.000.00AC006.0.R

but it should show
1.000.00AC006.0.R.200922

with that last bit being the build/release date = 09/22/2020

BUG: gets stuck in a HTTPErrror loop if the camera is unavailable for a short time due to settings updates or reboot

If I touch my camera via Surveillance station, the mobile app or reboot the camera, amcrest2mqtt will get stuck in an error loop that it does not recover from until the docker is completely restarted.

`
04/08/2021 11:33:08 [INFO] Fetching storage sensors...

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

04/08/2021 11:33:10 [WARNING] Error fetching storage information 400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo

04/08/2021 12:33:08 [INFO] Fetching storage sensors...

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

04/08/2021 12:33:10 [WARNING] Error fetching storage information 400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo

04/08/2021 13:33:08 [INFO] Fetching storage sensors...

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

04/08/2021 13:33:10 [WARNING] Error fetching storage information 400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo

04/08/2021 14:33:08 [INFO] Fetching storage sensors...

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

04/08/2021 14:33:10 [WARNING] Error fetching storage information 400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo

04/08/2021 15:33:08 [INFO] Fetching storage sensors...

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

04/08/2021 15:33:10 [WARNING] Error fetching storage information 400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo

04/08/2021 16:33:08 [INFO] Fetching storage sensors...

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

04/08/2021 16:33:10 [WARNING] Error fetching storage information 400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo

04/08/2021 17:33:08 [INFO] Fetching storage sensors...

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

04/08/2021 17:33:10 [WARNING] Error fetching storage information 400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo

04/08/2021 18:33:08 [INFO] Fetching storage sensors...

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

04/08/2021 18:33:10 [WARNING] Error fetching storage information 400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo

04/08/2021 19:33:08 [INFO] Fetching storage sensors...

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

04/08/2021 19:33:10 [WARNING] Error fetching storage information 400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo

04/08/2021 20:33:08 [INFO] Fetching storage sensors...

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

04/08/2021 20:33:10 [WARNING] Error fetching storage information 400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo

04/08/2021 21:33:08 [INFO] Fetching storage sensors...

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

04/08/2021 21:33:10 [WARNING] Error fetching storage information 400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo

04/08/2021 22:33:08 [INFO] Fetching storage sensors...

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

04/08/2021 22:33:10 [WARNING] Error fetching storage information 400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo

04/08/2021 23:33:08 [INFO] Fetching storage sensors...

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

04/08/2021 23:33:10 [WARNING] Error fetching storage information 400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo

05/08/2021 00:33:08 [INFO] Fetching storage sensors...

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

05/08/2021 00:33:10 [WARNING] Error fetching storage information 400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo

05/08/2021 01:33:08 [INFO] Fetching storage sensors...

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

05/08/2021 01:33:10 [WARNING] Error fetching storage information 400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo

05/08/2021 02:33:08 [INFO] Fetching storage sensors...

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

05/08/2021 02:33:10 [WARNING] Error fetching storage information 400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo

05/08/2021 03:33:08 [INFO] Fetching storage sensors...

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

05/08/2021 03:33:10 [WARNING] Error fetching storage information 400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo

05/08/2021 04:33:08 [INFO] Fetching storage sensors...

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

05/08/2021 04:33:10 [WARNING] Error fetching storage information 400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo

05/08/2021 05:33:08 [INFO] Fetching storage sensors...

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

05/08/2021 05:33:10 [WARNING] Error fetching storage information 400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo

05/08/2021 06:33:08 [INFO] Fetching storage sensors...

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

05/08/2021 06:33:10 [WARNING] Error fetching storage information 400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo`

After a quick reboot, no issue re-connecting

`
05/08/2021 06:49:12 [INFO] App Version: 1.0.8

05/08/2021 06:49:12 [INFO] Fetching camera details...

05/08/2021 06:49:16 [INFO] Device type: AD110

05/08/2021 06:49:16 [INFO] Serial number: XXXXXXXXXXXXX

05/08/2021 06:49:16 [INFO] Software version: build:2020-09-22

05/08/2021 06:49:16 [INFO] Device name: Front Door

05/08/2021 06:49:16 [INFO] Writing Home Assistant discovery config...

05/08/2021 06:49:16 [INFO] Fetching storage sensors...

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo')

05/08/2021 06:49:17 [WARNING] Error fetching storage information 400 Client Error: Bad Request for url: http://192.168.103.8:80/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo

05/08/2021 06:49:17 [INFO] Listening for events...

05/08/2021 06:49:19 [INFO] {'Code': 'TimeChange', 'action': 'Pulse', 'index': '0', 'data': {'BeforeModifyTime': '2021-08-04 10:49:19', 'ModifiedTime': '2021-08-04 10:49:18'}}

05/08/2021 06:49:19 [INFO] {'Code': 'NTPAdjustTime', 'action': 'Pulse', 'index': '0', 'data': {'Address': '192.168.102.11', 'Before': '2021-08-04 10:49:17', 'result': 'true'}}

05/08/2021 06:50:43 [INFO] {'Code': 'VideoMotion', 'action': 'Start'}

05/08/2021 06:50:53 [INFO] {'Code': 'VideoMotion', 'action': 'Stop'}`

Suggested fix.. Back off after X failed tries pause and rest the connection

Suggested fix2 auto reboot the docker if X failed attempts in a row.

Due to this issue I have missed doorbell events several times as the mqtt state does not change when this is happening, it just shows available in homeassistant.. I have to manually check up on this docker from time to time and restart it.

Received message on illegal discovery topic 'homeassistant/sensor/amcrest2mqtt on HA startup

2021-08-16 04:59:41 WARNING (MainThread) [homeassistant.components.mqtt.discovery] Received message on illegal discovery topic 'homeassistant/sensor/amcrest2mqtt-{"error":{"code":287637505,"message":"Invalid session in request data!"},"result":false}/front_door_storage_used_percent/config' 2021-08-16 04:59:41 WARNING (MainThread) [homeassistant.components.mqtt.discovery] Received message on illegal discovery topic 'homeassistant/sensor/amcrest2mqtt-{"error":{"code":287637505,"message":"Invalid session in request data!"},"result":false}/front_door_storage_used/config' 2021-08-16 04:59:41 WARNING (MainThread) [homeassistant.components.mqtt.discovery] Received message on illegal discovery topic 'homeassistant/sensor/amcrest2mqtt-{"error":{"code":287637505,"message":"Invalid session in request data!"},"result":false}/front_door_storage_total/config' 2021-08-16 04:59:41 WARNING (MainThread) [homeassistant.components.mqtt.discovery] Received message on illegal discovery topic 'homeassistant/binary_sensor/amcrest2mqtt-{"error":{"code":287637505,"message":"Invalid session in request data!"},"result":false}/front_door_doorbell/config' 2021-08-16 04:59:41 WARNING (MainThread) [homeassistant.components.mqtt.discovery] Received message on illegal discovery topic 'homeassistant/binary_sensor/amcrest2mqtt-{"error":{"code":287637505,"message":"Invalid session in request data!"},"result":false}/front_door_motion/config'

I have noticed I am getting these in home assistant recently.

I should note that I don't use or care about the storage sensor however.

Request: TimeStamp update

Today I found that the container was not updating anymore, is there an solution we get an timestamp so we can generate an event in HA so we can check what is wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.