/custom_components/hello_state.py` and copy the below example code.
+
+```python
+# The domain of your component. Should be equal to the name of your component
+DOMAIN = "hello_state"
+
+CONF_NAME = 'name'
+DEFAULT_NAME = 'World'
+
+
+def setup(hass, config):
+ """ Setup is called when Home Assistant is loading our component. """
+
+ # Get the name from the configuration. Use DEFAULT_NAME if no name provided.
+ name = config[DOMAIN].get(CONF_NAME, DEFAULT_NAME)
+
+ # States are in the format DOMAIN.OBJECT_ID
+ hass.states.set('hello_state.hello', name)
+
+ # return boolean to indicate that initialization was successful
+ return True
+```
+
+Load the component by adding the following to your `configuration.yaml`:
+
+```yaml
+# configuration.yaml entry
+hello_state:
+ # optional
+ name: Paulus
+```
diff --git a/source/_cookbook/python_component_mqtt_basic.markdown b/source/_cookbook/python_component_mqtt_basic.markdown
new file mode 100644
index 00000000000..801ba13e4d8
--- /dev/null
+++ b/source/_cookbook/python_component_mqtt_basic.markdown
@@ -0,0 +1,78 @@
+---
+layout: page
+title: "Basic MQTT Example"
+description: ""
+date: 2016-02-07 12:13
+sidebar: true
+comments: false
+sharing: true
+footer: true
+ha_category: Custom Python Component Examples
+---
+
+
+This example requires you to have the [MQTT component](/components/mqtt/) up and running.
+
+
+This is a simple hello world example to show the basics of using MQTT in a custom component. To use this example, create the file `/custom_components/hello_mqtt.py` and copy the below example code.
+
+This example follows a topic on MQTT and updates the state of an entity to the last message received on that topic. It will also register a service 'set_state' that will publish a message to the MQTT topic that we're listening to.
+
+```python
+import homeassistant.loader as loader
+
+# The domain of your component. Should be equal to the name of your component
+DOMAIN = "hello_mqtt"
+
+# List of component names (string) your component depends upon
+DEPENDENCIES = ['mqtt']
+
+
+CONF_TOPIC = 'topic'
+DEFAULT_TOPIC = 'home-assistant/hello_mqtt'
+
+
+def setup(hass, config):
+ """ Setup our hello_mqtt component. """
+ mqtt = loader.get_component('mqtt')
+ topic = config[DOMAIN].get('topic', DEFAULT_TOPIC)
+ entity_id = 'hello_mqtt.last_message'
+
+ # Listener to be called when we receive a message
+ def message_received(topic, payload, qos):
+ """ A new MQTT message has been received. """
+ hass.states.set(entity_id, payload)
+
+ # Subscribe our listener to a topic
+ mqtt.subscribe(hass, topic, message_received)
+
+ # Set the intial state
+ hass.states.set(entity_id, 'No messages')
+
+ # Service to publish a message on MQTT
+ def set_state_service(call):
+ """ Service to send a message. """
+ mqtt.publish(hass, topic, call.data.get('new_state'))
+
+ # Register our service with Home Assistant
+ hass.services.register(DOMAIN, 'set_state', set_state_service)
+
+ # return boolean to indicate that initialization was successful
+ return True
+```
+
+Load the component by adding the following to your `configuration.yaml`. When your component is loaded, a new entity should popup and there should be a new service available to call.
+
+```yaml
+# configuration.yaml entry
+hello_mqtt:
+ topic: some_mqtt/topic/here
+```
+
+You can call the service with example payload:
+
+```json
+{
+ "new_state": "some new state"
+}
+```
diff --git a/source/_cookbook/restart_ha_if_wemo_switch_is_not_detected.markdown b/source/_cookbook/restart_ha_if_wemo_switch_is_not_detected.markdown
index 41a6b1b1643..5c7accebee2 100644
--- a/source/_cookbook/restart_ha_if_wemo_switch_is_not_detected.markdown
+++ b/source/_cookbook/restart_ha_if_wemo_switch_is_not_detected.markdown
@@ -3,10 +3,11 @@ layout: page
title: "Restart Home Assistant if Wemo Switch is not detected"
description: "Restart Home Assistant if Wemo Switch is not detected."
date: 2016-01-29 08:00
-sidebar: false
+sidebar: true
comments: false
sharing: true
footer: true
+ha_category: Automation Examples
---
### {% linkable_title Restart Home Assistant %}
diff --git a/source/_cookbook/send_a_reminder.markdown b/source/_cookbook/send_a_reminder.markdown
index bb0296f04aa..6207af196ab 100644
--- a/source/_cookbook/send_a_reminder.markdown
+++ b/source/_cookbook/send_a_reminder.markdown
@@ -3,10 +3,11 @@ layout: page
title: "Send a reminder"
description: "Send a reminder"
date: 2015-12-16 08:00
-sidebar: false
+sidebar: true
comments: false
sharing: true
footer: true
+ha_category: Automation Examples
---
#### {% linkable_title Send a reminder %}
diff --git a/source/_cookbook/track_battery_level.markdown b/source/_cookbook/track_battery_level.markdown
index e60d54c5980..1ea9b0d65ca 100644
--- a/source/_cookbook/track_battery_level.markdown
+++ b/source/_cookbook/track_battery_level.markdown
@@ -3,10 +3,11 @@ layout: page
title: "Track your battery level"
description: "Basic example how to track the battery level of your mobile devices."
date: 2016-01-29 09:00
-sidebar: false
+sidebar: true
comments: false
sharing: true
footer: true
+ha_category: Automation Examples
---
### {% linkable_title Battery level %}
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
index ff04a27bfa9..4cb2e40c971 100644
--- 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
@@ -3,10 +3,11 @@ layout: page
title: "Motion detected light"
description: "Turn on lights for 10 minutes when motion detected."
date: 2015-10-08 19:05
-sidebar: false
+sidebar: true
comments: false
sharing: true
footer: true
+ha_category: Automation Examples
---
#### {% linkable_title Turn on lights with a resettable off timer %}
diff --git a/source/_includes/asides/cookbook_navigation.html b/source/_includes/asides/cookbook_navigation.html
new file mode 100644
index 00000000000..def8baf9f1f
--- /dev/null
+++ b/source/_includes/asides/cookbook_navigation.html
@@ -0,0 +1,25 @@
+
+ {% include edit_github.html %}
+ {% assign cookbook = site.cookbook | sort: 'title' %}
+
+
+
+
+
{{page.ha_category}}
+
+ {% for recipe in cookbook %}
+ {% if recipe.ha_category == page.ha_category %}
+ -
+ {% if recipe.url == page.url %}
+ {{recipe.title}}
+ {% else %}
+ {{recipe.title}}
+ {% endif %}
+
+ {% endif %}
+ {% endfor %}
+
+
+
diff --git a/source/_includes/site/sidebar.html b/source/_includes/site/sidebar.html
index 862c78ffe8a..e7b0e2dbaaa 100644
--- a/source/_includes/site/sidebar.html
+++ b/source/_includes/site/sidebar.html
@@ -2,6 +2,8 @@
{% assign url_parts = page.url | split: '/' %}
{% if url_parts[1] == 'components' %}
{% include asides/component_navigation.html | compact_newlines %}
+ {% elsif url_parts[1] == 'cookbook' %}
+ {% include asides/cookbook_navigation.html | compact_newlines %}
{% else %}
{% include asides/about.html %}
diff --git a/source/cookbook/index.markdown b/source/cookbook/index.markdown
index 458f8cac657..2170e6127c1 100644
--- a/source/cookbook/index.markdown
+++ b/source/cookbook/index.markdown
@@ -1,24 +1,39 @@
---
layout: page
-title: "Configuration Cookbook"
-description: "Community maintained list of configuration exmaples."
+title: "Cookbook"
+description: "Community maintained list of different ways to use Home Assistant."
date: 2015-10-08 19:05
sidebar: false
comments: false
sharing: true
footer: true
regenerate: true
+hide_github_edit: 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).
+This is a community currated list of different ways to use Home Assistant. New recipes can be added via the [home-assistant.io repository](https://github.com/balloob/home-assistant.io/tree/master/source/_cookbook).
-{% for recipe in site.cookbook %}
- * [{{recipe.title}}]({{recipe.url}})
-{% endfor %}
+{% assign cookbook = site.cookbook | sort: 'title' %}
+{% assign categories = cookbook | sort: 'ha_category' | map: 'ha_category' | uniq %}
-### {% linkable_title Configuration.yaml Gists %}
+{% for category in categories %}
+### {% linkable_title {{ category }} %}
+ {% if category == 'Automation Examples' %}
+
+ {% elsif category == 'Full configuration.yaml examples' %}
Some users keep a public scrubbed copy of their `configuration.yaml` to learn from.
+ {% elsif category == '' %}
-- [Configuration.yaml by Carlo Costanzo](https://gist.github.com/CCOSTAN/9934de973a293b809868)
-- [Configuration.yaml by happyleavesaoc](https://github.com/happyleavesaoc/my-home-automation/tree/master/homeassistant)
+ {% endif %}
+
+ {% for recipe in site.cookbook %}
+ {% if recipe.ha_category == category %}
+ {% if recipe.ha_external_link %}
+ * [{{recipe.title}}]({{recipe.ha_external_link}})
+ {% else %}
+ * [{{recipe.title}}]({{recipe.url}})
+ {% endif %}
+ {% endif %}
+ {% endfor %}
+{% endfor %}