Skip to content

Add cookbook with automation example using time interval and input boolean #195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 41 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
80570a2
Merge pull request #176 from balloob/next
balloob Jan 30, 2016
6382da9
Fix template
fabaff Jan 30, 2016
155e400
Hide edit on github on frontpage and component page
balloob Jan 30, 2016
223ee09
Update page title of demo
balloob Jan 30, 2016
885c1ec
Add API key info to Insteon Hub
Jan 31, 2016
381983d
Merge pull request #177 from haraldnagel/master
balloob Jan 31, 2016
aab861b
Update device_tracker.fritz.markdown
cyberjunky Jan 31, 2016
6f86a15
Merge pull request #179 from cyberjunky/patch-1
balloob Jan 31, 2016
7a14099
Fixed examples of nest sensor/binary sensor
turnrye Jan 31, 2016
d85cbde
Merge pull request #180 from ryanturner/master
balloob Jan 31, 2016
75a74e6
Add Z-Wave entity id to breaking changes
balloob Feb 1, 2016
4f1cefd
Add additional example
fabaff Jan 30, 2016
448cd1e
Fix link
fabaff Jan 30, 2016
3212408
Make the samples more copy-and-past friendly
fabaff Feb 1, 2016
cc61c25
Add sample
fabaff Feb 1, 2016
6eb1c82
Add initial mqtt notification page
fabaff Feb 1, 2016
0580743
Add screenshot
fabaff Feb 1, 2016
6b572a5
corrected configuration typo
Feb 2, 2016
73c2907
Merge pull request #183 from jbags81/patch-1
balloob Feb 2, 2016
4a0d2c3
Add some details
fabaff Feb 1, 2016
68a35bb
Minor update
fabaff Feb 1, 2016
434dd95
Fix link
fabaff Feb 2, 2016
9374478
Again the link
fabaff Feb 2, 2016
b590908
Update creating_components.markdown
Feb 3, 2016
dd363e8
Merge pull request #185 from Mokilok/patch-2
balloob Feb 3, 2016
4f3c011
Fix sentence
fabaff Feb 3, 2016
85bae8d
Add http binary sensor docs
fabaff Feb 5, 2016
567840e
Capitalize titles and other minor update
fabaff Feb 6, 2016
117a413
Add http sensor docs
fabaff Feb 6, 2016
8efd0e7
Move some parts to http component docs
fabaff Feb 6, 2016
f85ff0a
Add details about sensors
fabaff Feb 6, 2016
1a4159e
Update title
fabaff Feb 6, 2016
856a23a
Update title
fabaff Feb 6, 2016
c5aaa22
Update note
fabaff Feb 6, 2016
2d47cd7
Merge pull request #191 from fabaff/http
fabaff Feb 6, 2016
1db6e1f
Add more complex sensor.template example.
pavoni Feb 6, 2016
550ee46
Add a number comparison to the example.
pavoni Feb 7, 2016
06b3bf7
Merge pull request #193 from pavoni/add_extra_template_sensor
balloob Feb 7, 2016
967dea3
Add history endpoint
fabaff Feb 7, 2016
d2a66e6
Fix typo and add link to API
fabaff Feb 7, 2016
6542aa4
Create automation_using_timeinterval_inputboolean.markdown
Feb 7, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions sass/custom/_paulus.scss
Original file line number Diff line number Diff line change
Expand Up @@ -403,4 +403,6 @@ p.note {

.edit-github {
text-align: right;
margin-bottom: 8px;
font-size: .8em;
}
1 change: 1 addition & 0 deletions source/_components/alarm_control_panel.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ footer: true

Home Assistant can give you an interface with is similar to a classic alarm system. There are several panels supported:

- [Alarm.com](/components/alarm_control_panel.alarmdotcom/)
- [Manual](/components/alarm_control_panel.manual/)
- [MQTT](/components/alarm_control_panel.mqtt/)
- [Verisure](/components/verisure/)
Expand Down
2 changes: 1 addition & 1 deletion source/_components/arduino.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The [Arduino](https://www.arduino.cc/) device family are microcontroller boards

There are a lot of extensions (so called [shields](https://www.arduino.cc/en/Main/ArduinoShields)) available. Those shields can be plugged-in into the existing connectors and stacked on top of each other. This makes it possible to expand the capabilities of the Arduino boards.

The arduino component is designed to let you use a directly attached board to your Home Assistant host over USB.
The `arduino` component is designed to let you use a directly attached board to your Home Assistant host over USB.

You need to have the [Firmata firmware](https://github.com/firmata/) on your board. Please upload the `StandardFirmata` sketch to your board, please refer to the [Arduino documentation](https://www.arduino.cc/en/Main/Howto) for further information.

Expand Down
4 changes: 2 additions & 2 deletions source/_components/binary_sensor.arest.markdown
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: component
title: "aREST binary sensor"
title: "aREST Binary Sensor"
description: "Instructions how to integrate aREST binary sensors within Home Assistant."
date: 2015-11-20 18:15
sidebar: true
Expand All @@ -12,7 +12,7 @@ ha_category: Binary Sensor
---


The arest binary sensor platform allows you to get all data from your devices (like Arduinos with a ethernet/wifi connection, the ESP8266, and the Raspberry Pi) running the [aREST](http://arest.io/) RESTful framework.
The `arest` binary sensor platform allows you to get all data from your devices (like Arduinos with a ethernet/wifi connection, the ESP8266, and the Raspberry Pi) running the [aREST](http://arest.io/) RESTful framework.

To use your aREST binary sensor in your installation, add the following to your `configuration.yaml` file:

Expand Down
2 changes: 1 addition & 1 deletion source/_components/binary_sensor.command.markdown
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: component
title: "Command line binary sensor"
title: "Command line Binary Sensor"
description: "Instructions how to integrate Command binary sensors within Home Assistant."
date: 2016-01-13 12:15
sidebar: true
Expand Down
78 changes: 78 additions & 0 deletions source/_components/binary_sensor.http.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
layout: component
title: "HTTP Binary Sensor"
description: "Instructions how to integrate HTTP binary sensors within Home Assistant."
date: 2016-02-05 12:15
sidebar: true
comments: false
sharing: true
footer: true
logo: http.png
ha_category: Binary Sensor
---

The URL for a binary sensor looks like the example below:

```bash
http://IP_ADDRESS:8123/api/states/binary_sensor.DEVICE_NAME
```

<p class='note'>
You should choose a unique device name (DEVICE_NAME) to avoid clashes with other devices.
</p>

The JSON payload must contain the new state and can have a friendly name. The friendly name is used in the frontend to name the sensor.

```json
{"state": "on", "attributes": {"friendly_name": "Radio"}}
```

For a quick test `curl` can be useful to "simulate" a device.

```bash
$ curl -X POST -H "x-ha-access: YOUR_PASSWORD" \
-d '{"state": "off", "attributes": {"friendly_name": "Radio"}}' \
http://localhost:8123/api/states/binary_sensor.radio
```

To check if the sensor is working, use again `curl` to retrieve the [current state](/developers/rest_api/#get-apistatesltentity_id).

```bash
$ curl -X GET -H "x-ha-access: YOUR_PASSWORD" \
http://localhost:8123/api/states/binary_sensor.radio
{
"attributes": {
"friendly_name": "Radio"
},
"entity_id": "binary_sensor.radio",
"last_changed": "16:45:51 05-02-2016",
"last_updated": "16:45:51 05-02-2016",
"state": "off"
}
```

## {% linkable_title Examples %}

In this section you find some real life examples of how to use this sensor. Beside `curl`.

### {% linkable_title Using Python request module %}

As already shown on the [API](/developers/rest_api/) page, it's very simple to use Python and the [Requests](http://docs.python-requests.org/en/latest/) module for the interaction with Home Assistant.

```python
response = requests.post(
'http://localhost:8123/api/states/binary_sensor.radio',
headers={'x-ha-access': 'YOUR_PASSWORD', 'content-type': 'application/json'},
data=json.dumps({'state': 'on', 'attributes': {'friendly_name': 'Radio'}}))
print(response.text)
```

### {% linkable_title Using `httpie` %}

[`httpie`](https://github.com/jkbrzt/httpie) is a user-friendly CLI HTTP client.

```bash
$ http -v POST http://localhost:8123/api/states/binary_sensor.radio \
x-ha-access:YOUR_PASSWORD state=off \
attributes:='{"friendly_name": "Radio"}'
```
2 changes: 1 addition & 1 deletion source/_components/binary_sensor.mqtt.markdown
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: component
title: "MQTT binary sensor"
title: "MQTT Binary Sensor"
description: "Instructions how to integrate MQTT binary sensors within Home Assistant."
date: 2015-05-30 23:21
sidebar: true
Expand Down
29 changes: 19 additions & 10 deletions source/_components/binary_sensor.nest.markdown
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: component
title: "Nest binary sensor"
title: "Nest Binary Sensor"
description: "Instructions how to integrate Nest binary sensors within Home Assistant."
date: 2016-01-26 08:00
sidebar: true
Expand All @@ -12,7 +12,7 @@ ha_category: Binary Sensor
---


The Nest binary sensor platform let you monitor various states of a thermostat from [Nest](https://nest.com).
The `nest` binary sensor platform let you monitor various states of a thermostat from [Nest](https://nest.com).

To set it up, add the following information to your `configuration.yaml` file:

Expand All @@ -21,18 +21,27 @@ sensor:
platform: nest
monitored_conditions:
- 'fan'
- 'hvac_ac_state',
- 'hvac_aux_heater_state',
- 'hvac_heat_x2_state',
- 'hvac_heat_x3_state',
- 'hvac_alt_heat_state',
- 'hvac_alt_heat_x2_state',
- 'hvac_emer_heat_state',
- 'hvac_ac_state'
- 'hvac_aux_heater_state'
- 'hvac_heat_x2_state'
- 'hvac_heat_x3_state'
- 'hvac_alt_heat_state'
- 'hvac_alt_heat_x2_state'
- 'hvac_emer_heat_state'
- 'online'
```

Configuration variables:

- **monitored_conditions** array (*Required*): States to monitor.
- 'fan'
- 'hvac_ac_state'
- 'hvac_aux_heater_state'
- 'hvac_heat_x2_state'
- 'hvac_heat_x3_state'
- 'hvac_alt_heat_state'
- 'hvac_alt_heat_x2_state'
- 'hvac_emer_heat_state'
- 'online'

<p class='note'>You must have the [Nest component](https://home-assistant.io/components/nest/) configured to use this sensor.</p>
<p class='note'>You must have the [Nest component](/components/nest/) configured to use this sensor.</p>
2 changes: 1 addition & 1 deletion source/_components/binary_sensor.rest.markdown
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: component
title: "RESTful binary sensor"
title: "RESTful Binary Sensor"
description: "Instructions how to integrate REST binary sensors into Home Assistant."
date: 2015-12-17 19:10
sidebar: true
Expand Down
4 changes: 2 additions & 2 deletions source/_components/binary_sensor.rpi_gpio.markdown
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: component
title: "Raspberry PI GPIO sensor"
title: "Raspberry PI GPIO Binary Sensor"
description: "Instructions how to integrate the GPIO sensor capability of a Raspberry PI into Home Assistant."
date: 2015-08-30 19:00
sidebar: true
Expand All @@ -12,7 +12,7 @@ ha_category: Sensor
---


The rpi_gpio binary sensor platform allows you to read sensor values of the GPIOs of your [Raspberry Pi](https://www.raspberrypi.org/).
The `rpi_gpio` binary sensor platform allows you to read sensor values of the GPIOs of your [Raspberry Pi](https://www.raspberrypi.org/).

To use your Raspberry Pi's GPIO in your installation, add the following to your `configuration.yaml` file:

Expand Down
2 changes: 1 addition & 1 deletion source/_components/binary_sensor.zigbee.markdown
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: component
title: ZigBee Binary Sensor
title: "ZigBee Binary Sensor"
description: "Instructions on how to set up ZigBee binary sensors within Home Assistant."
date: 2016-01-28 12:38
sidebar: true
Expand Down
4 changes: 2 additions & 2 deletions source/_components/camera.foscam.markdown
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: component
title: "Foscam IP camera"
title: "Foscam IP Camera"
description: "Instructions how to integrate Foscam IP cameras within Home Assistant."
date: 2015-09-17 08:01
sidebar: true
Expand All @@ -12,7 +12,7 @@ ha_category: Camera
---


The foscam platform allows you to watch the live stream of your [Foscam](http://www.foscam.com/) IP camera in Home Assistant.
The `foscam` platform allows you to watch the live stream of your [Foscam](http://www.foscam.com/) IP camera in Home Assistant.

To enable your Foscam IP camera in your installation, add the following to your `configuration.yaml` file:

Expand Down
2 changes: 1 addition & 1 deletion source/_components/camera.mjpeg.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ha_category: Camera
---


The mjpeg component allows you to integrate IP cameras which are capable to stream their video with MJPEG into Home Assistant.
The `mjpeg` component allows you to integrate IP cameras which are capable to stream their video with MJPEG into Home Assistant.

To enable this sensor in your installation, add the following to your `configuration.yaml` file:

Expand Down
2 changes: 1 addition & 1 deletion source/_components/device_tracker.fritz.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ To use an Fritz!Box router in your installation, add the following to your `conf
```yaml
# Example configuration.yaml entry
device_tracker:
platform: asuswrt
platform: fritz
host: YOUR_ROUTER_IP
username: YOUR_ADMIN_USERNAME
password: YOUR_ADMIN_PASSWORD
Expand Down
2 changes: 1 addition & 1 deletion source/_components/device_tracker.mqtt.markdown
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: component
title: "MQTT device tracker"
title: "MQTT Device Tracker"
description: "Instructions how to use MQTT to track devices in Home Assistant."
date: 2015-09-19 20:41
sidebar: true
Expand Down
24 changes: 14 additions & 10 deletions source/_components/history.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,22 @@ history:
</p>

<p class='note'>
Events are saved in a local database. Google Graphs is used to draw the graph. Drawing is happening 100% in your browser - no data is transferred to anyone at any time.
Events are saved in a local database. Google Graphs is used to draw the graph. Drawing is happening 100% in your browser. No data is transferred to anyone at any time.
</p>

#### {% linkable_title Implementation details %}

The history is stored in a SQLite databse `home-assistant.db` within your config directory.
The history is stored in a SQLite database `home-assistant.db` within your config directory.

- events table is all events except time_changed that happened while recorder component was running.
- states table contains all the new_state values of state_changed events.
- events table is all events except `time_changed` that happened while recorder component was running.
- states table contains all the `new_state` values of `state_changed` events.
- Inside the states table you have:
- entity_id: the entity_id of the entity
- state: the state of the entity
- attributes: JSON of the state attributes
- last_changed: timestamp last time the state has changed. A state_changed event can happen when just attributes change.
- last_updated: timestamp anything has changed (state, attributes)
- created: timestamp this entry was inserted into the database
- `entity_id`: the entity_id of the entity
- `state`: the state of the entity
- `attributes`: JSON of the state attributes
- `last_changed`: timestamp last time the state has changed. A state_changed event can happen when just attributes change.
- `last_updated`: timestamp anything has changed (state, attributes)
- `created`: timestamp this entry was inserted into the database

When the history component queries the states table it only selects states where the state has changed: `WHERE last_changed=last_updated`

Expand All @@ -55,3 +55,7 @@ SQLite databases do not support native dates. That's why all the dates are saved
from datetime import datetime
datetime.fromtimestamp(1422830502)
```

#### {% linkable_title API %}

The history information are also available through the [RESTful API](/developers/rest_api/#get-apihistory).
9 changes: 8 additions & 1 deletion source/_components/http.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,16 @@ http:

Configuration variables:

- **api_password** (*Optional*): Protect Home Assistant with a password
- **api_password** (*Optional*): Protect Home Assistant with a password.
- **server_port** (*Optional*): Let you set a port to use. Defaults to 8123.
- **development** (*Optional*): Disable caching and load unvulcanized assets. Useful for Frontend development.
- **ssl_certificate** (*Optional*): Path to your TLS/SSL certificate to serve Home Assistant over a secure connection.
- **ssl_key** (*Optional*): Path to your TLS/SSL key to serve Home Assistant over a secure connection.

On top of the `http` component is a [REST API](/developers/rest_api/) and a [Python API](/developers/python_api/) available.

The `http` platforms are not a real platform within the meaning of the terminology used around Home Assistant. Home Assistant's [REST API](/developers/rest_api/) is consuming and proceeding messages received over HTTP.

To use those kind of sensors in your installation no configuration in Home Assistant is needed. All configuration is done on the devices themselves. This means that you must be able to edit the target URL or endpoint and the payload. The entity will be created after the first message has arrived.

All [requests](/developers/rest_api/#post-apistatesltentity_id) needs to be sent to the endpoint of the device and must be **POST**.
16 changes: 10 additions & 6 deletions source/_components/insteon_hub.markdown
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: component
title: "Insteon"
title: "Insteon Hub"
description: "Instructions how to setup the Insteon Hub within Home Assistant."
date: 2016-01-27 08:00
sidebar: true
Expand All @@ -11,18 +11,22 @@ logo: insteon.png
ha_category: Hub
---

The `insteon` component let you use your [Insteon](http://www.insteon.com/) Hub with Home Assistant.
The `insteon` component lets you use your [Insteon Hub](http://www.insteon.com/insteon-hub/) with Home Assistant.

To integrate your Insteon hub with Home Assistant, add the following section to your `configuration.yaml` file:
You will need to obtain an Insteon REST API key from the [Insteon Developer program](http://www.insteon.com/become-an-insteon-developer) to use this component.

To integrate your Insteon Hub with Home Assistant, add the following section to your `configuration.yaml` file:

```yaml
# Example configuration.yaml entry
insteon:
insteon_hub:
username: YOUR_USERNAME
password: YOUR_PASSWORD
api_key: YOUR_API_KEY
```

Configuration variables:

- **username** (*Required*): The username that used to access the Insteon interface.
- **password** (*Required*): The password that used to access the Insteon interface.
- **username** (*Required*): The username used to access the Insteon interface (e.g. the [connect.insteon.com](connect.insteon.com) site).
- **password** (*Required*): The password used to access the Insteon interface.
- **api_key** (*Required*): The Insteon REST API key emailed to you once you are approved in the Insteon Developer program.
2 changes: 1 addition & 1 deletion source/_components/light.blinksticklight.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ha_category: Light
---


The blinkstick platform let you can control your [Blinkstick](https://www.blinkstick.com/) lights from within Home Assistant.
The `blinkstick` platform let you can control your [Blinkstick](https://www.blinkstick.com/) lights from within Home Assistant.

To add blinkstick to your installation, add the following to your `configuration.yaml` file:

Expand Down
2 changes: 1 addition & 1 deletion source/_components/light.hyperion.markdown
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: component
title: Hyperion
title: "Hyperion"
description: "Instructions how to integrate Hyperion into Home Assistant."
date: 2015-10-25 22:43
sidebar: true
Expand Down
1 change: 0 additions & 1 deletion source/_components/light.limitlessled.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ description: "Instructions on how to setup LimitlessLED within Home Assistant."
date: 2015-12-03 13:00
sidebar: true
layout: page
title: "LimitlessLED support"
sidebar: false
comments: false
sharing: true
Expand Down
2 changes: 1 addition & 1 deletion source/_components/light.mqtt.markdown
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: component
title: "MQTT light"
title: "MQTT Light"
description: "Instructions how to setup MQTT lights within Home Assistant."
date: 2015-11-13 08:30
sidebar: true
Expand Down
Loading