Site updated at 2017-02-04 09:16:52 UTC

This commit is contained in:
Travis CI 2017-02-04 09:16:52 +00:00
parent eeb57b8e5f
commit 7149e2d48a
37 changed files with 88 additions and 540 deletions

View file

@ -94,8 +94,6 @@
<ul class="tags unstyled">
<li>Babyphone</li>
<li>How-To</li>
@ -111,7 +109,7 @@
</header>
<p>One of the hardest part of being a parent is keeping a constant eye on the baby to make sure that baby is doing well. Thus, it is not surprising that baby monitors are one of the fastest growing baby product category. However, many of the baby monitors available in the market are rather dumb and expect the parents to keep looking at the video stream or listen to the audio. This how-to will help you create a smart baby monitor on a budget and integrate it with Home-Assitant. Instead of relying on the poor quality baby monitor speakers, we use our existing speakers (e.g., Sonos). We can also send notifications (with pictures) to avoid constant monitoring of the feed.</p>
<p>One of the hardest part of being a parent is keeping a constant eye on the baby to make sure that baby is doing well. Thus, it is not surprising that baby monitors are one of the fastest growing baby product category. However, many of the baby monitors available on the market are rather dumb and expect the parents to keep looking at the video stream or listen to the audio. This how-to will help you create a smart baby monitor on a budget and integrate it with Home Assitant. Instead of relying on the poor quality baby monitor speakers, we use our existing speakers (eg. Sonos). We can also send notifications (with pictures) to avoid constant monitoring of the feed.</p>
<p>Obviously, you can use the setup as a general purpose surveillance system to monitor noise in the whole house.</p>
@ -119,15 +117,16 @@
<h3><a class="title-link" name="setup" href="#setup"></a> Setup</h3>
<p>We need an IP-camera that can capture sound in the babys room. It is also possible to use a Raspberry Pi with a microphone and send the audio to our Home-Assistant with <code class="highlighter-rouge">ffmpeg -f alsa -i hw:1,0 -vn -f rtp rtp://236.0.0.1:2000</code> over multicast. We can set <code class="highlighter-rouge">input</code> option on Home-Assistant side to <code class="highlighter-rouge">rtp://236.0.0.1:2000</code> in same network.</p>
<p>We need an IP camera that can capture sound in the babys room. It is also possible to use a Raspberry Pi with a microphone and send the audio to Home Assistant with <code class="highlighter-rouge">ffmpeg -f alsa -i hw:1,0 -vn -f rtp rtp://236.0.0.1:2000</code> over multicast. We can set the <code class="highlighter-rouge">input</code> option on the Home Assistant side to <code class="highlighter-rouge">rtp://236.0.0.1:2000</code> in same network.</p>
<p>Next, we attach a ffmpeg noise binary sensor to our IP-camera. The sensor has an output <code class="highlighter-rouge">option</code> that allows us to send the output to icecast2 server for playing over speakers integrated with Home-Assistant (e.g., Sonos). We can use the binary sensor in our automation. You can ignore the icecast2 setup if you dont want to play the audio after the noise sensor trigger.</p>
<p>Next, we attach a FFmpeg noise binary sensor to our IP camera. The sensor has an output <code class="highlighter-rouge">option</code> that allows us to send the output to an <a href="http://icecast.org/">icecast2</a> server for playing over speakers integrated with Home Assistant (eg. Sonos). We can use the binary sensor in our automation. You can ignore the icecast2 setup if you dont want to play the audio after the noise sensor trigger.</p>
<p class="note">
We change the platform name for binary sensor in 0.38 from <code class="highlighter-rouge">ffmpeg</code> to <code class="highlighter-rouge">ffmpeg_noise</code>. Also all service going to component and was rename from <code class="highlighter-rouge">binary_sensor.ffmpeg_xy</code> to <code class="highlighter-rouge">ffmpeg.xy</code>.
</p>
<p>On Raspbian Jessie, you can setup <a href="/components/ffmpeg">ffmpeg</a> and install a <a href="http://icecast.org/">icecast2</a> server using:</p>
<p>On Raspbian Jessie, you can setup <a href="/components/ffmpeg">FFmpeg</a> and install a <a href="http://icecast.org/">icecast2</a> server using:</p>
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>sudo <span class="nb">echo</span> <span class="s2">"deb http://ftp.debian.org/debian jessie-backports main"</span> &gt;&gt; /etc/apt/sources.list
<span class="gp">$ </span>sudo apt-get update
<span class="gp">$ </span>sudo apt-get -t jessie-backports install ffmpeg
@ -136,6 +135,7 @@ We change the platform name for binary sensor in 0.38 from <code class="highligh
</div>
<p>We setup a icecast mount point for our babyphone and update <code class="highlighter-rouge">/etc/icecast2/icecast.xml</code>:</p>
<div class="highlighter-rouge"><pre class="highlight"><code>&lt;mount&gt;
&lt;mount-name&gt;/babyphone.mp3&lt;/mount-name&gt;
&lt;stream-name&gt;Babyphone&lt;/stream-name&gt;
@ -146,23 +146,23 @@ We change the platform name for binary sensor in 0.38 from <code class="highligh
</code></pre>
</div>
<p>Now we can add the noise sensor to Home-Assistant. We can lower the sensitivity of the sensor (so that you are not inundated with notifications for every cough of the baby) to 2 seconds using the <code class="highlighter-rouge">duration</code> option. The sensor should wait 60 seconds before restoring and it prevent us that a wine break will triggering a new alarm.</p>
<p>Now we can add the noise sensor to Home Assistant. We can lower the sensitivity of the sensor (so that you are not inundated with notifications for every cough of the baby) to 2 seconds using the <code class="highlighter-rouge">duration</code> option. The sensor should wait 60 seconds before restoring and it prevent us that a wine break will triggering a new alarm.</p>
<p>We can optimize the audio stream for human voice by using a highpass filter with 300Hz and a lowpass filter with 2500Hz. This filters out all non-human sounds such as background noise. We can even add a volume amplifier if the microphone volume is too low (you can remove it from <code class="highlighter-rouge">extra_arguments</code>). For icecast2 we convert the audio stream to mp3 with samplerate of 16000 (which is the minimum for Sonos speakers). We use <code class="highlighter-rouge">peak</code> to set the threshold for noise detection, where 0 dB is very loud and -100 dB is low.</p>
<p>We can optimize the audio stream for human voice by using a highpass filter with 300 Hz and a lowpass filter with 2500 Hz. This filters out all non-human sounds such as background noise. We can even add a volume amplifier if the microphone volume is too low (you can remove it from <code class="highlighter-rouge">extra_arguments</code>). For icecast2 we convert the audio stream to mp3 with samplerate of 16000 (which is the minimum for Sonos speakers). We use <code class="highlighter-rouge">peak</code> to set the threshold for noise detection, where 0 dB is very loud and -100 dB is low.</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">binary_sensor</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">ffmpeg_noise</span>
<span class="s">input</span><span class="pi">:</span> <span class="s">rtsp://user:pw@my_input/video</span>
<span class="s">extra_arguments</span><span class="pi">:</span> <span class="s">-filter:a highpass=f=300,lowpass=f=2500,volume=volume=2 -codec:a libmp3lame -ar 16000</span>
<span class="s">output</span><span class="pi">:</span> <span class="s">-f mp3 icecast://stream_user:stream_pw@127.0.0.1:8000/babyphone.mp3</span>
<span class="s">initial_state</span><span class="pi">:</span> <span class="s">false</span>
<span class="s">duration</span><span class="pi">:</span> <span class="s">2</span>
<span class="s">reset</span><span class="pi">:</span> <span class="s">60</span>
<span class="s">peak</span><span class="pi">:</span> <span class="s">-32</span>
<span class="pi">-</span> <span class="s">platform</span><span class="pi">:</span> <span class="s">ffmpeg_noise</span>
<span class="s">input</span><span class="pi">:</span> <span class="s">rtsp://user:pw@my_input/video</span>
<span class="s">extra_arguments</span><span class="pi">:</span> <span class="s">-filter:a highpass=f=300,lowpass=f=2500,volume=volume=2 -codec:a libmp3lame -ar 16000</span>
<span class="s">output</span><span class="pi">:</span> <span class="s">-f mp3 icecast://stream_user:stream_pw@127.0.0.1:8000/babyphone.mp3</span>
<span class="s">initial_state</span><span class="pi">:</span> <span class="s">false</span>
<span class="s">duration</span><span class="pi">:</span> <span class="s">2</span>
<span class="s">reset</span><span class="pi">:</span> <span class="s">60</span>
<span class="s">peak</span><span class="pi">:</span> <span class="s">-32</span>
</code></pre>
</div>
<p>We use the option <code class="highlighter-rouge">initial_state</code> to prevent the ffmpeg process from starting with Home-Assistant and only start it when needed. We use an <code class="highlighter-rouge">input_boolean</code> to control the state of ffmpeg services using the following automation.</p>
<p>We use the option <code class="highlighter-rouge">initial_state</code> to prevent the FFmpeg process from starting with Home Assistant and only start it when needed. We use an <code class="highlighter-rouge">input_boolean</code> to control the state of FFmpeg services using the following automation.</p>
<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">input_boolean</span><span class="pi">:</span>
<span class="s">babyphone</span><span class="pi">:</span>

