From 95fc8e6306a983e0022ca4c86a19304e0d66a8f7 Mon Sep 17 00:00:00 2001 From: Diogo Gomes Date: Wed, 27 Jun 2018 00:20:45 +0100 Subject: [PATCH 1/6] Add camera.push --- source/_components/camera.push.markdown | 77 +++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 source/_components/camera.push.markdown diff --git a/source/_components/camera.push.markdown b/source/_components/camera.push.markdown new file mode 100644 index 000000000000..ddce5f6ea538 --- /dev/null +++ b/source/_components/camera.push.markdown @@ -0,0 +1,77 @@ +--- +layout: page +title: "Push" +description: "Instructions how to use Push Camera within Home Assistant." +date: 2018-06-26 23:50 +sidebar: true +comments: false +sharing: true +footer: true +logo: camcorder.png +ha_category: Camera +ha_iot_class: "Local Push" +ha_release: 0.73 +--- + +The `push` camera platform allows you to integrate images sent over HTTP POST to Home Assistant as a camera. External applications/daemons/scripts are therefore able to "stream" images through Home Assistant. + +Optionally the Push Camera is able to **cache** a given number of images, creating an animation of the detected motion, after the event has been recorded. + +Images are cleared on new events, and events are separated by a soft (configurable) **timeout**. + +## Integration with motionEye + +The `push` camera can as an example be used with [motionEye](https://github.com/ccrisan/motioneye/wiki) a web frontend for the motion daemon. motionEye is usually configured to save/record files ***only*** when motion is detected. It provides a hook to run a command whenever an image is saved, which can be used together with cURL to send the motion detected images to the `push` camera, as showed in this example: + +In motionEye, under **File Storage -> Run A Command** type in: +```bash +curl -X POST -F "image=@%f" http://my.hass.server.com:8123/api/camera_push/camera.push_camera +``` + +Please take note that you might need to add `-H "x-ha-access: YOUR_PASSWORD"` if you have API authentication enabled. + +Optionally configure motionEye to save only motion triggered images by going into **Still Images -> Capture Mode** and setting **Motion Triggered**. And tune to your preferences under **Motion Detection**. + +In this setup, you can configure the push camera to continuously replay the last motion triggered event using a configuration such as: + +```yaml +camera: + - platform: push + name: MotionEye Outdoor + cache: 3 + timeout: 5 +``` + +## {% linkable_title Configuration %} + +To enable this camera in your installation, add the following to your `configuration.yaml` file: + +```yaml +# Example configuration.yaml entry +camera: + - platform: push + name: My Push Camera +``` + +{% configuration %} +name: + description: The name you would like to give to the camera. + required: false + default: Push Camera + type: string +cache: + description: Number of images to cache per event. Be conservative, large caches will starve your system memory. + required: false + default: 1 + type: string +timeout: + description: Amount of time after which the event is considered to have finished. + required: false + default: 5 seconds + type: time +field: + description: HTTP POST field containing the image file + required: false + default: image + type: string +{% endconfiguration %} From 5674f80070d45a18d9263477d2ba0919d02cd2c5 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 27 Jun 2018 12:17:26 +0200 Subject: [PATCH 2/6] :pencil2: Language tweaks --- source/_components/camera.push.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/_components/camera.push.markdown b/source/_components/camera.push.markdown index ddce5f6ea538..d1786e5dbfbb 100644 --- a/source/_components/camera.push.markdown +++ b/source/_components/camera.push.markdown @@ -15,13 +15,13 @@ ha_release: 0.73 The `push` camera platform allows you to integrate images sent over HTTP POST to Home Assistant as a camera. External applications/daemons/scripts are therefore able to "stream" images through Home Assistant. -Optionally the Push Camera is able to **cache** a given number of images, creating an animation of the detected motion, after the event has been recorded. +Optionally the Push Camera can **cache** a given number of images, creating an animation of the detected motion after the event has been recorded. Images are cleared on new events, and events are separated by a soft (configurable) **timeout**. ## Integration with motionEye -The `push` camera can as an example be used with [motionEye](https://github.com/ccrisan/motioneye/wiki) a web frontend for the motion daemon. motionEye is usually configured to save/record files ***only*** when motion is detected. It provides a hook to run a command whenever an image is saved, which can be used together with cURL to send the motion detected images to the `push` camera, as showed in this example: +The `push` camera can as an example be used with [motionEye](https://github.com/ccrisan/motioneye/wiki) a web frontend for the motion daemon. motionEye is usually configured to save/record files ***only*** when motion is detected. It provides a hook to run a command whenever an image is saved, which can be used together with cURL to send the motion detected images to the `push` camera, as shown in this example: In motionEye, under **File Storage -> Run A Command** type in: ```bash @@ -30,7 +30,7 @@ curl -X POST -F "image=@%f" http://my.hass.server.com:8123/api/camera_push/camer Please take note that you might need to add `-H "x-ha-access: YOUR_PASSWORD"` if you have API authentication enabled. -Optionally configure motionEye to save only motion triggered images by going into **Still Images -> Capture Mode** and setting **Motion Triggered**. And tune to your preferences under **Motion Detection**. +Optionally configure motionEye to save only motion triggered images by going into **Still Images -> Capture Mode** and setting **Motion Triggered**. Tune your preferences under **Motion Detection**. In this setup, you can configure the push camera to continuously replay the last motion triggered event using a configuration such as: From 884e0ab8c383f69d3e295a4ae73dd231a9091df7 Mon Sep 17 00:00:00 2001 From: Diogo Gomes Date: Tue, 3 Jul 2018 00:07:24 +0100 Subject: [PATCH 3/6] add force_update --- source/_components/camera.push.markdown | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/_components/camera.push.markdown b/source/_components/camera.push.markdown index ddce5f6ea538..b966fa5d62d6 100644 --- a/source/_components/camera.push.markdown +++ b/source/_components/camera.push.markdown @@ -74,4 +74,9 @@ field: required: false default: image type: string +force_update: + description: Sends update events even if the value hasn't changed. Useful if you want to have event triggers for every single image pushed. + required: false + type: boolean + default: False {% endconfiguration %} From 757ca2a3e5ba5bb704199a10d09da7cef548727f Mon Sep 17 00:00:00 2001 From: Diogo Gomes Date: Tue, 3 Jul 2018 23:13:11 +0100 Subject: [PATCH 4/6] Revert "add force_update" This reverts commit 884e0ab8c383f69d3e295a4ae73dd231a9091df7. --- source/_components/camera.push.markdown | 5 ----- 1 file changed, 5 deletions(-) diff --git a/source/_components/camera.push.markdown b/source/_components/camera.push.markdown index 8cd73d0eb5ce..d1786e5dbfbb 100644 --- a/source/_components/camera.push.markdown +++ b/source/_components/camera.push.markdown @@ -74,9 +74,4 @@ field: required: false default: image type: string -force_update: - description: Sends update events even if the value hasn't changed. Useful if you want to have event triggers for every single image pushed. - required: false - type: boolean - default: False {% endconfiguration %} From 27bc6a625f73d0bed79dc2047d6fefc729693d64 Mon Sep 17 00:00:00 2001 From: Diogo Gomes Date: Wed, 4 Jul 2018 00:24:32 +0100 Subject: [PATCH 5/6] cache -> buffer --- source/_components/camera.push.markdown | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/_components/camera.push.markdown b/source/_components/camera.push.markdown index d1786e5dbfbb..c79475c060f6 100644 --- a/source/_components/camera.push.markdown +++ b/source/_components/camera.push.markdown @@ -15,7 +15,7 @@ ha_release: 0.73 The `push` camera platform allows you to integrate images sent over HTTP POST to Home Assistant as a camera. External applications/daemons/scripts are therefore able to "stream" images through Home Assistant. -Optionally the Push Camera can **cache** a given number of images, creating an animation of the detected motion after the event has been recorded. +Optionally the Push Camera can **buffer** a given number of images, creating an animation of the detected motion after the event has been recorded. Images are cleared on new events, and events are separated by a soft (configurable) **timeout**. @@ -38,7 +38,7 @@ In this setup, you can configure the push camera to continuously replay the last camera: - platform: push name: MotionEye Outdoor - cache: 3 + buffer: 3 timeout: 5 ``` @@ -59,8 +59,8 @@ name: required: false default: Push Camera type: string -cache: - description: Number of images to cache per event. Be conservative, large caches will starve your system memory. +buffer: + description: Number of images to buffer per event. Be conservative, large buffers will starve your system memory. required: false default: 1 type: string From c03c72b11b8117b53c34a0ec5bfcbf09a91f663b Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 4 Jul 2018 12:06:53 +0200 Subject: [PATCH 6/6] :arrow_up: ha_release 0.74 --- source/_components/camera.push.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/_components/camera.push.markdown b/source/_components/camera.push.markdown index c79475c060f6..c70dee014c04 100644 --- a/source/_components/camera.push.markdown +++ b/source/_components/camera.push.markdown @@ -10,7 +10,7 @@ footer: true logo: camcorder.png ha_category: Camera ha_iot_class: "Local Push" -ha_release: 0.73 +ha_release: 0.74 --- The `push` camera platform allows you to integrate images sent over HTTP POST to Home Assistant as a camera. External applications/daemons/scripts are therefore able to "stream" images through Home Assistant.