mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 01:06:52 +00:00
Add cookbook
This commit is contained in:
parent
b3cafec7d6
commit
67adc41bf9
@ -7,6 +7,7 @@
|
|||||||
<li><a href='/getting-started/devices.html'>Adding devices</a></li>
|
<li><a href='/getting-started/devices.html'>Adding devices</a></li>
|
||||||
<li><a href='/getting-started/presence-detection.html'>Presence detection</a></li>
|
<li><a href='/getting-started/presence-detection.html'>Presence detection</a></li>
|
||||||
<li><a href='/getting-started/automation.html'>Automation</a></li>
|
<li><a href='/getting-started/automation.html'>Automation</a></li>
|
||||||
|
<li><a href='/cookbook'>Configuration cookbook</a></li>
|
||||||
<li><a href='/components/'>Component overview</a></li>
|
<li><a href='/components/'>Component overview</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
42
source/cookbook/automation_sun.markdown
Normal file
42
source/cookbook/automation_sun.markdown
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
---
|
||||||
|
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
|
||||||
|
```
|
42
source/cookbook/basic_example_use_trigger_values.markdown
Normal file
42
source/cookbook/basic_example_use_trigger_values.markdown
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
---
|
||||||
|
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
|
||||||
|
```
|
17
source/cookbook/index.markdown
Normal file
17
source/cookbook/index.markdown
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
layout: page
|
||||||
|
title: "Configuration Cookbook"
|
||||||
|
description: "Community maintained list of configuration exmaples."
|
||||||
|
date: 2015-10-08 19:05
|
||||||
|
sidebar: false
|
||||||
|
comments: false
|
||||||
|
sharing: true
|
||||||
|
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).
|
||||||
|
|
||||||
|
{% directory path:cookbook exclude:index %}
|
||||||
|
* [{{ file.slug | replace: '_',' ' | capitalize }}]({{ file.slug | prepend: '/cookbook/' | append: '.html' }})
|
||||||
|
{% enddirectory %}
|
@ -0,0 +1,51 @@
|
|||||||
|
---
|
||||||
|
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
|
||||||
|
```
|
Loading…
x
Reference in New Issue
Block a user