View file

@ -3336,8 +3336,6 @@
<ul class="tags unstyled">
<li>Babyphone</li>
<li>How-To</li>

View file

@ -1,156 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title><![CDATA[Category: Babyphone | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/babyphone/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/>
<updated>2017-02-04T09:07:32+00:00</updated>
<id>https://home-assistant.io/</id>
<author>
<name><![CDATA[Home Assistant]]></name>
</author>
<generator uri="http://octopress.org/">Octopress</generator>
<entry>
<title type="html"><![CDATA[Smart Baby Monitor]]></title>
<link href="https://home-assistant.io/blog/2017/02/03/babyphone/"/>
<updated>2017-02-03T23:00:00+00:00</updated>
<id>https://home-assistant.io/blog/2017/02/03/babyphone</id>
<content type="html"><![CDATA[One of the hardest part of being a parent is keeping a constant eye on the baby to make sure that baby is doing well. Thus, it is not surprising that baby monitors are one of the fastest growing baby product category. However, many of the baby monitors available in the market are rather dumb and expect the parents to keep looking at the video stream or listen to the audio. This how-to will help you create a smart baby monitor on a budget and integrate it with Home-Assitant. Instead of relying on the poor quality baby monitor speakers, we use our existing speakers (e.g., Sonos). We can also send notifications (with pictures) to avoid constant monitoring of the feed.
Obviously, you can use the setup as a general purpose surveillance system to monitor noise in the whole house.
<!--more-->
### <a class='title-link' name='setup' href='#setup'></a> Setup
We need an IP-camera that can capture sound in the baby's room. It is also possible to use a Raspberry Pi with a microphone and send the audio to our Home-Assistant with `ffmpeg -f alsa -i hw:1,0 -vn -f rtp rtp://236.0.0.1:2000` over multicast. We can set `input` option on Home-Assistant side to `rtp://236.0.0.1:2000` in same network.
Next, we attach a ffmpeg noise binary sensor to our IP-camera. The sensor has an output `option` that allows us to send the output to icecast2 server for playing over speakers integrated with Home-Assistant (e.g., Sonos). We can use the binary sensor in our automation. You can ignore the icecast2 setup if you don't want to play the audio after the noise sensor trigger.
<p class='note'>
We change the platform name for binary sensor in 0.38 from `ffmpeg` to `ffmpeg_noise`. Also all service going to component and was rename from `binary_sensor.ffmpeg_xy` to `ffmpeg.xy`.
</p>
On Raspbian Jessie, you can setup [ffmpeg](/components/ffmpeg) and install a [icecast2](http://icecast.org/) server using:
```bash
$ sudo echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list
$ sudo apt-get update
$ sudo apt-get -t jessie-backports install ffmpeg
$ sudo apt-get install icecast2
```
We setup a icecast mount point for our babyphone and update `/etc/icecast2/icecast.xml`:
```
<mount>
<mount-name>/babyphone.mp3</mount-name>
<stream-name>Babyphone</stream-name>
<username>stream_user</username>
<password>stream_pw</password>
</mount>
```
Now we can add the noise sensor to Home-Assistant. We can lower the sensitivity of the sensor (so that you are not inundated with notifications for every cough of the baby) to 2 seconds using the `duration` option. The sensor should wait 60 seconds before restoring and it prevent us that a wine break will triggering a new alarm.
We can optimize the audio stream for human voice by using a highpass filter with 300Hz and a lowpass filter with 2500Hz. This filters out all non-human sounds such as background noise. We can even add a volume amplifier if the microphone volume is too low (you can remove it from `extra_arguments`). For icecast2 we convert the audio stream to mp3 with samplerate of 16000 (which is the minimum for Sonos speakers). We use `peak` to set the threshold for noise detection, where 0 dB is very loud and -100 dB is low.
```yaml
binary_sensor:
- platform: ffmpeg_noise
input: rtsp://user:pw@my_input/video
extra_arguments: -filter:a highpass=f=300,lowpass=f=2500,volume=volume=2 -codec:a libmp3lame -ar 16000
output: -f mp3 icecast://stream_user:stream_pw@127.0.0.1:8000/babyphone.mp3
initial_state: false
duration: 2
reset: 60
peak: -32
```
We use the option `initial_state` to prevent the ffmpeg process from starting with Home-Assistant and only start it when needed. We use an `input_boolean` to control the state of ffmpeg services using the following automation.
```yaml
input_boolean:
babyphone:
name: babyphone
initial: off
automation:
- alias: 'Babyphone on'
trigger:
platform: state
entity_id: input_boolean.babyphone
from: 'off'
to: 'on'
action:
service: ffmpeg.start
entity_id: binary_sensor.ffmpeg_noise
- alias: 'Babyphone off'
trigger:
platform: state
entity_id: input_boolean.babyphone
from: 'on'
to: 'off'
action:
service: ffmpeg.stop
entity_id: binary_sensor.ffmpeg_noise
```
### <a class='title-link' name='trigger-a-alarm' href='#trigger-a-alarm'></a> Trigger a alarm
Now we can make a lot stuff. Here is a simple example of an automation what should be possible with Sonos speakers.
```yaml
automation:
- alias: 'Babyphone alarm on'
trigger:
platform: state
entity_id: binary_sensor.ffmpeg_noise
from: 'off'
to: 'on'
action:
- service: media_player.sonos_snapshot
entity_id: media_player.bedroom
- service: media_player.sonos_unjoin
entity_id: media_player.bedroom
- service: media_player.volume_set
entity_id: media_player.bedroom
data:
volume_level: 0.4
- service: media_player.play_media
entity_id: media_player.bedroom
data:
media_content_type: 'music'
media_content_id: http://my_ip_icecast:8000/babyphone.mp3
- service: light.turn_on:
entity_id:
- light.floor
- light.bedroom
data:
brightness: 150
- alias: 'Babyphone alarm off'
trigger:
platform: state
entity_id: binary_sensor.ffmpeg_noise
from: 'on'
to: 'off'
action:
- service: media_player.sonos_restore
entity_id: media_player.bedroom
- service: light.turn_off:
entity_id:
- light.floor
- light.bedroom
```
### <a class='title-link' name='thanks' href='#thanks'></a> Thanks
Special thanks to [arsaboo](https://github.com/arsaboo) for assistance in writing this blogpost.
]]></content>
</entry>
</feed>

View file

@ -1,271 +0,0 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Category: Babyphone - Home Assistant</title>
<meta name="author" content="Home Assistant">
<meta name="description" content="Category: Babyphone">
<meta name="viewport" content="width=device-width">
<link rel="canonical" href="https://home-assistant.io/blog/categories/babyphone/">
<meta property="fb:app_id" content="338291289691179">
<meta property="og:title" content="Category: Babyphone">
<meta property="og:site_name" content="Home Assistant">
<meta property="og:url" content="https://home-assistant.io/blog/categories/babyphone/">
<meta property="og:type" content="website">
<meta property="og:description" content="Category: Babyphone">
<meta property="og:image" content="https://home-assistant.io/images/default-social.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@home_assistant">
<meta name="twitter:title" content="Category: Babyphone">
<meta name="twitter:description" content="Category: Babyphone">
<meta name="twitter:image" content="https://home-assistant.io/images/default-social.png">
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet">
<link href="/atom.xml" rel="alternate" title="Home Assistant" type="application/atom+xml">
<link rel='shortcut icon' href='/images/favicon.ico' />
<link rel='icon' type='image/png' href='/images/favicon-192x192.png' sizes='192x192' />
</head>
<body >
<header>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item three-tenths lap-two-sixths palm-one-whole ha-title">
<a href="/" class="site-title">
<img width='40' src='/demo/favicon-192x192.png'>
<span>Home Assistant</span>
</a>
</div>
<div class="grid__item seven-tenths lap-four-sixths palm-one-whole">
<nav>
<input type="checkbox" id="toggle">
<label for="toggle" class="toggle" data-open="Main Menu" data-close="Close Menu"></label>
<ul class="menu pull-right">
<li><a href="/getting-started/">Getting started</a></li>
<li><a href="/components/">Components</a></li>
<li><a href="/ecosystem/">Ecosystem</a></li>
<li><a href="/cookbook/">Examples</a></li>
<li><a href="/developers/">Developers</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/help/">Need help?</a></li>
</ul>
</nav>
</div>
</div>
</div>
</header>
<div class="grid-wrapper">
<div class="grid grid-center">
<div class="grid__item two-thirds lap-one-whole palm-one-whole">
<article class="page">
<div class='edit-github'><a href='https://github.com/home-assistant/home-assistant.github.io/tree/current/source/blog/categories/babyphone/index.html'>Edit this page on GitHub</a></div>
<header>
<h1 class="title indent">
Category: Babyphone
</h1>
</header>
<hr class="divider">
<div id="archive-list">
<h2>2017</h2>
<article>
<div class="grid">
<div class="grid__item one-fifth palm-one-whole">
<time datetime="2017-02-03T23:00:00+00:00" pubdate>
<span class='month'>Feb</span> <span class='day'>03</span>
</time>
</div>
<div class="grid__item four-fifths palm-one-whole">
<h1 class="gamma"><a href="/blog/2017/02/03/babyphone/">Smart Baby Monitor</a></h1>
<footer class="meta">
<span>
<i class="icon-tags"></i>
<ul class="tags unstyled">
<li><a class='category' href='/blog/categories/babyphone/'>Babyphone</a></li>
<li><a class='category' href='/blog/categories/how-to/'>How-To</a></li>
</ul>
</span>
</footer>
<hr class="divider">
</div>
</div>
</article>
</div>
</article>
</div>
<aside id="sidebar" class="grid__item one-third lap-one-whole palm-one-whole">
<div class="grid">
<section class="aside-module grid__item one-whole lap-one-half">
<h1 class="title delta">About Home Assistant</h1>
<ul class="divided">
<li>
Home Assistant is an open-source home automation platform running on Python 3. Track and control all devices at home and automate control.
</li>
<li><a href='/getting-started/'>Get started with Home Assistant</a></li>
<li><a href='/demo/'>Try the online demo</a></li>
<li><a class="twitter-follow-button" href="https://twitter.com/Home_Assistant">Follow Home Assistant on Twitter</a></li>
<li><div class="fb-like" data-href="https://www.facebook.com/homeassistantio/" data-layout="standard" data-action="like" data-size="small" data-show-faces="true" data-share="false"></div></li>
</ul>
</section>
<div id="fb-root"></div>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.async=true;js.src='//platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
<script>(function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(d.getElementById(id)){return;}js=d.createElement(s);js.id=id;js.async=true;js.src="//connect.facebook.net/en_US/all.js#appId=338291289691179&xfbml=1";fjs.parentNode.insertBefore(js,fjs);}(document,'script','facebook-jssdk'));</script>
<section class="sharing aside-module grid__item one-whole lap-one-half">
<h1 class="title delta">Share this post</h1>
<a href="//twitter.com/share"
class="twitter-share-button"
data-via="home_assistant"
data-related="home_assistant"
data-url="https://home-assistant.io/blog/categories/babyphone/"
data-counturl="https://home-assistant.io/blog/categories/babyphone/" >Tweet</a>
<div class="fb-share-button" style='top: -6px;'
data-href="https://home-assistant.io/blog/categories/babyphone/"
data-layout="button_count">
</div>
<div class="g-plusone" data-size="standard"></div>
</section>
<script src="https://apis.google.com/js/platform.js" async defer></script>
<section id="recent-posts" class="aside-module grid__item one-whole lap-one-half">
<h1 class="title delta">Recent Posts</h1>
<ul class="divided">
<li class="post">
<a href="/blog/2017/02/03/babyphone/">Smart Baby Monitor</a>
</li>
<li class="post">
<a href="/blog/2017/01/28/face-coffee-wink/">0.37: Face detection, Coffee, Wink</a>
</li>
<li class="post">
<a href="/blog/2017/01/21/home-assistant-governance/">Home Assistant Governance [updated]</a>
</li>
<li class="post">
<a href="/blog/2017/01/18/numbers/">Numbers</a>
</li>
<li class="post">
<a href="/blog/2017/01/14/iss-usps-images-packages/">0.36: ISS, USPS, Image processing, Insteon</a>
</li>
</ul>
</section>
</div>
</aside>
</div>
</div>
<footer>
<div class="grid-wrapper">
<div class="grid">
<div class="grid__item">
<div class="copyright">
<a rel="me" href='https://twitter.com/home_assistant'><i class="icon-twitter"></i></a>
<a rel="me" href='https://facebook.com/homeassistantio'><i class="icon-facebook"></i></a>
<a rel="me" href='https://plus.google.com/110560654828510104551'><i class="icon-google-plus"></i></a>
<a rel="me" href='https://github.com/home-assistant/home-assistant'><i class="icon-github"></i></a>
<div class="credit">
Contact us at <a href='mailto:hello@home-assistant.io'>hello@home-assistant.io</a>.<br>
Website powered by <a href='http://jekyllrb.com/'>Jekyll</a> and the <a href='https://github.com/coogie/oscailte'>Oscalite theme</a>.<br />
Hosted by <a href='https://pages.github.com/'>GitHub</a> and served by <a href='https://cloudflare.com'>CloudFlare</a>.
</div>
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png" /></a><br /><span xmlns:dct="http://purl.org/dc/terms/" property="dct:title">home-assistant.io</span> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>.
</div>
</div>
</div>
</div>
</footer>
<script>
var _gaq=[['_setAccount','UA-57927901-1'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
<script>
var disqus_shortname = 'home-assistant';
var disqus_script = 'count.js';
(function () {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/' + disqus_script;
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
}());
</script>
</body>
</html>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: community | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/community/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/>
<updated>2017-02-04T09:07:32+00:00</updated>
<updated>2017-02-04T09:14:18+00:00</updated>
<id>https://home-assistant.io/</id>
<author>
<name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: Device-Tracking | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/device-tracking/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/>
<updated>2017-02-04T09:07:32+00:00</updated>
<updated>2017-02-04T09:14:18+00:00</updated>
<id>https://home-assistant.io/</id>
<author>
<name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: ESP8266 | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/esp8266/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/>
<updated>2017-02-04T09:07:32+00:00</updated>
<updated>2017-02-04T09:14:18+00:00</updated>
<id>https://home-assistant.io/</id>
<author>
<name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: How-To | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/how-to/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/>
<updated>2017-02-04T09:07:32+00:00</updated>
<updated>2017-02-04T09:14:18+00:00</updated>
<id>https://home-assistant.io/</id>
<author>
<name><![CDATA[Home Assistant]]></name>
@ -18,7 +18,7 @@
<link href="https://home-assistant.io/blog/2017/02/03/babyphone/"/>
<updated>2017-02-03T23:00:00+00:00</updated>
<id>https://home-assistant.io/blog/2017/02/03/babyphone</id>
<content type="html"><![CDATA[One of the hardest part of being a parent is keeping a constant eye on the baby to make sure that baby is doing well. Thus, it is not surprising that baby monitors are one of the fastest growing baby product category. However, many of the baby monitors available in the market are rather dumb and expect the parents to keep looking at the video stream or listen to the audio. This how-to will help you create a smart baby monitor on a budget and integrate it with Home-Assitant. Instead of relying on the poor quality baby monitor speakers, we use our existing speakers (e.g., Sonos). We can also send notifications (with pictures) to avoid constant monitoring of the feed.
<content type="html"><![CDATA[One of the hardest part of being a parent is keeping a constant eye on the baby to make sure that baby is doing well. Thus, it is not surprising that baby monitors are one of the fastest growing baby product category. However, many of the baby monitors available on the market are rather dumb and expect the parents to keep looking at the video stream or listen to the audio. This how-to will help you create a smart baby monitor on a budget and integrate it with Home Assitant. Instead of relying on the poor quality baby monitor speakers, we use our existing speakers (eg. Sonos). We can also send notifications (with pictures) to avoid constant monitoring of the feed.
Obviously, you can use the setup as a general purpose surveillance system to monitor noise in the whole house.
@ -26,15 +26,16 @@ Obviously, you can use the setup as a general purpose surveillance system to mon
### <a class='title-link' name='setup' href='#setup'></a> Setup
We need an IP-camera that can capture sound in the baby's room. It is also possible to use a Raspberry Pi with a microphone and send the audio to our Home-Assistant with `ffmpeg -f alsa -i hw:1,0 -vn -f rtp rtp://236.0.0.1:2000` over multicast. We can set `input` option on Home-Assistant side to `rtp://236.0.0.1:2000` in same network.
We need an IP camera that can capture sound in the baby's room. It is also possible to use a Raspberry Pi with a microphone and send the audio to Home Assistant with `ffmpeg -f alsa -i hw:1,0 -vn -f rtp rtp://236.0.0.1:2000` over multicast. We can set the `input` option on the Home Assistant side to `rtp://236.0.0.1:2000` in same network.
Next, we attach a ffmpeg noise binary sensor to our IP-camera. The sensor has an output `option` that allows us to send the output to icecast2 server for playing over speakers integrated with Home-Assistant (e.g., Sonos). We can use the binary sensor in our automation. You can ignore the icecast2 setup if you don't want to play the audio after the noise sensor trigger.
Next, we attach a FFmpeg noise binary sensor to our IP camera. The sensor has an output `option` that allows us to send the output to an [icecast2](http://icecast.org/) server for playing over speakers integrated with Home Assistant (eg. Sonos). We can use the binary sensor in our automation. You can ignore the icecast2 setup if you don't want to play the audio after the noise sensor trigger.
<p class='note'>
We change the platform name for binary sensor in 0.38 from `ffmpeg` to `ffmpeg_noise`. Also all service going to component and was rename from `binary_sensor.ffmpeg_xy` to `ffmpeg.xy`.
</p>
On Raspbian Jessie, you can setup [ffmpeg](/components/ffmpeg) and install a [icecast2](http://icecast.org/) server using:
On Raspbian Jessie, you can setup [FFmpeg](/components/ffmpeg) and install a [icecast2](http://icecast.org/) server using:
```bash
$ sudo echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list
$ sudo apt-get update
@ -43,6 +44,7 @@ $ sudo apt-get install icecast2
```
We setup a icecast mount point for our babyphone and update `/etc/icecast2/icecast.xml`:
```
<mount>
<mount-name>/babyphone.mp3</mount-name>
@ -53,23 +55,23 @@ We setup a icecast mount point for our babyphone and update `/etc/icecast2/iceca
</mount>
```
Now we can add the noise sensor to Home-Assistant. We can lower the sensitivity of the sensor (so that you are not inundated with notifications for every cough of the baby) to 2 seconds using the `duration` option. The sensor should wait 60 seconds before restoring and it prevent us that a wine break will triggering a new alarm.
Now we can add the noise sensor to Home Assistant. We can lower the sensitivity of the sensor (so that you are not inundated with notifications for every cough of the baby) to 2 seconds using the `duration` option. The sensor should wait 60 seconds before restoring and it prevent us that a wine break will triggering a new alarm.
We can optimize the audio stream for human voice by using a highpass filter with 300Hz and a lowpass filter with 2500Hz. This filters out all non-human sounds such as background noise. We can even add a volume amplifier if the microphone volume is too low (you can remove it from `extra_arguments`). For icecast2 we convert the audio stream to mp3 with samplerate of 16000 (which is the minimum for Sonos speakers). We use `peak` to set the threshold for noise detection, where 0 dB is very loud and -100 dB is low.
We can optimize the audio stream for human voice by using a highpass filter with 300 Hz and a lowpass filter with 2500 Hz. This filters out all non-human sounds such as background noise. We can even add a volume amplifier if the microphone volume is too low (you can remove it from `extra_arguments`). For icecast2 we convert the audio stream to mp3 with samplerate of 16000 (which is the minimum for Sonos speakers). We use `peak` to set the threshold for noise detection, where 0 dB is very loud and -100 dB is low.
```yaml
binary_sensor:
- platform: ffmpeg_noise
input: rtsp://user:pw@my_input/video
extra_arguments: -filter:a highpass=f=300,lowpass=f=2500,volume=volume=2 -codec:a libmp3lame -ar 16000
output: -f mp3 icecast://stream_user:stream_pw@127.0.0.1:8000/babyphone.mp3
initial_state: false
duration: 2
reset: 60
peak: -32
- platform: ffmpeg_noise
input: rtsp://user:pw@my_input/video
extra_arguments: -filter:a highpass=f=300,lowpass=f=2500,volume=volume=2 -codec:a libmp3lame -ar 16000
output: -f mp3 icecast://stream_user:stream_pw@127.0.0.1:8000/babyphone.mp3
initial_state: false
duration: 2
reset: 60
peak: -32
```
We use the option `initial_state` to prevent the ffmpeg process from starting with Home-Assistant and only start it when needed. We use an `input_boolean` to control the state of ffmpeg services using the following automation.
We use the option `initial_state` to prevent the FFmpeg process from starting with Home Assistant and only start it when needed. We use an `input_boolean` to control the state of FFmpeg services using the following automation.
```yaml
input_boolean:

View file

@ -116,8 +116,6 @@
<ul class="tags unstyled">
<li><a class='category' href='/blog/categories/babyphone/'>Babyphone</a></li>
<li><a class='category' href='/blog/categories/how-to/'>How-To</a></li>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: iBeacons | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/ibeacons/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/>
<updated>2017-02-04T09:07:32+00:00</updated>
<updated>2017-02-04T09:14:18+00:00</updated>
<id>https://home-assistant.io/</id>
<author>
<name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: Internet-of-Things | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/internet-of-things/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/>
<updated>2017-02-04T09:07:32+00:00</updated>
<updated>2017-02-04T09:14:18+00:00</updated>
<id>https://home-assistant.io/</id>
<author>
<name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: IoT-Data | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/iot-data/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/>
<updated>2017-02-04T09:07:32+00:00</updated>
<updated>2017-02-04T09:14:18+00:00</updated>
<id>https://home-assistant.io/</id>
<author>
<name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: Micropython | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/micropython/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/>
<updated>2017-02-04T09:07:32+00:00</updated>
<updated>2017-02-04T09:14:18+00:00</updated>
<id>https://home-assistant.io/</id>
<author>
<name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: MQTT | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/mqtt/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/>
<updated>2017-02-04T09:07:32+00:00</updated>
<updated>2017-02-04T09:14:18+00:00</updated>
<id>https://home-assistant.io/</id>
<author>
<name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: Organisation | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/organisation/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/>
<updated>2017-02-04T09:07:32+00:00</updated>
<updated>2017-02-04T09:14:18+00:00</updated>
<id>https://home-assistant.io/</id>
<author>
<name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: OwnTracks | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/owntracks/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/>
<updated>2017-02-04T09:07:32+00:00</updated>
<updated>2017-02-04T09:14:18+00:00</updated>
<id>https://home-assistant.io/</id>
<author>
<name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: Presence-Detection | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/presence-detection/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/>
<updated>2017-02-04T09:07:32+00:00</updated>
<updated>2017-02-04T09:14:18+00:00</updated>
<id>https://home-assistant.io/</id>
<author>
<name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: Public-Service-Announcement | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/public-service-announcement/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/>
<updated>2017-02-04T09:07:32+00:00</updated>
<updated>2017-02-04T09:14:18+00:00</updated>
<id>https://home-assistant.io/</id>
<author>
<name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: Release-Notes | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/release-notes/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/>
<updated>2017-02-04T09:07:32+00:00</updated>
<updated>2017-02-04T09:14:18+00:00</updated>
<id>https://home-assistant.io/</id>
<author>
<name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: Survey | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/survey/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/>
<updated>2017-02-04T09:07:32+00:00</updated>
<updated>2017-02-04T09:14:18+00:00</updated>
<id>https://home-assistant.io/</id>
<author>
<name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: Talks | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/talks/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/>
<updated>2017-02-04T09:07:32+00:00</updated>
<updated>2017-02-04T09:14:18+00:00</updated>
<id>https://home-assistant.io/</id>
<author>
<name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: Technology | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/technology/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/>
<updated>2017-02-04T09:07:32+00:00</updated>
<updated>2017-02-04T09:14:18+00:00</updated>
<id>https://home-assistant.io/</id>
<author>
<name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: User-Stories | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/user-stories/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/>
<updated>2017-02-04T09:07:32+00:00</updated>
<updated>2017-02-04T09:14:18+00:00</updated>
<id>https://home-assistant.io/</id>
<author>
<name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: Video | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/video/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/>
<updated>2017-02-04T09:07:32+00:00</updated>
<updated>2017-02-04T09:14:18+00:00</updated>
<id>https://home-assistant.io/</id>
<author>
<name><![CDATA[Home Assistant]]></name>

View file

@ -4,7 +4,7 @@
<title><![CDATA[Category: Website | Home Assistant]]></title>
<link href="https://home-assistant.io/blog/categories/website/atom.xml" rel="self"/>
<link href="https://home-assistant.io/"/>
<updated>2017-02-04T09:07:32+00:00</updated>
<updated>2017-02-04T09:14:18+00:00</updated>
<id>https://home-assistant.io/</id>
<author>
<name><![CDATA[Home Assistant]]></name>

View file

@ -97,8 +97,6 @@
<ul class="tags unstyled">
<li>Babyphone</li>
<li>How-To</li>
@ -115,7 +113,7 @@
<div class="entry-content clearfix">
<p>One of the hardest part of being a parent is keeping a constant eye on the baby to make sure that baby is doing well. Thus, it is not surprising that baby monitors are one of the fastest growing baby product category. However, many of the baby monitors available in the market are rather dumb and expect the parents to keep looking at the video stream or listen to the audio. This how-to will help you create a smart baby monitor on a budget and integrate it with Home-Assitant. Instead of relying on the poor quality baby monitor speakers, we use our existing speakers (e.g., Sonos). We can also send notifications (with pictures) to avoid constant monitoring of the feed.</p>
<p>One of the hardest part of being a parent is keeping a constant eye on the baby to make sure that baby is doing well. Thus, it is not surprising that baby monitors are one of the fastest growing baby product category. However, many of the baby monitors available on the market are rather dumb and expect the parents to keep looking at the video stream or listen to the audio. This how-to will help you create a smart baby monitor on a budget and integrate it with Home Assitant. Instead of relying on the poor quality baby monitor speakers, we use our existing speakers (eg. Sonos). We can also send notifications (with pictures) to avoid constant monitoring of the feed.</p>
<p>Obviously, you can use the setup as a general purpose surveillance system to monitor noise in the whole house.</p>
@ -1163,8 +1161,6 @@ You have to note:
<ul class="divided">
<li><a href="/blog/categories/babyphone/">Babyphone</a></li>
<li><a href="/blog/categories/community/">Community</a></li>
<li><a href="/blog/categories/device-tracking/">Device Tracking</a></li>

View file

@ -651,8 +651,6 @@ This article will try to explain how they all relate.</p>
<ul class="divided">
<li><a href="/blog/categories/babyphone/">Babyphone</a></li>
<li><a href="/blog/categories/community/">Community</a></li>
<li><a href="/blog/categories/device-tracking/">Device Tracking</a></li>

View file

@ -1583,8 +1583,6 @@ So, part 1 of <a href="/blog/2016/07/28/esp8266-and-micropython-part1/">ESP8266
<ul class="divided">
<li><a href="/blog/categories/babyphone/">Babyphone</a></li>
<li><a href="/blog/categories/community/">Community</a></li>
<li><a href="/blog/categories/device-tracking/">Device Tracking</a></li>

View file

@ -807,8 +807,6 @@ One of the graphs created with this tutorial.
<ul class="divided">
<li><a href="/blog/categories/babyphone/">Babyphone</a></li>
<li><a href="/blog/categories/community/">Community</a></li>
<li><a href="/blog/categories/device-tracking/">Device Tracking</a></li>

View file

@ -829,8 +829,6 @@ In the past month I was thinking about ways to integrate USB webcams into Home A
<ul class="divided">
<li><a href="/blog/categories/babyphone/">Babyphone</a></li>
<li><a href="/blog/categories/community/">Community</a></li>
<li><a href="/blog/categories/device-tracking/">Device Tracking</a></li>

View file

@ -767,8 +767,6 @@
<ul class="divided">
<li><a href="/blog/categories/babyphone/">Babyphone</a></li>
<li><a href="/blog/categories/community/">Community</a></li>
<li><a href="/blog/categories/device-tracking/">Device Tracking</a></li>

View file

@ -907,8 +907,6 @@ Example of the new views in the frontend. <a href="/components/group/">Learn mor
<ul class="divided">
<li><a href="/blog/categories/babyphone/">Babyphone</a></li>
<li><a href="/blog/categories/community/">Community</a></li>
<li><a href="/blog/categories/device-tracking/">Device Tracking</a></li>

View file

@ -667,8 +667,6 @@ The <a href="https://influxdb.com/">InfluxDB</a> database is a so-called time se
<ul class="divided">
<li><a href="/blog/categories/babyphone/">Babyphone</a></li>
<li><a href="/blog/categories/community/">Community</a></li>
<li><a href="/blog/categories/device-tracking/">Device Tracking</a></li>

View file

@ -732,8 +732,6 @@ Inspried by a <a href="https://github.com/home-assistant/home-assistant/issues/3
<ul class="divided">
<li><a href="/blog/categories/babyphone/">Babyphone</a></li>
<li><a href="/blog/categories/community/">Community</a></li>
<li><a href="/blog/categories/device-tracking/">Device Tracking</a></li>

View file

@ -759,8 +759,6 @@ An initial version of voice control for Home Assistant has landed. The current i
<ul class="divided">
<li><a href="/blog/categories/babyphone/">Babyphone</a></li>
<li><a href="/blog/categories/community/">Community</a></li>
<li><a href="/blog/categories/device-tracking/">Device Tracking</a></li>