diff --git a/source/_integrations/amcrest.markdown b/source/_integrations/amcrest.markdown index a12798a46e1..b74cc6a8cfb 100644 --- a/source/_integrations/amcrest.markdown +++ b/source/_integrations/amcrest.markdown @@ -1,6 +1,6 @@ --- title: Amcrest -description: Instructions on how to integrate Amcrest IP cameras within Home Assistant. +description: Instructions on how to integrate Amcrest (or Dahua) IP cameras within Home Assistant. logo: amcrest.png ha_category: - Hub @@ -14,7 +14,7 @@ ha_codeowners: ha_domain: amcrest --- -The `amcrest` camera platform allows you to integrate your [Amcrest](https://amcrest.com/) IP camera in Home Assistant. +The `amcrest` camera platform allows you to integrate your [Amcrest](https://amcrest.com/) or Dahua IP camera in Home Assistant. There is currently support for the following device types within Home Assistant: @@ -153,7 +153,8 @@ Available services: `enable_motion_recording`, `disable_motion_recording`, `enable_recording`, `disable_recording`, `goto_preset`, `set_color_bw`, -`start_tour` and `stop_tour` +`start_tour`, `stop_tour`, and +`ptz_control` #### Service `enable_audio`/`disable_audio` @@ -161,7 +162,7 @@ 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`. +`entity_id` | no | The entity ID of the camera to control. May be a list of multiple entity IDs. To target all cameras, set entity ID to `all`. #### Service `enable_motion_recording`/`disable_motion_recording` @@ -169,7 +170,7 @@ These services enable or disable the camera to record a clip to its configured s Service data attribute | Optional | Description -|-|- -`entity_id` | no | Name(s) of entities, e.g., `camera.living_room_camera`. +`entity_id` | no | The entity ID of the camera to control. May be a list of multiple entity IDs. To target all cameras, set entity ID to `all`. #### Service `enable_recording`/`disable_recording` @@ -177,7 +178,7 @@ These services enable or disable the camera to continuously record to its config Service data attribute | Optional | Description -|-|- -`entity_id` | no | Name(s) of entities, e.g., `camera.living_room_camera`. +`entity_id` | no | The entity ID of the camera to control. May be a list of multiple entity IDs. To target all cameras, set entity ID to `all`. #### Service `goto_preset` @@ -185,7 +186,7 @@ This service will cause the camera to move to one of the PTZ locations configure Service data attribute | Optional | Description -|-|- -`entity_id` | no | Name(s) of entities, e.g., `camera.living_room_camera`. +`entity_id` | no | The entity ID of the camera to control. May be a list of multiple entity IDs. To target all cameras, set entity ID to `all`. `preset` | no | Preset number, starting from 1. #### Service `set_color_bw` @@ -194,7 +195,7 @@ 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`. +`entity_id` | no | The entity ID of the camera to control. May be a list of multiple entity IDs. To target all cameras, set entity ID to `all`. `color_bw` | no | One of `auto`, `bw` or `color`. #### Service `start_tour`/`stop_tour` @@ -203,7 +204,153 @@ 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`. +`entity_id` | no | The entity ID of the camera to control. May be a list of multiple entity IDs. To target all cameras, set entity ID to `all`. + +#### Service `ptz_control` + +If your Amcrest or Dahua camera supports PTZ, you will be able to pan, tilt or zoom your camera. + +Service data attribute | Optional | Description +-|-|- + `entity_id` | no| The entity ID of the camera to control. May be a list of multiple entity IDs. To target all cameras, set entity ID to `all`. + `movement` | no | Direction of the movement. Allowed values: `zoom_in`, `zoom_out`, `up`, `down`, `left`, `right`, `right_up`, `right_down`, `left_up`, `left_down` + `travel_time` | yes |Travel time in fractional seconds. Allowed values: `0` to `1`. Default: `0.2`. + +#### Notes + +- PTZ zoom capability does not control VariFocal lens adjustments. +- There can be several seconds of lag before the video (snapshot or live) reflects the camera movement. + +### Example card with controls + +

+ Screenshot using a picture-elements with PTZ controls. + Example showing an Amcrest IP2M-841 PT camera with controls for Pan and Tilt. +

+ +Using the following picture-elements card code, you can display a live video feed from an Amcrest camera with controls for moving or zooming the camera. + +```yaml +type: picture-elements +entity: camera.lakehouse +camera_image: camera.lakehouse +camera_view: live # or auto for snapshot view +elements: + - type: icon + icon: 'mdi:arrow-up' + style: + background: 'rgba(255, 255, 255, 0.25)' + right: 25px + bottom: 50px + tap_action: + action: call-service + service: amcrest.ptz_control + service_data: + entity_id: camera.lakehouse + movement: up + - type: icon + icon: 'mdi:arrow-down' + style: + background: 'rgba(255, 255, 255, 0.25)' + right: 25px + bottom: 0px + tap_action: + action: call-service + service: amcrest.ptz_control + service_data: + entity_id: camera.lakehouse + movement: down + - type: icon + icon: 'mdi:arrow-left' + style: + background: 'rgba(255, 255, 255, 0.25)' + right: 50px + bottom: 25px + tap_action: + action: call-service + service: amcrest.ptz_control + service_data: + entity_id: camera.lakehouse + movement: left + - type: icon + icon: 'mdi:arrow-right' + style: + background: 'rgba(255, 255, 255, 0.25)' + right: 0px + bottom: 25px + tap_action: + action: call-service + service: amcrest.ptz_control + service_data: + entity_id: camera.lakehouse + movement: right + - type: icon + icon: 'mdi:arrow-top-left' + style: + background: 'rgba(255, 255, 255, 0.25)' + right: 50px + bottom: 50px + tap_action: + action: call-service + service: amcrest.ptz_control + service_data: + entity_id: camera.lakehouse + movement: left_up + - type: icon + icon: 'mdi:arrow-top-right' + style: + background: 'rgba(255, 255, 255, 0.25)' + right: 0px + bottom: 50px + tap_action: + action: call-service + service: amcrest.ptz_control + service_data: + entity_id: camera.lakehouse + movement: right_up + - type: icon + icon: 'mdi:arrow-bottom-left' + style: + background: 'rgba(255, 255, 255, 0.25)' + right: 50px + bottom: 0px + tap_action: + action: call-service + service: amcrest.ptz_control + service_data: + entity_id: camera.lakehouse + movement: left_down + - type: icon + icon: 'mdi:arrow-bottom-right' + style: + background: 'rgba(255, 255, 255, 0.25)' + right: 0px + bottom: 0px + tap_action: + action: call-service + service: amcrest.ptz_control + service_data: + entity_id: camera.lakehouse + movement: right_down + - type: icon + icon: 'mdi:magnify' + style: + background: 'rgba(255, 255, 255, 0.25)' + bottom: 25px + right: 25px + tap_action: + action: call-service + service: amcrest.ptz_control + service_data: + entity_id: camera.lakehouse + movement: zoom_in + hold_action: + action: call-service + service: amcrest.ptz_control + service_data: + entity_id: camera.lakehouse + movement: zoom_out +``` ## Advanced Configuration diff --git a/source/images/integrations/amcrest/amcrest_ptz.jpg b/source/images/integrations/amcrest/amcrest_ptz.jpg new file mode 100644 index 00000000000..3e925340ceb Binary files /dev/null and b/source/images/integrations/amcrest/amcrest_ptz.jpg differ