Amcrest IP2M-841B doesn't work in HA

Hi,

I have problems to integrate an Amcrest IP2M-841B-EGD-DE in HA. Of course I’ve searched the forum for a solution but without success. The topic “Can not get Amcrest IP2M-841B to work” seems similar but I get another error message.

The error message is

Fri Jan 03 2020 21:59:27 GMT+0100 (CET)

required key not provided @ data['media_player']
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 133, in handle_call_service
    connection.context(msg),
  File "/usr/src/homeassistant/homeassistant/core.py", line 1213, in async_call
    processed_data = handler.schema(service_data)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict
    return base_validate(path, iteritems(data), out)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 432, in validate_mapping
    raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: required key not provided @ data['media_player']

configuration.yaml:

ffmpeg:

stream:

amcrest:
  - host: 192.168.1.140
    username: !secret amcrest_user
    password: !secret amcrest_pass
    resolution: high
    stream_source: rtsp
    binary_sensors:
    - motion_detected

camera:
  - platform: amcrest

In the developer section of HA I see:

access_token: 21fda6c45e613dba6ad9b4cb5e09305d75a72976e3e82386ce5e8c2de2862d6f
model_name: IP2M-841B-EGD-DE
brand: Amcrest
audio: 'on'
motion_recording: 'on'
color_bw: auto
friendly_name: Amcrest Camera
entity_picture: >-
  /api/camera_proxy/camera.amcrest_camera?token=21fda6c45e613dba6ad9b4cb5e09305d75a72976e3e82386ce5e8c2de2862d6f
supported_features: 3

VLC works with:

rtsp://user123:[email protected]:554/cam/realmonitor?channel=1&subtype=0

After hours I would like to throw the Amcrest out of the window :slight_smile:
Most likely its my fault but what I’m doing wrong?

Regards
Michael

Well its there.
Those errors aren’t related to the amcrest
There related to the stream component.
So you need to fix that
The docs do say to use low instead of high for newer firmware.
Did you add the sensors?
If you can get rtsp on vlc then setup an additional generic up camera.
But you will need to fix the stream issue
Make sure you’ve read the ffmpeg docs about system requirements as the can be related

What makes you think the camera isn’t working?
That error message has nothing to do with your camera it’s referencing some kinda of media_player entry.

Yes, I agree that the error doesn’t seem to be directly related to your Amcrest camera or its configuration.

The error seems to be indicating that you tried to call a service (probably via the UI) that requires a media_player parameter. Do you know exactly what you tried to do at Fri Jan 03 2020 21:59:27 GMT+0100 (CET) that might have resulted in that error?

EDIT:

BTW, you do not need the following in your config (it will be ignored anyway):

camera:
  - platform: amcrest

To be honest - I should read more of the documentation…

Thx for the help. I’ve corrected the relevant sections in configuration.yaml and the integration of the Amcrest works. Not sure everything is necessary but I use the following:

# ffmpeg integration, see https://www.home-assistant.io/integrations/ffmpeg/
ffmpeg:

# Stream integration, see https://www.home-assistant.io/integrations/stream
stream:

# Amcrest integration, see https://www.home-assistant.io/integrations/amcrest/
amcrest:
  - host: 192.168.1.140
    username: !secret amcrest_user
    password: !secret amcrest_pass
    resolution: high
    stream_source: rtsp
    binary_sensors:
    - motion_detected

The Entity Button looks like this:

entity: camera.amcrest_camera
hold_action:
  action: more-info
show_icon: true
show_name: true
tap_action:
  action: more-info
type: entity-button

Clicking on it shows of course the video stream from the Amcrest.
Now I’m searching how to get the video stream directly on the GUI. Should be just a matter of reading the documentation :slight_smile:

Regards
Michael

This is what I use to show the live stream of the camera directly on the UI:

- type: conditional
  conditions:
    - entity: camera.NAME
      state_not: idle
  card:
    type: picture-entity
    entity: camera.NAME
    show_name: false
    camera_view: live

Thx for the invaluable help. I’m sure this topic was not the last one from me :slight_smile:
I switched Lovelace to YAML mode and used your code snippet - it simply works.


Regards
Michael