Push
The push
camera integration集成将 Home Assistant 与您的设备、服务等连接和集成。 [Learn more] 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 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.
Integration with motionEye
The push
camera can as an example be used with motionEyepush
camera, as shown in this example:
In motionEye, under File Storage -> Run A Command type in:
curl -X POST -F "image=@%f" http://my.hass.server.com:8123/api/webhook/my_custom_webhook_id
# inserting a backslash in the middle of "webhook" stops Motion to move the command to a webhook
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:
camera:
- platform: push
name: MotionEye Outdoor
buffer: 3
timeout: 5
webhook_id: my_custom_webhook_id
Configuration
To enable this camera in your installation, add the following to your configuration.yaml
configuration.yaml 文件是 Home Assistant 的主要配置文件。它列出了要加载的集成及其特定配置。在某些情况下,需要直接在 configuration.yaml 文件中手动编辑配置。大多数集成可以在 UI 中配置。 [Learn more] file.
在更改了configuration.yaml
configuration.yaml 文件是 Home Assistant 的主要配置文件。它列出了要加载的集成及其特定配置。在某些情况下,需要直接在 configuration.yaml 文件中手动编辑配置。大多数集成可以在 UI 中配置。 [Learn more] 文件后,重启 Home Assistant 以应用更改。 该集成现在显示在集成页面的 设置 > 设备与服务 下。其实体在集成卡片上以及实体标签上列出。
# Example configuration.yaml entry
camera:
- platform: push
name: My Push Camera
webhook_id: my_custom_webhook_id
Configuration Variables
Number of images to buffer per event. Be conservative, large buffers will starve your system memory.
Amount of time after which the event is considered to have finished.
User provided string acting as camera identifier and access control, should be a large string (more then 8 chars).