Move cookbook to a collection

This commit is contained in:
Paulus Schoutsen 2015-10-25 01:40:06 -07:00
parent 03d0d75ae1
commit bc1be31de3
7 changed files with 8 additions and 10 deletions

View file

@ -1,57 +0,0 @@
---
layout: page
title: "Automation for rainy days"
description: "Basic example how to use weather conditions to set states"
date: 2015-10-08 19:05
sidebar: false
comments: false
sharing: true
footer: true
---
### Rainy Day Light ###
This requires a [forecast.io](components/sensor.forecast.html) sensor with the condition `weather_precip` that tells if it's raining or not.
Turn on a light in the living room when it starts raining, someone is home, and it's afternoon or later.
```yaml
automation:
alias: 'Rainy Day'
trigger:
- platform: state
entity_id: sensor.weather_precip
state: 'rain'
- platform: state
entity_id: group.all_devices
state: 'home'
- platform: time
after: '14:00'
before: '23:00'
condition: use_trigger_values
action:
execute_service: light.turn_on
service_entity_id: light.couch_lamp
```
And then of course turn off the lamp when it stops raining but only if it's within an hour before sunset.
```yaml
alias: 'Rain is over'
trigger:
- platform: state
entity_id: sensor.weather_precip
state: 'None'
- platform: sun
event: 'sunset'
offset: '-01:00:00'
condition: use_trigger_values
action:
execute_service: light.turn_off
service_entity_id: light.couch_lamp
```

View file

@ -1,42 +0,0 @@
---
layout: page
title: "Automation examples using the sun"
description: "Automation examples that use the sun."
date: 2015-10-08 19:05
sidebar: false
comments: false
sharing: true
footer: true
---
#### Turn on the living room lights 45 minutes before sunset if anyone home
```yaml
automation:
trigger:
platform: sun
event: sunset
offset: "-00:45:00"
condition:
platform: state
entity_id: group.all_devices
state: home
action:
service: homeassistant.turn_on
entity_id: group.living_room_lights
```
#### Natural wake up light
_Note, Philips Hue is currently the only light platform that support transitions._
```yaml
automation:
trigger:
platform: time
after: "07:15:00"
action:
service: light.turn_on
entity_id: light.bedroom
data:
# 900 seconds = 15 minutes
transition: 900
```

View file

@ -1,42 +0,0 @@
---
layout: page
title: "Automation: use_trigger_values"
description: "Basic example how to use use_trigger_values in automation"
date: 2015-10-08 19:05
sidebar: false
comments: false
sharing: true
footer: true
---
### Basic example for use_trigger_values ###
Turn on lights during daytime when it's dark enough < 200 lux.
```yaml
automation:
- alias:
trigger:
- platform: numeric_state
entity_id: sensor.sensor_luminance
below: 200
- platform: time
after: "08:00"
before: "23:00"
condition: use_trigger_values
action:
service: homeassistant.turn_on
entity_id: group.basic_lights
automation 2:
- alias:
trigger:
- platform: numeric_state
entity_id: sensor.sensor_luminance
above: 200
- platform: time
after: "23:00"
action:
service: homeassistant.turn_off
entity_id: group.basic_lights
```

View file

@ -1,83 +0,0 @@
---
layout: page
title: "Dim lights when playing media"
description: "Dim lights up or down when playing media"
date: 2015-10-15 19:05
sidebar: false
comments: false
sharing: true
footer: true
---
Like it how the lights dim up/down at the movies? Do it at home as well!
This example uses the media player, Philips Hue (transitions) and the sun component.
We'll use actions to detect media player state changes and scenes to control multiple
lights, color settings and transition between scenes.
#### Scenes
One scene for normal light, one for when movies are on.
A 2 second transition gives a nice 'feel' to the switch.
```yaml
scene:
- name: Livingroom normal
entities:
light.light1:
state: on
transition: 2
brightness: 150
xy_color: [ 0.4448, 0.4066 ]
light.light2:
state: on
transition: 2
brightness: 215
xy_color: [ 0.4448, 0.4066 ]
- name: Livingroom dim
entities:
light.light1:
state: on
transition: 2
brightness: 75
xy_color: [ 0.5926, 0.3814 ]
light.light2:
state: on
transition: 2
brightness: 145
xy_color: [ 0.5529, 0.4107 ]
```
#### Automation
The paused/stopped state is best matched using "from: 'playing'".
Adding in the sun condition as we only want this when it's dark.
```yaml
automation:
- action: "Media player paused/stopped"
trigger:
- platform: state
entity_id: media_player.htpc
from: 'playing'
condition:
- platform: sun
entity_id: sun.sun
state: 'below_horizon'
action:
service: scene.turn_on
entity_id: scene.livingroom_normal
- alias: "Media player playing"
trigger:
- platform: state
entity_id: media_player.htpc
to: 'playing'
condition:
- platform: sun
entity_id: sun.sun
state: 'below_horizon'
action:
service: scene.turn_on
entity_id: scene.livingroom_dim
```

View file

@ -10,18 +10,14 @@ footer: true
---
This is a community currated list of `configuration.yaml` examples. New recipes can be added via
the [home-assistant.io repository](https://github.com/balloob/home-assistant.io/tree/master/source/cookbook).
the [home-assistant.io repository](https://github.com/balloob/home-assistant.io/tree/master/source/_cookbook).
#### Recipes
{% directory path:cookbook exclude:index %}
* [{{ file.slug | replace: '_',' ' | capitalize }}]({{ file.slug | prepend: '/cookbook/' | append: '.html' }})
{% enddirectory %}
{% for recipe in site.cookbook %}
* [{{recipe.title}}]({{recipe.url}})
{% endfor %}
#### Configuration.yaml Gists
- [Carlo Costanzo](https://github.com/CCOSTAN) - [Configuration.yaml](https://gist.github.com/CCOSTAN/9934de973a293b809868)
Some users keep a public scrubbed copy of their `configuration.yaml` to learn from.
<p class='note warning'>
Please be sure to properly scrub your configuration.yaml of usernames, passwords and other personal information you do not want public before sharing on this page.
</p>
- [Configuration.yaml by Carlo Costanzo](https://gist.github.com/CCOSTAN/9934de973a293b809868)

View file

@ -1,51 +0,0 @@
---
layout: page
title: "Motion detected light"
description: "Turn on lights for 10 minutes when motion detected."
date: 2015-10-08 19:05
sidebar: false
comments: false
sharing: true
footer: true
---
#### Turn on lights with a resettable off timer ####
This recipe will turn on a light when there is motion and turn off the light when ten minutes has passed without any motion events .
```yaml
automation:
alias: Turn on kitchen lights when there is movement
trigger:
- platform: state
entity_id: sensor.motion_sensor
to: 'on'
action:
service: homeassistant.turn_on
entity_id: script.timed_lamp
script:
timed_lamp:
alias: "Turn on lamp and set timer"
sequence:
# Cancel ev. old timers
- execute_service: script.turn_off
service_data:
entity_id: script.timer_off
- execute_service: light.turn_on
service_data:
entity_id: light.kitchen
# Set new timer
- execute_service: script.turn_on
service_data:
entity_id: script.timer_off
timer_off:
alias: "Turn off lamp after 10 minutes"
sequence:
- delay:
minutes: 10
- execute_service: light.turn_off
service_data:
entity_id: light.kitchen
```