Site updated at 2016-08-22 08:21:42 UTC
This commit is contained in:
parent
f9d65cbe57
commit
4acb07bf8e
559 changed files with 18878 additions and 21688 deletions
|
@ -93,9 +93,9 @@
|
|||
<ul class="tags unstyled">
|
||||
|
||||
|
||||
<li><a class='category' href='/blog/categories/community/'>Community</a></li>
|
||||
<li>Community</li>
|
||||
|
||||
<li><a class='category' href='/blog/categories/video/'>Video</a></li>
|
||||
<li>Video</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
@ -208,7 +208,7 @@
|
|||
|
||||
|
||||
<li class="post">
|
||||
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
|
||||
<a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
<ul class="tags unstyled">
|
||||
|
||||
|
||||
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li>
|
||||
<li>Release-Notes</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
@ -142,7 +142,7 @@
|
|||
<ul>
|
||||
<li>Our work in the WSGI stack is not fully done yet. We still have a minor issues where retrieving the error log in the about screen can raise an encoding error</li>
|
||||
<li>The API used to incorrectly accept a JSON body with form-url-encoded headers. Our cURL examples on the website used to be wrong and have <a href="/developers/rest_api/">been updated</a>.</li>
|
||||
<li>Make sure your configuration.yaml file contains <code>frontend:</code> to serve the frontend</li>
|
||||
<li>Make sure your configuration.yaml file contains <code class="highlighter-rouge">frontend:</code> to serve the frontend</li>
|
||||
</ul>
|
||||
|
||||
<h3>Hotfixes 0.21.1 and 0.21.2</h3>
|
||||
|
@ -242,7 +242,7 @@
|
|||
|
||||
|
||||
<li class="post">
|
||||
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
|
||||
<a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
<ul class="tags unstyled">
|
||||
|
||||
|
||||
<li><a class='category' href='/blog/categories/video/'>Video</a></li>
|
||||
<li>Video</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
@ -213,7 +213,7 @@
|
|||
|
||||
|
||||
<li class="post">
|
||||
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
|
||||
<a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
<ul class="tags unstyled">
|
||||
|
||||
|
||||
<li><a class='category' href='/blog/categories/release-notes/'>Release-Notes</a></li>
|
||||
<li>Release-Notes</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
@ -149,14 +149,12 @@
|
|||
<li>The new Netatmo support caused us to change how Netatmo are configured. It’s now done via it’s own component.</li>
|
||||
</ul>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre><span class="key">netatmo</span>:
|
||||
<span class="key">api_key</span>: <span class="string"><span class="content">API_KEY</span></span>
|
||||
<span class="key">secret_key</span>: <span class="string"><span class="content">SECRET_KEY</span></span>
|
||||
<span class="key">username</span>: <span class="string"><span class="content">username</span></span>
|
||||
<span class="key">password</span>: <span class="string"><span class="content">password</span></span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">netatmo</span><span class="pi">:</span>
|
||||
<span class="s">api_key</span><span class="pi">:</span> <span class="s">API_KEY</span>
|
||||
<span class="s">secret_key</span><span class="pi">:</span> <span class="s">SECRET_KEY</span>
|
||||
<span class="s">username</span><span class="pi">:</span> <span class="s">username</span>
|
||||
<span class="s">password</span><span class="pi">:</span> <span class="s">password</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<h3><a class="title-link" name="hotfix-0221---june-20" href="#hotfix-0221---june-20"></a> Hotfix 0.22.1 - June 20</h3>
|
||||
|
@ -237,7 +235,7 @@
|
|||
|
||||
|
||||
<li class="post">
|
||||
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
|
||||
<a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
<ul class="tags unstyled">
|
||||
|
||||
|
||||
<li><a class='category' href='/blog/categories/how-to/'>How-To</a></li>
|
||||
<li>How-To</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
@ -108,7 +108,7 @@
|
|||
</header>
|
||||
|
||||
|
||||
<p><img src="/images/blog/2016-06-cranberry/motion.png" style="clear: right; border:none; box-shadow: none; float: right; margin-bottom: 12px;" width="200" /><br />
|
||||
<p><img src="/images/blog/2016-06-cranberry/motion.png" style="clear: right; border:none; box-shadow: none; float: right; margin-bottom: 12px;" width="200" />
|
||||
In the past month I was thinking about ways to integrate USB webcams into Home Assistant again. The main reason was that this would give those devices a second life and enable one to benefit from low-cost video surveillance. There are a couple of options available like <a href="http://www.pygame.org/hifi.html">pygame</a> or <a href="http://www.simplecv.org/">SimpleCV</a> but I never finished something. With the <a href="https://home-assistant.io/components/camera.local_file/">Local File camera platform</a> by <a href="https://github.com/Landrash">Landrash</a> and <a href="http://lavrsen.dk/foswiki/bin/view/Motion/WebHome">motion</a> you could integrate a local USB webcam with a few very easy steps.</p>
|
||||
|
||||
<p>In this blog post I am using a Fedora 24 (will most likely work on other distributions too) installation with Home Assistant 0.22.1 on a Foxconn nT-330i with an old <a href="http://support.logitech.com/en_us/product/quickcam-sphere-af">Logitech QuickCam Orbit AF</a> and a <a href="http://support.logitech.com/en_us/product/hd-webcam-c270">Logitech HD Webcam C270</a>. As a start only the Quickcam is used. No multi-camera setup for now.</p>
|
||||
|
@ -117,98 +117,86 @@ In the past month I was thinking about ways to integrate USB webcams into Home A
|
|||
|
||||
<p>Check first if the your operating system lists your cameras.</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>$ lsusb
|
||||
[...]
|
||||
Bus 002 Device 016: ID 046d:08cc Logitech, Inc. Mic (PTZ)
|
||||
[...]
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>lsusb
|
||||
<span class="o">[</span>...]
|
||||
Bus 002 Device 016: ID 046d:08cc Logitech, Inc. Mic <span class="o">(</span>PTZ<span class="o">)</span>
|
||||
<span class="o">[</span>...]
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<p>The camera we are going to use is available at <code>/dev/video1</code>. The C270 is the one on <code>/dev/video0</code>.</p>
|
||||
<p>The camera we are going to use is available at <code class="highlighter-rouge">/dev/video1</code>. The C270 is the one on <code class="highlighter-rouge">/dev/video0</code>.</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>$ ls -al /dev/video*
|
||||
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>ls -al /dev/video<span class="k">*</span>
|
||||
crw-rw----+ 1 root video 81, 0 Jun 23 08:05 /dev/video0
|
||||
crw-rw----+ 1 root video 81, 1 Jun 23 08:36 /dev/video1
|
||||
</pre></div>
|
||||
</div>
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<p>We need an additional software part to handle the cameras. <a href="http://lavrsen.dk/foswiki/bin/view/Motion/WebHome">motion</a> is capable of monitoring the video signal from USB and network cameras, do motion detection, and other nifty stuff like saving images, add text, or basic image manipulations. Make sure that you have the <a href="http://rpmfusion.org/">RPM Fusion respository</a> enabled.</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>$ sudo dnf -y install motion
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>sudo dnf -y install motion
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<p>For our setup we need to modify the file <code>/etc/motion/motion.conf</code>. For now the most important parameters are <code>videodevice</code>, <code>snapshot_interval</code>, and <code>target_dir</code>. The other settings can be left to their defaults. We are going to use the device <code>/dev/video1</code>, use a 30 seconds interval, and set the path to <code>/tmp</code>.</p>
|
||||
<p>For our setup we need to modify the file <code class="highlighter-rouge">/etc/motion/motion.conf</code>. For now the most important parameters are <code class="highlighter-rouge">videodevice</code>, <code class="highlighter-rouge">snapshot_interval</code>, and <code class="highlighter-rouge">target_dir</code>. The other settings can be left to their defaults. We are going to use the device <code class="highlighter-rouge">/dev/video1</code>, use a 30 seconds interval, and set the path to <code class="highlighter-rouge">/tmp</code>.</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>[...]
|
||||
###########################################################
|
||||
# Capture device options
|
||||
############################################################
|
||||
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="o">[</span>...]
|
||||
<span class="c">###########################################################</span>
|
||||
<span class="c"># Capture device options</span>
|
||||
<span class="c">############################################################</span>
|
||||
|
||||
# Videodevice to be used for capturing (default /dev/video0)
|
||||
# for FreeBSD default is /dev/bktr0
|
||||
<span class="c"># Videodevice to be used for capturing (default /dev/video0)</span>
|
||||
<span class="c"># for FreeBSD default is /dev/bktr0</span>
|
||||
videodevice /dev/video1
|
||||
|
||||
[..]
|
||||
############################################################
|
||||
# Snapshots (Traditional Periodic Webcam File Output)
|
||||
############################################################
|
||||
<span class="o">[</span>..]
|
||||
<span class="c">############################################################</span>
|
||||
<span class="c"># Snapshots (Traditional Periodic Webcam File Output)</span>
|
||||
<span class="c">############################################################</span>
|
||||
|
||||
# Make automated snapshot every N seconds (default: 0 = disabled)
|
||||
<span class="c"># Make automated snapshot every N seconds (default: 0 = disabled)</span>
|
||||
snapshot_interval 30
|
||||
|
||||
[...]
|
||||
############################################################
|
||||
# Target Directories and filenames For Images And Films
|
||||
# For the options snapshot_, picture_, movie_ and timelapse_filename
|
||||
# you can use conversion specifiers
|
||||
# %Y = year, %m = month, %d = date,
|
||||
# %H = hour, %M = minute, %S = second,
|
||||
# %v = event, %q = frame number, %t = thread (camera) number,
|
||||
# %D = changed pixels, %N = noise level,
|
||||
# %i and %J = width and height of motion area,
|
||||
# %K and %L = X and Y coordinates of motion center
|
||||
# %C = value defined by text_event
|
||||
# Quotation marks round string are allowed.
|
||||
############################################################
|
||||
<span class="o">[</span>...]
|
||||
<span class="c">############################################################</span>
|
||||
<span class="c"># Target Directories and filenames For Images And Films</span>
|
||||
<span class="c"># For the options snapshot_, picture_, movie_ and timelapse_filename</span>
|
||||
<span class="c"># you can use conversion specifiers</span>
|
||||
<span class="c"># %Y = year, %m = month, %d = date,</span>
|
||||
<span class="c"># %H = hour, %M = minute, %S = second,</span>
|
||||
<span class="c"># %v = event, %q = frame number, %t = thread (camera) number,</span>
|
||||
<span class="c"># %D = changed pixels, %N = noise level,</span>
|
||||
<span class="c"># %i and %J = width and height of motion area,</span>
|
||||
<span class="c"># %K and %L = X and Y coordinates of motion center</span>
|
||||
<span class="c"># %C = value defined by text_event</span>
|
||||
<span class="c"># Quotation marks round string are allowed.</span>
|
||||
<span class="c">############################################################</span>
|
||||
|
||||
# Target base directory for pictures and films
|
||||
# Recommended to use absolute path. (Default: current working directory)
|
||||
<span class="c"># Target base directory for pictures and films</span>
|
||||
<span class="c"># Recommended to use absolute path. (Default: current working directory)</span>
|
||||
target_dir /tmp
|
||||
|
||||
[...]
|
||||
</pre></div>
|
||||
</div>
|
||||
<span class="o">[</span>...]
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<p>It’s suggested that you adjust at least <code>width</code> and <code>height</code> to get a bigger image from your camera. If you are done, fire up <code>motion</code>.</p>
|
||||
<p>It’s suggested that you adjust at least <code class="highlighter-rouge">width</code> and <code class="highlighter-rouge">height</code> to get a bigger image from your camera. If you are done, fire up <code class="highlighter-rouge">motion</code>.</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre>$ sudo motion
|
||||
[0] [NTC] [ALL] conf_load: Processing thread 0 - config file /etc/motion/motion.conf
|
||||
[0] [ALR] [ALL] conf_cmdparse: Unknown config option "sdl_threadnr"
|
||||
[0] [NTC] [ALL] motion_startup: Motion 3.3.0 Started
|
||||
[0] [NTC] [ALL] motion_startup: Logging to file (/var/log/motion.log)
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>sudo motion
|
||||
<span class="o">[</span>0] <span class="o">[</span>NTC] <span class="o">[</span>ALL] conf_load: Processing thread 0 - config file /etc/motion/motion.conf
|
||||
<span class="o">[</span>0] <span class="o">[</span>ALR] <span class="o">[</span>ALL] conf_cmdparse: Unknown config option <span class="s2">"sdl_threadnr"</span>
|
||||
<span class="o">[</span>0] <span class="o">[</span>NTC] <span class="o">[</span>ALL] motion_startup: Motion 3.3.0 Started
|
||||
<span class="o">[</span>0] <span class="o">[</span>NTC] <span class="o">[</span>ALL] motion_startup: Logging to file <span class="o">(</span>/var/log/motion.log<span class="o">)</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<p>Your <code>target_dir</code> will start filling up with images from your camera. <code>motion</code> will create a symlink called <code>lastsnap.jpg</code> which always point to the latest snapshot. We will setup the <a href="https://home-assistant.io/components/camera.local_file/">Local File camera platform</a> to use this file.</p>
|
||||
<p>Your <code class="highlighter-rouge">target_dir</code> will start filling up with images from your camera. <code class="highlighter-rouge">motion</code> will create a symlink called <code class="highlighter-rouge">lastsnap.jpg</code> which always point to the latest snapshot. We will setup the <a href="https://home-assistant.io/components/camera.local_file/">Local File camera platform</a> to use this file.</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre><span class="key">camera</span>:
|
||||
- <span class="string"><span class="content">platform: local_file</span></span>
|
||||
<span class="key">name</span>: <span class="string"><span class="content">Cranberry cam</span></span>
|
||||
<span class="key">file_path</span>: <span class="string"><span class="content">/tmp/lastsnap.jpg</span></span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">camera</span><span class="pi">:</span>
|
||||
<span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">local_file</span>
|
||||
<span class="s">name</span><span class="pi">:</span> <span class="s">Cranberry cam</span>
|
||||
<span class="s">file_path</span><span class="pi">:</span> <span class="s">/tmp/lastsnap.jpg</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<p class="img">
|
||||
|
@ -216,20 +204,18 @@ target_dir /tmp
|
|||
The “Cranberry cam” in action
|
||||
</p>
|
||||
|
||||
<p>The machine with the attached USB camera will become a webcam server as well because <code>motion</code>’s built-in HTTP server is enabled by default. This means that you could connect your USB webcams to a different machine in your network, run <code>motion</code> there, adjust your firewall rules, and use Home Assistant to display the videos. Just check http://[IP of your webcam host]:8081/ to see the stream. This required more powerful hardware than using snapshots, of course.</p>
|
||||
<p>The machine with the attached USB camera will become a webcam server as well because <code class="highlighter-rouge">motion</code>’s built-in HTTP server is enabled by default. This means that you could connect your USB webcams to a different machine in your network, run <code class="highlighter-rouge">motion</code> there, adjust your firewall rules, and use Home Assistant to display the videos. Just check http://[IP of your webcam host]:8081/ to see the stream. This required more powerful hardware than using snapshots, of course.</p>
|
||||
|
||||
<p>In a scenario like this needs a <a href="https://home-assistant.io/components/camera.mjpeg/">Generic MJPEG IP Camera </a> in your <code>configuration.yaml</code> file.</p>
|
||||
<p>In a scenario like this needs a <a href="https://home-assistant.io/components/camera.mjpeg/">Generic MJPEG IP Camera </a> in your <code class="highlighter-rouge">configuration.yaml</code> file.</p>
|
||||
|
||||
<div class="highlighter-coderay"><div class="CodeRay">
|
||||
<div class="code"><pre><span class="key">camera</span>:
|
||||
- <span class="string"><span class="content">platform: mjpeg</span></span>
|
||||
<span class="key">mjpeg_url</span>: <span class="string"><span class="content">http://[IP of your webcam host]:8081</span></span>
|
||||
<span class="key">name</span>: <span class="string"><span class="content">Cranberry Live cam</span></span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">camera</span><span class="pi">:</span>
|
||||
<span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">mjpeg</span>
|
||||
<span class="s">mjpeg_url</span><span class="pi">:</span> <span class="s">http://[IP of your webcam host]:8081</span>
|
||||
<span class="s">name</span><span class="pi">:</span> <span class="s">Cranberry Live cam</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<p><a href="http://lavrsen.dk/foswiki/bin/view/Motion/WebHome">motion</a> is a powerful tool and this blog post only showed two very simple use cases. Take a look at the <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuide">documentation</a> of <code>motion</code> to unleash its potential.</p>
|
||||
<p><a href="http://lavrsen.dk/foswiki/bin/view/Motion/WebHome">motion</a> is a powerful tool and this blog post only showed two very simple use cases. Take a look at the <a href="http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuide">documentation</a> of <code class="highlighter-rouge">motion</code> to unleash its potential.</p>
|
||||
</article>
|
||||
|
||||
|
||||
|
@ -303,7 +289,7 @@ target_dir /tmp
|
|||
|
||||
|
||||
<li class="post">
|
||||
<a href="/blog/2016/08/13/foursquare-fast-com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
|
||||
<a href="/blog/2016/08/13/foursquare-fast.com-ffmpeg-gpsd/">0.26: Foursquare, Fast.com, FFMPEG and GPSD</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue