Skip to content

Commit cd68e40

Browse files
authored
Merge pull request home-assistant#2909 from home-assistant/release-0.48
0.48
2 parents 43cc78e + 940e2b1 commit cd68e40

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1851
-185
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ source "https://rubygems.org"
33
group :development do
44
gem 'rake', '~> 10.0'
55
gem 'jekyll', '~> 3.0'
6-
gem 'pygments.rb', '~> 0.6.3'
6+
gem 'pygments.rb', '~> 1.1.2'
77
gem 'rdiscount', '~> 2.0'
88
gem 'RedCloth', '~> 4.2'
99
gem 'haml', '~> 4.0'

Gemfile.lock

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ GEM
4545
rb-inotify (~> 0.9, >= 0.9.7)
4646
mercenary (0.3.6)
4747
method_source (0.8.2)
48+
multi_json (1.12.1)
4849
octopress (3.0.11)
4950
jekyll (>= 2.0)
5051
mercenary (~> 0.3.2)
@@ -71,14 +72,12 @@ GEM
7172
jekyll (>= 2.0)
7273
pathutil (0.14.0)
7374
forwardable-extended (~> 2.6)
74-
posix-spawn (0.3.11)
7575
pry (0.10.4)
7676
coderay (~> 1.1.0)
7777
method_source (~> 0.8.1)
7878
slop (~> 3.4)
79-
pygments.rb (0.6.3)
80-
posix-spawn (~> 0.3.6)
81-
yajl-ruby (~> 1.2.0)
79+
pygments.rb (1.1.2)
80+
multi_json (>= 1.0.0)
8281
rack (1.6.4)
8382
rack-protection (1.5.3)
8483
rack
@@ -107,7 +106,6 @@ GEM
107106
ref
108107
tilt (2.0.5)
109108
titlecase (0.1.1)
110-
yajl-ruby (1.2.1)
111109

112110
PLATFORMS
113111
ruby
@@ -127,7 +125,7 @@ DEPENDENCIES
127125
octopress-filters
128126
octopress-include-tag
129127
pry
130-
pygments.rb (~> 0.6.3)
128+
pygments.rb (~> 1.1.2)
131129
rake (~> 10.0)
132130
rb-fsevent (~> 0.9)
133131
rdiscount (~> 2.0)
@@ -138,4 +136,4 @@ DEPENDENCIES
138136
therubyracer
139137

140138
BUNDLED WITH
141-
1.10.6
139+
1.14.6

_config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,13 @@ social:
142142

143143
# Home Assistant release details
144144
current_major_version: 0
145-
current_minor_version: 47
146-
current_patch_version: 1
147-
date_released: 2017-06-21
145+
current_minor_version: 48
146+
current_patch_version: 0
147+
date_released: 2017-07-02
148148

149149
# Either # or the anchor link to latest release notes in the blog post.
150150
# Must be prefixed with a # and have double quotes around it.
151151
# Major release:
152-
patch_version_notes: "#release-0471---june-21"
152+
patch_version_notes: "#"
153153
# Minor release (Example #release-0431---april-25):
154154

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
---
2+
layout: page
3+
title: "RFXtrx Binary Sensor"
4+
description: "Instructions how to integrate RFXtrx binary sensors into Home Assistant."
5+
date: 2017-03-26 12:45
6+
sidebar: true
7+
comments: false
8+
sharing: true
9+
footer: true
10+
logo: rfxtrx.png
11+
ha_category: Binary Sensor
12+
---
13+
14+
The `rfxtrx` platform support binary sensors that communicate in the frequency range of 433.92 MHz. The rfxtrx binary sensor component provides support for them.
15+
16+
Many cheap sensors available on the web today are based on a particular RF chip called *PT-2262*. Depending on the running firmware on the RFXcom box, some of them may be recognized under the X10 protocol but most of them are recognized under the *Lighting4* protocol. The rfxtrx binary sensor component provides some special options for them, while other rfxtrx protocols should work too.
17+
18+
# Setting up your devices
19+
Once you have set up your [rfxtrx hub](/components/rfxtrx/), the easiest way to find your binary sensors is to add this to your `configuration.yaml`:
20+
21+
```yaml
22+
# Example configuration.yaml entry
23+
binary_sensor:
24+
platform: rfxtrx
25+
automatic_add: True
26+
```
27+
28+
Open your local home-assistant web UI and go to the "states" page. Then make sure to trigger your sensor. You should see a new entity appear in the *Current entites* list, starting with "binary_sensor." and some hexadecimal digits. Those hexadecimal digits are your device id.
29+
30+
For example: "binary_sensor.0913000022670e013b70". Here your device id is `0913000022670e013b70`. Then you should update your configuration to:
31+
32+
```yaml
33+
# Example configuration.yaml entry
34+
binary_sensor:
35+
platform: rfxtrx
36+
devices:
37+
0913000022670e013b70:
38+
name: device_name
39+
```
40+
41+
Do not forget to tweak the configuration variables:
42+
43+
- **automatic_add** (*Optional*): To enable the automatic addition of new binary sensors.
44+
- **device_class** (*Optional*): The [type or class of the sensor](/components/binary_sensor/) to set the icon in the frontend.
45+
- **off_delay** (*Optional*): For sensors that only sends 'On' state updates, this variable sets a delay after which the sensor state will be updated back to 'Off'.
46+
47+
48+
Binary sensors have only two states - "on" and "off". Many door or window opening sensors will send a signal each time the door/window is open or closed. However, depending on their hardware or on their purpose, some sensors are only able to signal their "on" state:
49+
50+
- Most motion sensors send a signal each time they detect motion. They stay "on" for a few seconds and go back to sleep, ready to signal other motion events. Usually, they do not send a signal when they go back to sleep.
51+
- Some doorbells may also only send "on" signals when their toggle switch is pressed, but no "off" signal when the switch is released.
52+
53+
For those devices, use the *off_delay* parameter. It defines a delay after which a device will go back to an "Off" state. That "Off" state will be fired internally by Home Assistant, just as if the device fired it by itself. If a motion sensor can only send signals once every 5 seconds, sets the *off_delay* parameter to *seconds: 5*.
54+
55+
56+
Example configuration:
57+
58+
```yaml
59+
# Example configuration.yaml entry
60+
binary_sensor:
61+
platform: rfxtrx
62+
automatic_add: True
63+
devices:
64+
091300006ca2c6001080:
65+
name: motion_hall
66+
device_class: motion
67+
off_delay:
68+
seconds: 5
69+
```
70+
71+
## Options for PT-2262 devices under the Lighting4 protocol
72+
73+
When a data packet is transmitted by a PT-2262 device using the Lighting4 protocol, there is no way to automatically extract the device identifier and the command from the packet. Each device has its own id/command length combination and the fields lengths are not included in the data. One device that sends 2 different commands will be seen as 2 devices on Home Assistant. For sur cases, the following options are available in order to circumvent the problem:
74+
75+
- **data_bits** (*Optional*): Defines how many bits are used for commands inside the data packets sent by the device.
76+
- **command_on** (*Optional*): Defines the data bits value that is sent by the device upon an 'On' command.
77+
- **command_off** (*Optional*): Defines the data bits value that is sent by the device upon an 'Off' command.
78+
79+
Let's try to add a new PT-2262 sensor using the "automatic_add" option and have a look at Home Assistant system log.
80+
81+
Have your sensor trigger the "On" state for the first time. Some messages will appear:
82+
83+
```
84+
INFO (Thread-6) [homeassistant.components.binary_sensor.rfxtrx] Added binary sensor 0913000022670e013970 (Device_id: 22670e Class: LightingDevice Sub: 0)
85+
```
86+
87+
Here the sensor has the id *22670e*.
88+
89+
Now have your sensor trigger the "Off" state and look for the following message in the Home Assistant log. You should see that your device has been detected as a *new* device when triggering its "Off" state:
90+
91+
```
92+
INFO (Thread-6) [homeassistant.components.binary_sensor.rfxtrx] Added binary sensor 09130000226707013d70 (Device_id: 226707 Class: LightingDevice Sub: 0)
93+
```
94+
95+
Here the device id is *226707*, which is almost similar to the *22670e* we had on the "On" event a few seconds ago.
96+
97+
From those two values, you can guess that the actual id of your device is *22670*, and that *e* and *7* are commands for "On" and "Off" states respectively. As one hexadecimal digit uses 4 bits, we can conclude that the device is using 4 data bits.
98+
99+
So here is the actual configuration section for the binary sensor:
100+
101+
```yaml
102+
platform: rfxtrx
103+
automatic_add: True
104+
devices:
105+
0913000022670e013b70:
106+
name: window_room2
107+
device_class: opening
108+
data_bits: 4
109+
command_on: 0xe
110+
command_off: 0x7
111+
```
112+
113+
The *automatic_add* option makes the rfxtrx binary sensor component calculate and display the configuration options for you in the Home Assistant logs:
114+
115+
```
116+
INFO (Thread-6) [homeassistant.components.rfxtrx] rfxtrx: found possible device 226707 for 22670e with the following configuration:
117+
data_bits=4
118+
command_on=0xe
119+
command_off=0x7
120+
INFO (Thread-6) [homeassistant.components.binary_sensor.rfxtrx] Found possible matching deviceid 22670e.
121+
```
122+
123+
This automatic guess should work most of the time but there is no guarantee on that. You should activate it only when you want
124+
to configure your new devices and leave it off otherwise.
125+
126+
## Known working devices
127+
128+
The following devices are known to work with the rfxtrx binary sensor component. There are too many other to list.
129+
130+
- Motion detectors:
131+
- Kerui P817 and P829.
132+
- Chuango PIR-700.
133+
134+
- Door / window sensors:
135+
- Kerui D026 door / window sensor: can trigger on "open" and "close". Has a temper switch.
136+
- Nexa LMST-606 Magnetic contact switch.

source/_components/binary_sensor.template.markdown

Lines changed: 50 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,36 +56,40 @@ sensor:
5656
Some movement sensors and door/window sensors will appear as a switch. By using a template binary sensor, the switch can be displayed as a binary sensors. The original switch can then be hidden by [customizing.](/getting-started/customizing-devices/)
5757

5858
```yaml
59-
binary_sensor:
60-
- platform: template
59+
binary_sensor:
60+
- platform: template
6161
sensors:
6262
movement:
6363
value_template: {% raw %}"{{ states.switch.movement.state == 'on' }}"{% endraw %}
6464
device_class: motion
6565
door:
66-
value_template: {% raw %}"{{ states.switch.door.state == 'on' }}"{% endraw %}
66+
value_template: {% raw %}"{{ states.switch.door.state == 'on' }}"{% endraw %}
6767
device_class: opening
6868
```
6969

7070

7171
### {% linkable_title Combining multiple sensors, and using entity_id: %}
7272

73-
This example combines multiple CO sensors into a single overall status. It also shows how to use `entity_id`
73+
This example combines multiple CO sensors into a single overall
74+
status. When using templates with binary sensors, you need to return
75+
`True` or `False` explicitly. `entity_id` is used to limit which
76+
sensors are being monitored to update the state, making computing this
77+
sensor far more efficient.
7478

7579
```yaml
76-
binary_sensor:
77-
- platform: template
80+
binary_sensor:
81+
- platform: template
7882
sensors:
7983
co:
8084
friendly_name: 'CO'
8185
device_class: 'gas'
8286
value_template: {% raw %}>-
83-
{%- if is_state("sensor.bedroom_co_status", "Ok")
87+
{%- if is_state("sensor.bedroom_co_status", "Ok")
8488
and is_state("sensor.kitchen_co_status", "Ok")
8589
and is_state("sensor.wardrobe_co_status", "Ok") -%}
86-
Off
90+
False
8791
{%- else -%}
88-
On
92+
True
8993
{%- endif %}{% endraw %}
9094
entity_id:
9195
- sensor.bedroom_co_status
@@ -104,5 +108,41 @@ sensor:
104108
friendly_name: 'Day/Night'
105109
value_template: {% raw %}'{% if is_state("sun.sun", "above_horizon") %}Day{% else %}Night{% endif %}'{% endraw %}
106110
icon_template: {% raw %}'{% if is_state("sun.sun", "above_horizon") %}mdi:weather-sunny{% else %}mdi:weather-night{% endif %}'{% endraw %}
107-
111+
```
112+
113+
### {% linkable_title Is anyone home? %}
114+
115+
This example is determining if anyone is home based on the combination
116+
of device tracking and motion sensors. It's extremely useful if you
117+
have kids / baby sitter / grand parrents who might still be in your
118+
house that aren't represented by a trackable device in home
119+
assistant. This is providing a composite of wifi based device tracking
120+
and z-wave multisensor presence sensors.
121+
122+
```yaml
123+
binary_sensor:
124+
- platform: template
125+
sensors:
126+
people_home:
127+
value_template: {% raw %}>-
128+
{%- if is_state("device_tracker.sean", "home")
129+
or is_state("device_tracker.susan", "home")
130+
or is_state("binary_sensor.office_124", "on")
131+
or is_state("binary_sensor.hallway_134", "on")
132+
or is_state("binary_sensor.living_room_139", "on")
133+
or is_state("binary_sensor.porch_ms6_1_129", "on")
134+
or is_state("binary_sensor.family_room_144", "on")
135+
-%}
136+
True
137+
{%- else -%}
138+
False
139+
{%- endif %}{% endraw %}
140+
entity_id:
141+
- device_tracker.sean
142+
- device_tracker.susan
143+
- binary_sensor.office_124
144+
- binary_sensor.hallway_134
145+
- binary_sensor.living_room_139
146+
- binary_sensor.porch_ms6_1_129
147+
- binary_sensor.family_room_144
108148
```
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
layout: page
3+
title: "Verisure Binary Sensor"
4+
description: "Instructions how to integrate Verisure binary sensors into Home Assistant."
5+
date: 2016-02-23 21:31 +0100
6+
sidebar: true
7+
comments: false
8+
sharing: true
9+
footer: true
10+
logo: verisure.png
11+
ha_category: Binary Sensor
12+
ha_iot_class: "Cloud Polling"
13+
---
14+
15+
Integrates Verisure binary sensors into Home Assistant. See the [main component](/components/verisure/) for configuration instructions.

source/_components/camera.generic.markdown

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Configuration variables:
3535
- **password** (*Optional*): The password for accessing your camera.
3636
- **authentication** (*Optional*): Type for authenticating the requests `basic` (default) or `digest`.
3737
- **limit_refetch_to_url_change** (*Optional*): True/false value (default: false). Limits refetching of the remote image to when the url changes. Only relevant if using a template to fetch the remote image.
38+
- **content_type** (*Optional*): Set the content type for the IP camera if it is not a jpg file (default: `image/jpeg`). Use `image/svg+xml` to add a dynamic svg file.
3839

3940
<p class='img'>
4041
<a href='/cookbook/google_maps_card/'>
@@ -43,3 +44,16 @@ Configuration variables:
4344
</a>
4445
</p>
4546

47+
## {% linkable_title Examples %}
48+
49+
In this section you find some real life examples of how to use this camera platform.
50+
51+
### {% linkable_title Weather graph from yr.no %}
52+
53+
```yaml
54+
camera:
55+
- platform: generic
56+
name: Weather
57+
still_image_url: https://www.yr.no/place/Norway/Oslo/Oslo/Oslo/meteogram.svg
58+
content_type: 'image/svg+xml'
59+
```

0 commit comments

Comments
 (0)