Update amcrest doc for new "ptz_control" service (#12383)

* Update amcrest doc for new "ptz_control" service

included full description of ptz_control service and its attributes along with a complete picture-elements card example showing functional arrow movement icons. 

Also mentioned this component can be used for Dahua cameras.

* Update source/_integrations/amcrest.markdown

Co-Authored-By: Franck Nijhof <frenck@frenck.nl>

* Update source/_integrations/amcrest.markdown

Co-Authored-By: Franck Nijhof <frenck@frenck.nl>

* Update source/_integrations/amcrest.markdown

Co-Authored-By: Franck Nijhof <frenck@frenck.nl>

* Update source/_integrations/amcrest.markdown

Co-Authored-By: Franck Nijhof <frenck@frenck.nl>

* Update source/_integrations/amcrest.markdown

Co-Authored-By: Franck Nijhof <frenck@frenck.nl>

* removed "top/bottom" alternate movement commands.

* implement Phil's corrections/suggestions

Also updated the picture-elements card to add a zoom-in/out icon in the center of the arrows.

New example image will also be uploaded once I figure out how to do that in the markdown.

* attempt to create an amcrest folder (for images)

* delete empty amcrest file.

It needed to be a folder.
yet to figure out how to make it so.

* create /amcrest/amcrest_ptz.jpg 

create /amcrest/dummy file in the hopes this creates a new folder

* Upload new amcrest_ptz image

finally figured out how to create a new folder in multiple steps.

* fix ptz_control table formatting

Problem was copying the ptz control markdown from Foscam doc which had 2 columns, not 3.
(all this -|-|- lingo was new to me, and thought copying what worked for one, would work for the other)

Also moved the 2 usage notes to their own subsection

* Delete amcrest_ptz.JPG

deleting because extension is all caps, not lc.    did not see a way to rename a committed file.

* amcrest_ptz.jpg uploaded

* ✏️ Tweak

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
GaryOkie 2020-03-21 01:50:12 -05:00 committed by GitHub
parent 34e52b1418
commit c7bba3c5b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 156 additions and 9 deletions

View File

@ -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
<p class='img'>
<img src='/images/integrations/amcrest/amcrest_ptz.jpg' alt='Screenshot using a picture-elements with PTZ controls.'>
Example showing an Amcrest IP2M-841 PT camera with controls for Pan and Tilt.
</p>
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

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB