diff --git a/source/_includes/custom/navigation.html b/source/_includes/custom/navigation.html index 2753f838077..677ddc19668 100644 --- a/source/_includes/custom/navigation.html +++ b/source/_includes/custom/navigation.html @@ -7,6 +7,7 @@
  • Adding devices
  • Presence detection
  • Automation
  • +
  • Configuration cookbook
  • Component overview
  • diff --git a/source/cookbook/automation_sun.markdown b/source/cookbook/automation_sun.markdown new file mode 100644 index 00000000000..81cd31059e1 --- /dev/null +++ b/source/cookbook/automation_sun.markdown @@ -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 +``` \ No newline at end of file diff --git a/source/cookbook/basic_example_use_trigger_values.markdown b/source/cookbook/basic_example_use_trigger_values.markdown new file mode 100644 index 00000000000..d1f6d286448 --- /dev/null +++ b/source/cookbook/basic_example_use_trigger_values.markdown @@ -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 +``` diff --git a/source/cookbook/index.markdown b/source/cookbook/index.markdown new file mode 100644 index 00000000000..7c76927ec11 --- /dev/null +++ b/source/cookbook/index.markdown @@ -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 %} diff --git a/source/cookbook/turn_on_light_for_10_minutes_when_motion_detected.markdown b/source/cookbook/turn_on_light_for_10_minutes_when_motion_detected.markdown new file mode 100644 index 00000000000..20c46b39beb --- /dev/null +++ b/source/cookbook/turn_on_light_for_10_minutes_when_motion_detected.markdown @@ -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 +```