Amcrest IP Camera


The amcrest camera platform allows you to integrate your Amcrest IP camera in Home Assistant.

There is currently support for the following device types within Home Assistant:

  • Binary Sensor
  • Camera
  • Sensor
  • Switch (deprecated)

Configuration

To enable your camera in your installation, add the following to your configuration.yaml file:

# Example configuration.yaml entry
amcrest:
  - host: IP_ADDRESS_CAMERA
    username: YOUR_USERNAME
    password: YOUR_PASSWORD

Configuration Variables

host

(string)(Required)The IP address or hostname of your camera. If using a hostname, make sure the DNS works as expected.

username

(string)(Required)The username for accessing your camera.

password

(string)(Required)The password for accessing your camera.

name

(string)(Optional)This parameter allows you to override the name of your camera. In the case of multi-camera setups, this is highly recommended as camera id number will be randomly changed at each reboot if a name is not allocated.

Default value: Amcrest Camera

port

(integer)(Optional)The port that the camera is running on.

Default value: 80

resolution

(string)(Optional)This parameter allows you to specify the camera resolution. For a high resolution (1080/720p), specify the option `high`. For VGA resolution (640x480p), specify the option `low`.

Default value: high

stream_source

(string)(Optional)The data source for the live stream. `mjpeg` will use the camera's native MJPEG stream, whereas `snapshot` will use the camera's snapshot API to create a stream from still images. You can also set the `rtsp` option to generate the streaming via RTSP protocol.

Default value: snapshot

ffmpeg_arguments

(string)(Optional)Extra options to pass to ffmpeg, e.g., image quality or video filter options.

Default value: -pred 1

authentication

(string)(Optional)Defines which authentication method to use only when **stream_source** is **mjpeg**. Currently, *aiohttp* only support *basic*.

Default value: basic

scan_interval

(integer)(Optional)Defines the update interval of the sensor in seconds.

Default value: 10

binary_sensors

(list)(Optional)Conditions to display in the frontend. The following conditions can be monitored:

Default value: None

motion_detected

Return `on` when a motion is detected, `off` when not.

online

Return `on` when camera is available (i.e., responding to commands), `off` when not.

sensors

(list)(Optional)Conditions to display in the frontend. The following conditions can be monitored:

Default value: None

motion_detector

Return `true`/`false` when motion is detected. **Note:** The motion_detector sensor is deprecated and will be removed in a future release. Use **binary_sensors** option **motion_detected** instead.

sdcard

Return the SD card usage by reporting the total and used space.

ptz_preset

Return the number of PTZ preset positions configured for the given camera.

switches

(list)(Optional)Switches to display in the frontend. **Note:** Switches are deprecated and will be removed in a future release. Use services and attributes instead. The following switches can be monitored:

Default value: None

motion_detection

Enable/disable motion detection setting.

motion_recording

Enable/disable recording on motion detection setting.

control_light

(boolean)(Optional)Automatically control the camera's indicator light, turning it on if the audio or video streams are enabled, and turning it off if both streams are disabled.

Default value: true

Note: Amcrest cameras with newer firmware no longer have the ability to stream high definition video with MJPEG encoding. You may need to use low resolution stream or the snapshot stream source instead. If the quality seems too poor, lower the Frame Rate (FPS) and max out the Bit Rate settings in your camera’s configuration manager. If you defined the stream_source to mjpeg, make sure your camera supports Basic HTTP authentication. Newer Amcrest firmware may not work, then rtsp is recommended instead.

Note: If you set the stream_source option to rtsp, make sure to follow the steps mentioned at FFMPEG documentation to install the ffmpeg.

Services

Once loaded, the amcrest integration will expose services that can be called to perform various actions. The entity_id service attribute can specify one or more specific cameras, or all can be used to specify all configured Amcrest cameras.

Available services: enable_audio, disable_audio, enable_motion_recording, disable_motion_recording, enable_recording, disable_recording, goto_preset, set_color_bw, start_tour and stop_tour

Service enable_audio/disable_audio

These services enable or disable the camera’s audio stream.

Service data attribute Optional Description
entity_id no Name(s) of entities, e.g., camera.living_room_camera.

Service enable_motion_recording/disable_motion_recording

These services enable or disable the camera to record a clip to its configured storage location when motion is detected.

Service data attribute Optional Description
entity_id no Name(s) of entities, e.g., camera.living_room_camera.

Service enable_recording/disable_recording

These services enable or disable the camera to continuously record to its configured storage location.

Service data attribute Optional Description
entity_id no Name(s) of entities, e.g., camera.living_room_camera.

Service goto_preset

This service will cause the camera to move to one of the PTZ locations configured within the camera.

Service data attribute Optional Description
entity_id no Name(s) of entities, e.g., camera.living_room_camera.
preset no Preset number, starting from 1.

Service set_color_bw

This service will set the color mode of the camera.

Service data attribute Optional Description
entity_id no Name(s) of entities, e.g., camera.living_room_camera.
color_bw no One of auto, bw or color.

Service start_tour/stop_tour

These services start or stop the camera’s PTZ tour function.

Service data attribute Optional Description
entity_id no Name(s) of entities, e.g., camera.living_room_camera.

Advanced Configuration

You can also use this more advanced configuration example:

# Example configuration.yaml entry
amcrest:
  - host: IP_ADDRESS_CAMERA_1
    username: YOUR_USERNAME
    password: YOUR_PASSWORD
    binary_sensors:
      - motion_detected
      - online
    sensors:
      - sdcard

  # Add second camera
  - host: IP_ADDRESS_CAMERA_2
    username: YOUR_USERNAME
    password: YOUR_PASSWORD
    name: Amcrest Camera 2
    resolution: low
    stream_source: snapshot
    sensors:
      - ptz_preset

To check if your Amcrest camera is supported/tested, visit the supportability matrix link from the python-amcrest project.

In previous versions, switch devices in setups with multiple cameras, would not have specific entity ID causing them to change randomly after each Home Assistant restart. The current version adds the name of the camera at the end of the switch entity ID, making it more specific and consistent and causes the name option to be required in a multi-camera system. This behavior matches the sensor behavior of the Amcrest component. Because of this, older automations may require updates to the entity ID.