This Home Assistant add-on utilizes the motion project, YOLO, and other AI's to detect and classify entity(s) in images. The motion project software provides an extensive set of capabilities to capture video feeds from a variety of sources, including RSTP
,HTTP
, and MJPEG
network cameras. Locally attached USB camera requires specialized version; see motion-video0
.
This add-on interacts with additional components and services:
motion-ai
- Automated Home Assistant configurator for use withmotion
addon (see below).MQTT
Messaging service; usemosquitto
or HiveMQ add-onFTP
(optional) FTP daemon to receive webcam videos; useaddon-ftp
add-on
In addition, there are three AI services which may be used to identify entities, faces, and license plates.
yolo4motion
An Open Horizon service; usesh/yolo4motion.sh
inmotion
face4motion
An Open Horizon service; usesh/face4motion.sh
inmotion
alpr4motion
An Open Horizon service; usesh/alpr4motion.sh
inmotion
This addon is built for the following architectures and available in Docker Hub, e.g. amd64
version.
The motion-ai
repository provides automated mechanisms to download, install, and configure Home Assistant. The webcams.json
file defines cameras known to the system; file contents of []
indicate none and only discovered will appear. After modifying and/or creating this file, Home Assistant should be reconfigured. Run make restart
in the top-level HA directory -- typically /usr/share/hassio
when using the motion-ai
installation instructions.
There are three attributes required to integrate a camera into HA:
name
- identifier for the camera as defined by the addon (n.b. MQTT topic reserved characters)mjpeg_url
- address of live MJPEG stream; local access only by defaultusername
- authentication for access to MJPEG streampassword
- authentication for access to MJPEG stream
In addition, there are two additional attributes which are optional:
icon
- select from Material Design Iconsw3w
- location of camera as identified by What3Words
[
{
"name": "kelispond",
"mjpeg_url": "http://127.0.0.1:8090/1",
"username": "!secret motioncam-username",
"password": "!secret motioncam-password",
"icon": "xbox",
"w3w": ["varieties","usage","racks"]
}
]
Specify the host and port for sending MQTT messages.
logins:
- username: username
password: password
anonymous: false
customize:
active: false
folder: mosquitto
certfile: fullchain.pem
keyfile: privkey.pem
require_certificate: false
All topics begin with the devicedb
specified, which defaults to "motion".
<devicedb>/{name}/{camera}
-- JSON payload of motion detected<devicedb>/{name}/{camera}/lost
-- JSON payload of motion detected<devicedb>/{name}/{camera}/event/start
-- JSON payload of motion detected<devicedb>/{name}/{camera}/event/end
-- JSON payload of motion detected<devicedb>/{name}/{camera}/image
-- JPEG payload of image (seepost_pictures
)<devicedb>/{name}/{camera}/image-average
-- JPEG payload of average event<devicedb>/{name}/{camera}/image-blend
-- JPEG payload of blended event (50%)<devicedb>/{name}/{camera}/image-composite
-- JPEG payload of composite event<devicedb>/{name}/{camera}/image-animated
-- GIF payload of event<devicedb>/{name}/{camera}/image-animated-mask
-- GIF payload of event (as B/W mask)
The Motion package has extensive documentation on available parameters. Almost all parameters are avsailable. The JSON configuration options are provided using the same name as in the Motion documentation.
Releases are based on Semantic Versioning, and use the format
of MAJOR.MINOR.PATCH
. In a nutshell, the version will be incremented
based on the following:
MAJOR
: Incompatible or major changes.MINOR
: Backwards-compatible new features and enhancements.PATCH
: Backwards-compatible bugfixes and package updates.
David C Martin ([email protected])