Skip to content

Commit 07a785f

Browse files
committed
finish
1 parent a4cb2b8 commit 07a785f

File tree

1 file changed

+56
-8
lines changed

1 file changed

+56
-8
lines changed

source/_posts/2017-02-04-babyphone.markdown

Lines changed: 56 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
layout: post
3-
title: "Baby monitoring"
4-
description: "Make your Home fit for baby monitoring."
5-
date: 2016-07-28 06:00:00 +0200
6-
date_formatted: "July 28, 2016"
3+
title: "Smart Baby Monitor"
4+
description: "How to build your own smart baby monitor"
5+
date: 2017-02-04 00:00:00 +0100
6+
date_formatted: "February 4, 2017"
77
author: Pascal Vizeli
88
comments: true
99
categories: How-To Babyphone
@@ -18,7 +18,7 @@ Obviously, you can use the setup as a general purpose surveillance system to mon
1818

1919
### {% linkable_title Setup %}
2020

21-
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.
21+
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.
2222

2323
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.
2424

@@ -63,7 +63,7 @@ binary_sensor:
6363
6464
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.
6565

66-
```
66+
```yaml
6767
input_boolean:
6868
babyphone:
6969
name: babyphone
@@ -79,6 +79,7 @@ automation:
7979
action:
8080
service: ffmpeg.start
8181
entity_id: binary_sensor.ffmpeg_noise
82+
8283
- alias: 'Babyphone off'
8384
trigger:
8485
platform: state
@@ -90,7 +91,54 @@ automation:
9091
entity_id: binary_sensor.ffmpeg_noise
9192
```
9293

94+
### {% linkable_title Trigger a alarm %}
95+
96+
Now we can make a lot stuff. Here is a simple example of an automation what should be possible with Sonos speakers.
97+
98+
```yaml
99+
automation:
100+
- alias: 'Babyphone alarm on'
101+
trigger:
102+
platform: state
103+
entity_id: binary_sensor.ffmpeg_noise
104+
from: 'off'
105+
to: 'on'
106+
action:
107+
- service: media_player.sonos_snapshot
108+
entity_id: media_player.bedroom
109+
- service: media_player.sonos_unjoin
110+
entity_id: media_player.bedroom
111+
- service: media_player.volume_set
112+
entity_id: media_player.bedroom
113+
data:
114+
volume_level: 0.4
115+
- service: media_player.play_media
116+
entity_id: media_player.bedroom
117+
data:
118+
media_content_type: 'music'
119+
media_content_id: http://my_ip_icecast:8000/babyphone.mp3
120+
- service: light.turn_on:
121+
entity_id:
122+
- light.floor
123+
- light.bedroom
124+
data:
125+
brightness: 150
126+
127+
- alias: 'Babyphone alarm off'
128+
trigger:
129+
platform: state
130+
entity_id: binary_sensor.ffmpeg_noise
131+
from: 'on'
132+
to: 'off'
133+
action:
134+
- service: media_player.sonos_restore
135+
entity_id: media_player.bedroom
136+
- service: light.turn_off:
137+
entity_id:
138+
- light.floor
139+
- light.bedroom
140+
```
141+
93142
### {% linkable_title Thanks %}
94143

95-
Special thanks for support to write this blogpost going to:
96-
- [arsaboo](https://github.com/arsaboo)
144+
Special thanks to [arsaboo](https://github.com/arsaboo) for assistance in writing this blogpost.

0 commit comments

Comments
 (0)