diff --git a/atom.xml b/atom.xml index 15c8208b41..8e37d3d275 100644 --- a/atom.xml +++ b/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Home Assistant]]> - 2016-02-08T17:11:51+00:00 + 2016-02-09T07:49:53+00:00 https://home-assistant.io/ @@ -13,6 +13,240 @@ Octopress + + <![CDATA[Smarter SmartThings with MQTT and Home Assistant]]> + + 2016-02-09T07:44:00+00:00 + https://home-assistant.io/blog/2016/02/09/Smarter-Smart-Things-with-MQTT-and-Home-Assistant + This is a guest post by Home Assistant users Jeremiah Wuenschel and St. John Johnson.

+ +

So you own a SmartThings Hub. You probably bought it when you were looking to get into the whole Home Automation hobby because it worked with pretty much everything and offered you the ability to automate anything. After a week of ownership, you realized that building dashboards and automating required writing way more Groovy then you expected. Then one day you were browsing reddit and discovered the amazingness that is Home Assistant! A solution that offered dashboards, graphs, working support for Nest, and REAL EASY automation!

+ +

You spent your weekend getting everything set up, showing it off to your significant other, but in the end you got stumped when it came to integrating with all your existing SmartThings toys. What do I do now? Should I buy another hub? Should I just buy a Z-Wave stick?

+ +

That’s where we came in. We wanted a solution that can bridge the awesomeness of Home Assistant with the SmartThings hub that works with almost everything.

+ +

+ +

+ + + +

Glossary

+ +

This is going to be a pretty detailed tutorial on setting up our SmartThings bridge. However, there are a couple key terms that might be new to you:

+ +
    +
  • MQTT: A lightweight message protocol for listening and publishing events that happen. Many home automation platforms have built in support for this (especially Home Assistant).
  • +
  • Docker: A tool for running applications that are self-contained. No need for installing any dependencies or worrying about conflicts. Installs easily on Linux and OSX.
  • +
+ +

Setting up the Bridge

+ +

MQTT

+ +

Assuming that you already have Home Assistant and Smart Things running, you will first want to get an MQTT broker running. There are a handful of MQTT brokers available in Open Source land. We chose Mosca for its simplicity.

+ +

There is very little you need to do to get Mosca running. The easiest approach is to use Docker, and run a command like the following:

+ +
+
$ docker run \
+    -d \
+    --name="mqtt" \
+    -v /opt/mosca:/db \
+    -p 1883:1883 \
+    matteocollina/mosca
+
+
+
+ +

This will start Mosca up inside of a docker container, while keeping persistent storage for Mosca in /opt/mosca. The default configuration is the only thing we need to get things up and running.

+ +

If you don’t want to mess with Docker and can get node.js installed without trouble, the standalone instructions are all you need.

+ +

MQTT Bridge

+ +

This is the small piece of magic that bridges the gap between MQTT and SmartThings. It is a node.js app, and like Mosca it is probably easiest to install with Docker:

+ +
+
$ docker run \
+    -d \
+    --name="mqtt-bridge" \
+    -v /opt/mqtt-bridge:/config \
+    -p 8080:8080 \
+    stjohnjohnson/smartthings-mqtt-bridge
+
+
+
+ +

The code for this bridge is on Github if you want to start it up independently.

+ +

The MQTT Bridge only needs to know where your MQTT broker lives. If you are using these docker commands as-is, edit /opt/mqtt-bridge/config.yml to look like this:

+ +
+
---
+mqtt:
+    host: <IP of the host>
+
+
+
+ +

Restart the bridge, and you are ready to go:

+ +
+
$ docker restart mqtt-bridge
+
+
+
+ +

SmartThings Device

+ +

The next step (and possibly the most confusing) is the device type. Go to the Smart Things Device IDE and Create New Device Handler. Choose From Code and paste in the MQTT Bridge Device Code. Click Save, Publish, and then For Me.

+ +

Now to install your new Device Handler. Go back to My Devices in the IDE, and click New Device. Enter a name, and pick any random set of characters for the Device Network Id (this will automatically update later). For Type, scroll to the bottom of the list and find your newly created MQTT Bridge. Fill in the other boxes however you like.

+ +

Go back to My Devices, and click on your new device in the list. This will bring up a page that allows you to edit your device’s Preferences. Click edit and fill in the 3 pieces of information it asks for.

+ +
    +
  • MQTT Bridge IP Address: <IP address of the MQTT Bridge from the previous step>
  • +
  • MQTT Bridge Port: <8080 if you have changed nothing in the previous commands>
  • +
  • MQTT Bridge MAC Address: <Mac address of machine running the Bridge code>
  • +
+ +

This will create the link between SmartThings and the MQTT Bridge.

+ +

SmartThings App

+ +

The last step is to setup the SmartApp. After this, any registered devices will start sending their events to MQTT.

+ +

Go to the Smart App IDE. Click New SmartApp, followed by From Code. Paste in the MQTT Bridge SmartApp code and click Save. Click Publish and then For Me. In the SmartThings mobile app, add the new SmartApp and configure it with your devices and MQTT Bridge device. Clicking done will subscribe SmartThings to your MQTT broker and begin 2-way propagation of events.

+ +

Configure Home Assistant

+ +

To add SmartThings devices to Home Assistant over MQTT, first enable MQTT in Home Assistant:

+ +
+
mqtt:
+  broker: localhost
+
+
+
+ +

Replace localhost with the location of the running MQTT Broker. Devices from the MQTT Bridge are published to the path /smartthings/<Device Name>/<Atribute>

+ +

For example, my Dimmer Z-Wave Lamp is called “Fireplace Lights” in SmartThings. The following topics are published:

+ + + + + + + + + + + + + + + + + + +
TopicDescription
/smartthings/Fireplace Lights/levelBrightness (0-99)
/smartthings/Fireplace Lights/switchSwitch State (on/off)
+ +

Here is an example Home Assistant config:

+ +
+
switch:
+  platform: mqtt
+  name: "Fireplace Lights"
+  state_topic: "/smartthings/Fireplace Lights/switch"
+  command_topic: "/smartthings/Fireplace Lights/switch"
+  brightness_state_topic: "/smartthings/Fireplace Lights/level"
+  brightness_command_topic: "/smartthings/Fireplace Lights/level"
+  payload_on: "on"
+  payload_off: "off"
+  retain: true
+
+
+
+ +

We recommend retain: true for every MQTT device in order to keep states in sync when things become disconnected.

+ +

Start digging through the MQTT Components in Home Assistant to find which components map to the new events being published to MQTT.

+ +

Configuring with Docker-Compose

+ +

Our personal preference for starting the whole suite of software is to use a single Docker-Compose file. Just create a file called docker-compose.yml like this:

+ +
+
mqtt:
+    image: matteocollina/mosca
+    ports:
+        - 1883:1883
+
+mqttbridge:
+    image: stjohnjohnson/smartthings-mqtt-bridge
+    volumes:
+        - ./mqtt-bridge:/config
+    ports:
+        - 8080:8080
+    links:
+        - mqtt
+
+homeassistant:
+    image: balloob/home-assistant
+    ports:
+        - 80:80
+    volumes:
+        - ./home-assistant:/config
+        - /etc/localtime:/etc/localtime:ro
+    links:
+        - mqtt
+
+
+
+ +

This will start home-assistant, MQTT, and the Bridge, in dependency order. All config can reference the name of the docker container instead of using IP addresses (e.g. mqtt for the broker host in Home Assistant).

+ +

How it works

+ +

HTTP Endpoint: There are really only 2 ways to communicate with the SmartThings hub that we could find. The easiest approach is to create a RESTful SmartApp authenticated with OAuth that provides state changes via HTTP directly. This approach is pretty straightforward to implement, but it requires communication with the SmartThings cloud service, and can’t be done entirely on your LAN. We hoped to keep all communication internal, and came up with a second approach.

+ +

Custom Device Type: SmartThings custom device types allow developers to define handlers for HTTP events received directly over the local network by the SmartThings hub. Messages received are authenticated by MAC address, and can contain arbitrary strings in their payload. Since a Device Type is only ever tied to a single device, we need to add a SmartApp to the mix in order to translate events between individual devices and our special Home Assistant Bridge device. Here is what we have so far:

+ +
+
Z-Wave Switch        |
+Zigbee motion sensor |<---> Bridge App <---> Bridge Device Type <---> <Local network>
+Z-Wave light bulb    |
+
+
+
+ +

On the Home Assistant side, there is a powerful platform available based on the MQTT lightweight message bus protocol. Everything from lights to switches to temperature sensors can be defined in Home Assistant as an MQTT component, so it makes for a convenient integration point. This requires an MQTT broker for handling the message bus, and one last piece to translate between the HTTP that SmartThings supports and MQTT.

+ +

Here is the final sequence of events:

+ +

+ + SmartThings Bridge Sequence + + SmartThings Bridge Sequence +

+ +

There are a lot of stops along the way for these events, but each piece is a simple translation layer to shuttle the events between systems.

+ +

Future Improvements

+
    +
  • Raspberry pi: There is a lot of interest in getting this running on the Raspberry Pi. It only requires binaries compiled for ARM, so we plan to get ARM-compatible versions of the containers going at some point.
  • +
  • Authentication for MQTT: At the moment, the MQTT bridge doesn’t understand how to authenticate to MQTT, so only unauthenticated MQTT is supported. This is mitigated to some degree if you use our Docker Compose config, because MQTT’s port is not actually shared publicly.
  • +
  • Authentication for MQTT Bridge: Right now the bridge expects that anyone subscribing is the SmartThings hub. This could use proper authentication.
  • +
+ +]]>
+
+ <![CDATA[0.12: Insteon, LIFX, Twitter and ZigBee]]> @@ -1540,328 +1774,6 @@ Glances web server started on http://0.0.0.0:61208/ -]]> - - - - <![CDATA[Using MQTT with Home Assistant]]> - - 2015-09-11T09:19:38+00:00 - https://home-assistant.io/blog/2015/09/11/different-ways-to-use-mqtt-with-home-assistant - MQTT support was added to Home Assistant recently. The MQTT component will enable you to do all sort of things. Most likely you will use it to communicate with your devices. But Home Assistant doesn’t care where the data is coming from or is limited to real hardware as long as there is MQTT support. This means that it doesn’t matter if the data is coming from a human, a web service, or a device.

- -

A great example is shown in a Laundry Automation post in this blog.

- -

This post will give you a small overview of some other possibilities on how to use MQTT with Home Assistant.

- - - -

Manual usage

- -

The simplest but not the coolest way as a human to interact with a Home Assistant sensor is launching a command manually. Let’s create a “Mood” sensor. For simplicity Home Assistant and the MQTT broker are both running on the same host. The needed configuration snipplets to add to the configuration.yaml file consists of two parts: one for the broker and one for the sensor.

- -
- - -
1
-2
-3
-4
-5
-6
-7
-
mqtt:
-  broker: 127.0.0.1
-
-sensor:
-  - platform: mqtt
-    name: "Fabian's Mood"
-    state_topic: "home-assistant/fabian/mood"
-
-
- -

After a restart of Home Assistant the “Mood” sensor will show up in the frontend. For more details about the configuration of MQTT itself and the sensor, please refer to the MQTT component or the MQTT sensor documentation.

- -

Now we can set the mood. The commandline tool (mosquitto_pub) which is shipped with mosquitto is used to send an MQTT message.

- -
- - -
1
-
$ mosquitto_pub  -h 127.0.0.1 -t "home-assistant/fabian/mood" -m "bad"
-
-
- -

- - The Mood sensor -

- -

This is a really bad example. Don’t do this in the real world because you won’t be able to create diagrams of historical data. Better use a numerical value.

- -

Python MQTT bindings

- -

The last section was pretty boring, I know. Nobody wants to send MQTT messages by hand if there is a computer on the desk. If you are playing the lottery this section is for you. If not, read it anyway because the lottery is just an example :-).

- -

This example is using the Paho MQTT Python binding because those binding should be available on the host where Home Assistant is running. If you want to use this example on another machine, please make sure that the bindings are installed (pip3 install paho-mqtt).

- -

The first step is to add an additional MQTT sensor to the configuration.yaml file. The sensor will be called “Lottery” and the unit of measurement will be “No.”.

- -
- - -
1
-2
-3
-4
-
  - platform: mqtt
-    name: "Lottery"
-    state_topic: "home-assistant/lottery/number"
-    unit_of_measurement: "No."
-
-
- -

Don’t forget to restart Home Assistant to make the configuration active.

- -

To play, we need numbers from 1 to 49 which can be marked on the ticket. Those numbers should be random and displayed in the Home Assistant frontend. The Python script below is another simple example on how to send MQTT messages from the commandline; this time in a loop. For further information and examples please check the Paho MQTT documentation.

- -
- - -
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-
#!/usr/bin/python3
-#
-import time
-import random
-import paho.mqtt.client as mqtt
-import paho.mqtt.publish as publish
-
-broker = '127.0.0.1'
-state_topic = 'home-assistant/lottery/number'
-delay = 5
-
-# Send a single message to set the mood
-publish.single('home-assistant/fabian/mood', 'good', hostname=broker)
-
-# Send messages in a loop
-client = mqtt.Client("ha-client")
-client.connect(broker)
-client.loop_start()
-
-while True:
-    client.publish(state_topic, random.randrange(0, 50, 1))
-    time.sleep(delay)
-
-
- -

Every 5 seconds a message with a new number is sent to the broker and picked up by Home Assistant. By the way, my mood is much better now.

- -

- - The Lottery sensor -

- -

With only a few lines of Python and an MQTT broker you can create your own “smartdevice” or send information to Home Assistant which you haven’t think of. Of course this is not limited to Python. If there is an MQTT library available, the device can be used with Home Assistant now.

- -

Arduino

- -

To get started with real hardware that is capable to send MQTT messages, the Arduino platform is an inexpensive way to do it. In this section an Arduino UNO with an Ethernet shield and a photo resistor is used. The photo resistor is connected to analog pin 0 (A0) and has an output from 0 to 1024.

- -

- - The Arduino UNO with Ethernet shield and photo resistor -

- -

The MQTT client for the Arduino needs to be available in your Arduino IDE. Below you will find a sketch which could act as a starting point. Please modify the IP addresses, the MAC address, and the pin as needed and upload the sketch to your Arduino.

- -
- - -
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-
/*
-  This sketch is based on the basic MQTT example by
-  http://knolleary.github.io/pubsubclient/
-*/
-
-#include <SPI.h>
-#include <Ethernet.h>
-#include <PubSubClient.h>
-
-#define DEBUG 1 // Debug output to serial console
-
-// Device settings
-IPAddress deviceIp(192, 168, 0, 43);
-byte deviceMac[] = { 0xAB, 0xCD, 0xFE, 0xFE, 0xFE, 0xFE };
-char* deviceId  = "sensor01"; // Name of the sensor
-char* stateTopic = "home-assistant/sensor01/brightness"; // MQTT topic where values are published
-int sensorPin = A0; // Pin to which the sensor is connected to
-char buf[4]; // Buffer to store the sensor value
-int updateInterval = 1000; // Interval in miliseconds
-
-// MQTT server settings
-IPAddress mqttServer(192, 168, 0, 12);
-int mqttPort = 1883;
-
-EthernetClient ethClient;
-PubSubClient client(ethClient);
-
-void reconnect() {
-  while (!client.connected()) {
-#if DEBUG
-    Serial.print("Attempting MQTT connection...");
-#endif
-    if (client.connect(deviceId)) {
-#if DEBUG
-      Serial.println("connected");
-#endif
-    } else {
-#if DEBUG
-      Serial.print("failed, rc=");
-      Serial.print(client.state());
-      Serial.println(" try again in 5 seconds");
-#endif
-      delay(5000);
-    }
-  }
-}
-
-void setup() {
-  Serial.begin(57600);
-  client.setServer(mqttServer, mqttPort);
-  Ethernet.begin(deviceMac, deviceIp);
-  delay(1500);
-}
-
-void loop() {
-  if (!client.connected()) {
-    reconnect();
-  }
-  client.loop();
-
-  int sensorValue = analogRead(sensorPin);
-#if DEBUG
-  Serial.print("Sensor value: ");
-  Serial.println(sensorValue);
-#endif
-  client.publish(stateTopic, itoa(sensorValue, buf, 10));
-  delay(updateInterval);
-}
-
-
- -

The Arduino will send the value of the sensor every second. To use the data in Home Assistant, add an additional MQTT sensor to the configuration.yaml file.

- -
- - -
1
-2
-3
-4
-
  - platform: mqtt
-    name: "Brightness"
-    state_topic: "home-assistant/sensor01/brightness"
-    unit_of_measurement: "cd"
-
-
- -

After a restart of Home Assistant the values of your Arduino will be available.

- -

- - The Brightness sensor -

- -

I hope that this post could give you some ideas about the usage Home Assistant and MQTT. If you are working on a cool project that includes Home Assistant, please let us now.

]]>
diff --git a/blog/2014/12/18/website-launched/index.html b/blog/2014/12/18/website-launched/index.html index 635671ee9d..91d7495f85 100644 --- a/blog/2014/12/18/website-launched/index.html +++ b/blog/2014/12/18/website-launched/index.html @@ -203,6 +203,12 @@ diff --git a/blog/2014/12/26/home-control-home-automation-and-the-smart-home/index.html b/blog/2014/12/26/home-control-home-automation-and-the-smart-home/index.html index dce090d8ac..e188f1c83d 100644 --- a/blog/2014/12/26/home-control-home-automation-and-the-smart-home/index.html +++ b/blog/2014/12/26/home-control-home-automation-and-the-smart-home/index.html @@ -258,6 +258,12 @@ This article will try to explain how they all relate.

diff --git a/blog/2015/01/04/hey-pushbullet-nice-talking-to-you/index.html b/blog/2015/01/04/hey-pushbullet-nice-talking-to-you/index.html index cc00776a3b..75d40d12ea 100644 --- a/blog/2015/01/04/hey-pushbullet-nice-talking-to-you/index.html +++ b/blog/2015/01/04/hey-pushbullet-nice-talking-to-you/index.html @@ -242,6 +242,12 @@ api_key=ABCDEFGHJKLMNOPQRSTUVXYZ diff --git a/blog/2015/01/11/bootstrapping-your-setup-with-discovery/index.html b/blog/2015/01/11/bootstrapping-your-setup-with-discovery/index.html index c5b47631fc..a8f24f56af 100644 --- a/blog/2015/01/11/bootstrapping-your-setup-with-discovery/index.html +++ b/blog/2015/01/11/bootstrapping-your-setup-with-discovery/index.html @@ -217,6 +217,12 @@ diff --git a/blog/2015/01/13/nest-in-da-house/index.html b/blog/2015/01/13/nest-in-da-house/index.html index f80c969c0e..0e28eb91cb 100644 --- a/blog/2015/01/13/nest-in-da-house/index.html +++ b/blog/2015/01/13/nest-in-da-house/index.html @@ -220,6 +220,12 @@ password=YOUR_PASSWORD diff --git a/blog/2015/01/24/release-notes/index.html b/blog/2015/01/24/release-notes/index.html index 11c0cb33a0..12dd08638e 100644 --- a/blog/2015/01/24/release-notes/index.html +++ b/blog/2015/01/24/release-notes/index.html @@ -226,6 +226,12 @@ Home Assistant now supports --open-ui and --demo-mode diff --git a/blog/2015/02/08/looking-at-the-past/index.html b/blog/2015/02/08/looking-at-the-past/index.html index 74a90f57ee..a7d8ff60c4 100644 --- a/blog/2015/02/08/looking-at-the-past/index.html +++ b/blog/2015/02/08/looking-at-the-past/index.html @@ -234,6 +234,12 @@ Events are saved in a local database. Google Graphs is used to draw the graph. D diff --git a/blog/2015/02/24/streaming-updates/index.html b/blog/2015/02/24/streaming-updates/index.html index 97001411af..acbaffac27 100644 --- a/blog/2015/02/24/streaming-updates/index.html +++ b/blog/2015/02/24/streaming-updates/index.html @@ -219,6 +219,12 @@ diff --git a/blog/2015/03/01/home-assistant-migrating-to-yaml/index.html b/blog/2015/03/01/home-assistant-migrating-to-yaml/index.html index 59b68edfc1..76976ad146 100644 --- a/blog/2015/03/01/home-assistant-migrating-to-yaml/index.html +++ b/blog/2015/03/01/home-assistant-migrating-to-yaml/index.html @@ -209,6 +209,12 @@ diff --git a/blog/2015/03/08/new-logo/index.html b/blog/2015/03/08/new-logo/index.html index a460ed2c7d..3dab4ebba8 100644 --- a/blog/2015/03/08/new-logo/index.html +++ b/blog/2015/03/08/new-logo/index.html @@ -210,6 +210,12 @@ The old logo, the new detailed logo and the new simple logo. diff --git a/blog/2015/03/11/release-notes/index.html b/blog/2015/03/11/release-notes/index.html index 3da3c7ea9d..59890ea9fd 100644 --- a/blog/2015/03/11/release-notes/index.html +++ b/blog/2015/03/11/release-notes/index.html @@ -249,6 +249,12 @@ An initial version of voice control for Home Assistant has landed. The current i diff --git a/blog/2015/03/22/release-notes/index.html b/blog/2015/03/22/release-notes/index.html index 5d66d9e430..ef37a95f68 100644 --- a/blog/2015/03/22/release-notes/index.html +++ b/blog/2015/03/22/release-notes/index.html @@ -286,6 +286,12 @@ I (Paulus) have contributed a scene component. A user can create scenes that cap diff --git a/blog/2015/04/25/release-notes/index.html b/blog/2015/04/25/release-notes/index.html index db234091fd..292e8427c0 100644 --- a/blog/2015/04/25/release-notes/index.html +++ b/blog/2015/04/25/release-notes/index.html @@ -297,6 +297,12 @@ diff --git a/blog/2015/05/09/utc-time-zone-awareness/index.html b/blog/2015/05/09/utc-time-zone-awareness/index.html index 73f844d5c1..e34197270e 100644 --- a/blog/2015/05/09/utc-time-zone-awareness/index.html +++ b/blog/2015/05/09/utc-time-zone-awareness/index.html @@ -232,6 +232,12 @@ diff --git a/blog/2015/05/14/release-notes/index.html b/blog/2015/05/14/release-notes/index.html index 225bdd1c81..61e186c5e6 100644 --- a/blog/2015/05/14/release-notes/index.html +++ b/blog/2015/05/14/release-notes/index.html @@ -324,6 +324,12 @@ Before diving into the newly supported devices and services, I want to highlight diff --git a/blog/2015/06/10/release-notes/index.html b/blog/2015/06/10/release-notes/index.html index 44e99b7675..fd0ebb40eb 100644 --- a/blog/2015/06/10/release-notes/index.html +++ b/blog/2015/06/10/release-notes/index.html @@ -377,6 +377,12 @@ This switch platform allows you to control your motion detection setting on your diff --git a/blog/2015/07/11/ip-cameras-arduino-kodi-efergy-support/index.html b/blog/2015/07/11/ip-cameras-arduino-kodi-efergy-support/index.html index 1de231e995..72c3c7f987 100644 --- a/blog/2015/07/11/ip-cameras-arduino-kodi-efergy-support/index.html +++ b/blog/2015/07/11/ip-cameras-arduino-kodi-efergy-support/index.html @@ -329,6 +329,12 @@ Fabian has added support for Forecast.io to g diff --git a/blog/2015/08/09/mqtt-raspberry-pi-squeezebox-asuswrt-support/index.html b/blog/2015/08/09/mqtt-raspberry-pi-squeezebox-asuswrt-support/index.html index 8c0b716c65..f5b78f1f95 100644 --- a/blog/2015/08/09/mqtt-raspberry-pi-squeezebox-asuswrt-support/index.html +++ b/blog/2015/08/09/mqtt-raspberry-pi-squeezebox-asuswrt-support/index.html @@ -318,6 +318,12 @@ Support for Temper temperature sensors has been contributed by +
  • + Smarter SmartThings with MQTT and Home Assistant +
  • + + +
  • 0.12: Insteon, LIFX, Twitter and ZigBee
  • @@ -341,12 +347,6 @@ Support for Temper temperature sensors has been contributed by - Set up encryption using Let's Encrypt - - - diff --git a/blog/2015/08/17/verisure-and-modern-tp-link-router-support/index.html b/blog/2015/08/17/verisure-and-modern-tp-link-router-support/index.html index abf29cce7f..7f78e46862 100644 --- a/blog/2015/08/17/verisure-and-modern-tp-link-router-support/index.html +++ b/blog/2015/08/17/verisure-and-modern-tp-link-router-support/index.html @@ -228,6 +228,12 @@ diff --git a/blog/2015/08/26/laundry-automation-with-moteino-mqtt-and-home-assistant/index.html b/blog/2015/08/26/laundry-automation-with-moteino-mqtt-and-home-assistant/index.html index 55025a18f4..800ac77c03 100644 --- a/blog/2015/08/26/laundry-automation-with-moteino-mqtt-and-home-assistant/index.html +++ b/blog/2015/08/26/laundry-automation-with-moteino-mqtt-and-home-assistant/index.html @@ -337,6 +337,12 @@ diff --git a/blog/2015/08/31/version-7-revamped-ui-and-improved-distribution/index.html b/blog/2015/08/31/version-7-revamped-ui-and-improved-distribution/index.html index dd547e3749..a40ad6dd29 100644 --- a/blog/2015/08/31/version-7-revamped-ui-and-improved-distribution/index.html +++ b/blog/2015/08/31/version-7-revamped-ui-and-improved-distribution/index.html @@ -315,6 +315,12 @@ diff --git a/blog/2015/09/11/different-ways-to-use-mqtt-with-home-assistant/index.html b/blog/2015/09/11/different-ways-to-use-mqtt-with-home-assistant/index.html index e2d5371895..6c46cf229b 100644 --- a/blog/2015/09/11/different-ways-to-use-mqtt-with-home-assistant/index.html +++ b/blog/2015/09/11/different-ways-to-use-mqtt-with-home-assistant/index.html @@ -518,6 +518,12 @@ PubSubClient client(ethClient); diff --git a/blog/2015/09/13/home-assistant-meets-ifttt/index.html b/blog/2015/09/13/home-assistant-meets-ifttt/index.html index 04a9dc36ab..c725540b53 100644 --- a/blog/2015/09/13/home-assistant-meets-ifttt/index.html +++ b/blog/2015/09/13/home-assistant-meets-ifttt/index.html @@ -377,6 +377,12 @@ diff --git a/blog/2015/09/18/monitoring-with-glances-and-home-assistant/index.html b/blog/2015/09/18/monitoring-with-glances-and-home-assistant/index.html index 4ae3e93766..ab0d666ac7 100644 --- a/blog/2015/09/18/monitoring-with-glances-and-home-assistant/index.html +++ b/blog/2015/09/18/monitoring-with-glances-and-home-assistant/index.html @@ -278,6 +278,12 @@ Glances web server started on http://0.0.0.0:61208/ diff --git a/blog/2015/09/19/alarm-sonos-and-itunes-support/index.html b/blog/2015/09/19/alarm-sonos-and-itunes-support/index.html index b6f551497e..17700dae6d 100644 --- a/blog/2015/09/19/alarm-sonos-and-itunes-support/index.html +++ b/blog/2015/09/19/alarm-sonos-and-itunes-support/index.html @@ -257,6 +257,12 @@ Automation has gotten a lot of love. It now supports conditions, multiple trigge diff --git a/blog/2015/10/05/home-assistant-goes-geo-with-owntracks/index.html b/blog/2015/10/05/home-assistant-goes-geo-with-owntracks/index.html index 000fd7b112..a6280e5137 100644 --- a/blog/2015/10/05/home-assistant-goes-geo-with-owntracks/index.html +++ b/blog/2015/10/05/home-assistant-goes-geo-with-owntracks/index.html @@ -233,6 +233,12 @@ Map in Home Assistant showing two people and three zones (home, school, work) diff --git a/blog/2015/10/11/measure-temperature-with-esp8266-and-report-to-mqtt/index.html b/blog/2015/10/11/measure-temperature-with-esp8266-and-report-to-mqtt/index.html index 87ac73ec62..cb6ba0c881 100644 --- a/blog/2015/10/11/measure-temperature-with-esp8266-and-report-to-mqtt/index.html +++ b/blog/2015/10/11/measure-temperature-with-esp8266-and-report-to-mqtt/index.html @@ -564,6 +564,12 @@ Adafruit_HDC1000 hdc = Adafruit_HDC1000(); diff --git a/blog/2015/10/11/rfxtrx-blinkstick-and-snmp-support/index.html b/blog/2015/10/11/rfxtrx-blinkstick-and-snmp-support/index.html index e86647a596..3d2cdf213b 100644 --- a/blog/2015/10/11/rfxtrx-blinkstick-and-snmp-support/index.html +++ b/blog/2015/10/11/rfxtrx-blinkstick-and-snmp-support/index.html @@ -222,6 +222,12 @@ diff --git a/blog/2015/10/26/firetv-and-radiotherm-now-supported/index.html b/blog/2015/10/26/firetv-and-radiotherm-now-supported/index.html index 562c392606..adffe4ebfc 100644 --- a/blog/2015/10/26/firetv-and-radiotherm-now-supported/index.html +++ b/blog/2015/10/26/firetv-and-radiotherm-now-supported/index.html @@ -244,6 +244,12 @@ This makes more sense as most people run Home Assistant as a daemon

    diff --git a/blog/2015/11/16/zwave-switches-lights-and-honeywell-thermostats-now-supported/index.html b/blog/2015/11/16/zwave-switches-lights-and-honeywell-thermostats-now-supported/index.html index 39803c8242..fd6abdf9fd 100644 --- a/blog/2015/11/16/zwave-switches-lights-and-honeywell-thermostats-now-supported/index.html +++ b/blog/2015/11/16/zwave-switches-lights-and-honeywell-thermostats-now-supported/index.html @@ -240,6 +240,12 @@ diff --git a/blog/2015/11/22/survey-november-2015/index.html b/blog/2015/11/22/survey-november-2015/index.html index bdc0be819b..9c6eebd152 100644 --- a/blog/2015/11/22/survey-november-2015/index.html +++ b/blog/2015/11/22/survey-november-2015/index.html @@ -280,6 +280,12 @@ diff --git a/blog/2015/12/05/community-highlights/index.html b/blog/2015/12/05/community-highlights/index.html index 65b3bcf5f8..5617e54c57 100644 --- a/blog/2015/12/05/community-highlights/index.html +++ b/blog/2015/12/05/community-highlights/index.html @@ -213,6 +213,12 @@ diff --git a/blog/2015/12/06/locks-rollershutters-binary-sensors-and-influxdb-support/index.html b/blog/2015/12/06/locks-rollershutters-binary-sensors-and-influxdb-support/index.html index 2b6c05af38..dcfd49715d 100644 --- a/blog/2015/12/06/locks-rollershutters-binary-sensors-and-influxdb-support/index.html +++ b/blog/2015/12/06/locks-rollershutters-binary-sensors-and-influxdb-support/index.html @@ -222,6 +222,12 @@ diff --git a/blog/2015/12/07/influxdb-and-grafana/index.html b/blog/2015/12/07/influxdb-and-grafana/index.html index 2e777780d6..1c94056c42 100644 --- a/blog/2015/12/07/influxdb-and-grafana/index.html +++ b/blog/2015/12/07/influxdb-and-grafana/index.html @@ -313,6 +313,12 @@ $ sudo systemctl status grafana-server diff --git a/blog/2015/12/10/activating-tasker-tasks-from-home-assistant-using-command-line-switches/index.html b/blog/2015/12/10/activating-tasker-tasks-from-home-assistant-using-command-line-switches/index.html index e08c951a5a..bba69c27b3 100644 --- a/blog/2015/12/10/activating-tasker-tasks-from-home-assistant-using-command-line-switches/index.html +++ b/blog/2015/12/10/activating-tasker-tasks-from-home-assistant-using-command-line-switches/index.html @@ -263,6 +263,12 @@ requests.get(' +
  • + Smarter SmartThings with MQTT and Home Assistant +
  • + + +
  • 0.12: Insteon, LIFX, Twitter and ZigBee
  • @@ -286,12 +292,6 @@ requests.get(' - Set up encryption using Let's Encrypt - - - diff --git a/blog/2015/12/12/philips-hue-blocks-3rd-party-bulbs/index.html b/blog/2015/12/12/philips-hue-blocks-3rd-party-bulbs/index.html index 5eadc022f2..5df1f79f52 100644 --- a/blog/2015/12/12/philips-hue-blocks-3rd-party-bulbs/index.html +++ b/blog/2015/12/12/philips-hue-blocks-3rd-party-bulbs/index.html @@ -235,6 +235,12 @@ Philips Hue FAQ entries regarding 3rd party light bulbs. diff --git a/blog/2015/12/13/setup-encryption-using-lets-encrypt/index.html b/blog/2015/12/13/setup-encryption-using-lets-encrypt/index.html index 907af31118..1e51ec5ac1 100644 --- a/blog/2015/12/13/setup-encryption-using-lets-encrypt/index.html +++ b/blog/2015/12/13/setup-encryption-using-lets-encrypt/index.html @@ -300,6 +300,12 @@ sudo docker run -it --rm -p 443:443 -p 80:80 --name letsencrypt \ diff --git a/blog/2015/12/22/amazon-echo-icloud-and-templates/index.html b/blog/2015/12/22/amazon-echo-icloud-and-templates/index.html index 890ace5116..5e0f8dd4a9 100644 --- a/blog/2015/12/22/amazon-echo-icloud-and-templates/index.html +++ b/blog/2015/12/22/amazon-echo-icloud-and-templates/index.html @@ -256,6 +256,12 @@ diff --git a/blog/2016/01/17/extended-support-for-diy-solutions/index.html b/blog/2016/01/17/extended-support-for-diy-solutions/index.html index 275c63c6a5..06d0d67023 100644 --- a/blog/2016/01/17/extended-support-for-diy-solutions/index.html +++ b/blog/2016/01/17/extended-support-for-diy-solutions/index.html @@ -236,6 +236,12 @@ diff --git a/blog/2016/01/19/perfect-home-automation/index.html b/blog/2016/01/19/perfect-home-automation/index.html index f6856c83d2..190616fbf2 100644 --- a/blog/2016/01/19/perfect-home-automation/index.html +++ b/blog/2016/01/19/perfect-home-automation/index.html @@ -240,6 +240,12 @@ diff --git a/blog/2016/01/30/insteon-lifx-twitter-and-zigbee/index.html b/blog/2016/01/30/insteon-lifx-twitter-and-zigbee/index.html index 524494f3ae..c2887c5f73 100644 --- a/blog/2016/01/30/insteon-lifx-twitter-and-zigbee/index.html +++ b/blog/2016/01/30/insteon-lifx-twitter-and-zigbee/index.html @@ -242,6 +242,12 @@ Example of the new views in the frontend. Learn mor diff --git a/blog/2016/02/09/smarter-smart-things-with-mqtt-and-home-assistant/index.html b/blog/2016/02/09/smarter-smart-things-with-mqtt-and-home-assistant/index.html new file mode 100644 index 0000000000..71ca11fb71 --- /dev/null +++ b/blog/2016/02/09/smarter-smart-things-with-mqtt-and-home-assistant/index.html @@ -0,0 +1,512 @@ + + + + + + + + + + Smarter SmartThings with MQTT and Home Assistant - Home Assistant + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    +
    + +
    + + +
    + +
    + +

    Smarter SmartThings with MQTT and Home Assistant

    + + + +
    + + + eight minutes reading time + + + + + + Comments + +
    + +
    + + +

    This is a guest post by Home Assistant users Jeremiah Wuenschel and St. John Johnson.

    + +

    So you own a SmartThings Hub. You probably bought it when you were looking to get into the whole Home Automation hobby because it worked with pretty much everything and offered you the ability to automate anything. After a week of ownership, you realized that building dashboards and automating required writing way more Groovy then you expected. Then one day you were browsing reddit and discovered the amazingness that is Home Assistant! A solution that offered dashboards, graphs, working support for Nest, and REAL EASY automation!

    + +

    You spent your weekend getting everything set up, showing it off to your significant other, but in the end you got stumped when it came to integrating with all your existing SmartThings toys. What do I do now? Should I buy another hub? Should I just buy a Z-Wave stick?

    + +

    That’s where we came in. We wanted a solution that can bridge the awesomeness of Home Assistant with the SmartThings hub that works with almost everything.

    + +

    + +

    + + + +

    Glossary

    + +

    This is going to be a pretty detailed tutorial on setting up our SmartThings bridge. However, there are a couple key terms that might be new to you:

    + +
      +
    • MQTT: A lightweight message protocol for listening and publishing events that happen. Many home automation platforms have built in support for this (especially Home Assistant).
    • +
    • Docker: A tool for running applications that are self-contained. No need for installing any dependencies or worrying about conflicts. Installs easily on Linux and OSX.
    • +
    + +

    Setting up the Bridge

    + +

    MQTT

    + +

    Assuming that you already have Home Assistant and Smart Things running, you will first want to get an MQTT broker running. There are a handful of MQTT brokers available in Open Source land. We chose Mosca for its simplicity.

    + +

    There is very little you need to do to get Mosca running. The easiest approach is to use Docker, and run a command like the following:

    + +
    +
    $ docker run \
    +    -d \
    +    --name="mqtt" \
    +    -v /opt/mosca:/db \
    +    -p 1883:1883 \
    +    matteocollina/mosca
    +
    +
    +
    + +

    This will start Mosca up inside of a docker container, while keeping persistent storage for Mosca in /opt/mosca. The default configuration is the only thing we need to get things up and running.

    + +

    If you don’t want to mess with Docker and can get node.js installed without trouble, the standalone instructions are all you need.

    + +

    MQTT Bridge

    + +

    This is the small piece of magic that bridges the gap between MQTT and SmartThings. It is a node.js app, and like Mosca it is probably easiest to install with Docker:

    + +
    +
    $ docker run \
    +    -d \
    +    --name="mqtt-bridge" \
    +    -v /opt/mqtt-bridge:/config \
    +    -p 8080:8080 \
    +    stjohnjohnson/smartthings-mqtt-bridge
    +
    +
    +
    + +

    The code for this bridge is on Github if you want to start it up independently.

    + +

    The MQTT Bridge only needs to know where your MQTT broker lives. If you are using these docker commands as-is, edit /opt/mqtt-bridge/config.yml to look like this:

    + +
    +
    ---
    +mqtt:
    +    host: <IP of the host>
    +
    +
    +
    + +

    Restart the bridge, and you are ready to go:

    + +
    +
    $ docker restart mqtt-bridge
    +
    +
    +
    + +

    SmartThings Device

    + +

    The next step (and possibly the most confusing) is the device type. Go to the Smart Things Device IDE and Create New Device Handler. Choose From Code and paste in the MQTT Bridge Device Code. Click Save, Publish, and then For Me.

    + +

    Now to install your new Device Handler. Go back to My Devices in the IDE, and click New Device. Enter a name, and pick any random set of characters for the Device Network Id (this will automatically update later). For Type, scroll to the bottom of the list and find your newly created MQTT Bridge. Fill in the other boxes however you like.

    + +

    Go back to My Devices, and click on your new device in the list. This will bring up a page that allows you to edit your device’s Preferences. Click edit and fill in the 3 pieces of information it asks for.

    + +
      +
    • MQTT Bridge IP Address: <IP address of the MQTT Bridge from the previous step>
    • +
    • MQTT Bridge Port: <8080 if you have changed nothing in the previous commands>
    • +
    • MQTT Bridge MAC Address: <Mac address of machine running the Bridge code>
    • +
    + +

    This will create the link between SmartThings and the MQTT Bridge.

    + +

    SmartThings App

    + +

    The last step is to setup the SmartApp. After this, any registered devices will start sending their events to MQTT.

    + +

    Go to the Smart App IDE. Click New SmartApp, followed by From Code. Paste in the MQTT Bridge SmartApp code and click Save. Click Publish and then For Me. In the SmartThings mobile app, add the new SmartApp and configure it with your devices and MQTT Bridge device. Clicking done will subscribe SmartThings to your MQTT broker and begin 2-way propagation of events.

    + +

    Configure Home Assistant

    + +

    To add SmartThings devices to Home Assistant over MQTT, first enable MQTT in Home Assistant:

    + +
    +
    mqtt:
    +  broker: localhost
    +
    +
    +
    + +

    Replace localhost with the location of the running MQTT Broker. Devices from the MQTT Bridge are published to the path /smartthings/<Device Name>/<Atribute>

    + +

    For example, my Dimmer Z-Wave Lamp is called “Fireplace Lights” in SmartThings. The following topics are published:

    + + + + + + + + + + + + + + + + + + +
    TopicDescription
    /smartthings/Fireplace Lights/levelBrightness (0-99)
    /smartthings/Fireplace Lights/switchSwitch State (on/off)
    + +

    Here is an example Home Assistant config:

    + +
    +
    switch:
    +  platform: mqtt
    +  name: "Fireplace Lights"
    +  state_topic: "/smartthings/Fireplace Lights/switch"
    +  command_topic: "/smartthings/Fireplace Lights/switch"
    +  brightness_state_topic: "/smartthings/Fireplace Lights/level"
    +  brightness_command_topic: "/smartthings/Fireplace Lights/level"
    +  payload_on: "on"
    +  payload_off: "off"
    +  retain: true
    +
    +
    +
    + +

    We recommend retain: true for every MQTT device in order to keep states in sync when things become disconnected.

    + +

    Start digging through the MQTT Components in Home Assistant to find which components map to the new events being published to MQTT.

    + +

    Configuring with Docker-Compose

    + +

    Our personal preference for starting the whole suite of software is to use a single Docker-Compose file. Just create a file called docker-compose.yml like this:

    + +
    +
    mqtt:
    +    image: matteocollina/mosca
    +    ports:
    +        - 1883:1883
    +
    +mqttbridge:
    +    image: stjohnjohnson/smartthings-mqtt-bridge
    +    volumes:
    +        - ./mqtt-bridge:/config
    +    ports:
    +        - 8080:8080
    +    links:
    +        - mqtt
    +
    +homeassistant:
    +    image: balloob/home-assistant
    +    ports:
    +        - 80:80
    +    volumes:
    +        - ./home-assistant:/config
    +        - /etc/localtime:/etc/localtime:ro
    +    links:
    +        - mqtt
    +
    +
    +
    + +

    This will start home-assistant, MQTT, and the Bridge, in dependency order. All config can reference the name of the docker container instead of using IP addresses (e.g. mqtt for the broker host in Home Assistant).

    + +

    How it works

    + +

    HTTP Endpoint: There are really only 2 ways to communicate with the SmartThings hub that we could find. The easiest approach is to create a RESTful SmartApp authenticated with OAuth that provides state changes via HTTP directly. This approach is pretty straightforward to implement, but it requires communication with the SmartThings cloud service, and can’t be done entirely on your LAN. We hoped to keep all communication internal, and came up with a second approach.

    + +

    Custom Device Type: SmartThings custom device types allow developers to define handlers for HTTP events received directly over the local network by the SmartThings hub. Messages received are authenticated by MAC address, and can contain arbitrary strings in their payload. Since a Device Type is only ever tied to a single device, we need to add a SmartApp to the mix in order to translate events between individual devices and our special Home Assistant Bridge device. Here is what we have so far:

    + +
    +
    Z-Wave Switch        |
    +Zigbee motion sensor |<---> Bridge App <---> Bridge Device Type <---> <Local network>
    +Z-Wave light bulb    |
    +
    +
    +
    + +

    On the Home Assistant side, there is a powerful platform available based on the MQTT lightweight message bus protocol. Everything from lights to switches to temperature sensors can be defined in Home Assistant as an MQTT component, so it makes for a convenient integration point. This requires an MQTT broker for handling the message bus, and one last piece to translate between the HTTP that SmartThings supports and MQTT.

    + +

    Here is the final sequence of events:

    + +

    + + SmartThings Bridge Sequence + + SmartThings Bridge Sequence +

    + +

    There are a lot of stops along the way for these events, but each piece is a simple translation layer to shuttle the events between systems.

    + +

    Future Improvements

    +
      +
    • Raspberry pi: There is a lot of interest in getting this running on the Raspberry Pi. It only requires binaries compiled for ARM, so we plan to get ARM-compatible versions of the containers going at some point.
    • +
    • Authentication for MQTT: At the moment, the MQTT bridge doesn’t understand how to authenticate to MQTT, so only unauthenticated MQTT is supported. This is mitigated to some degree if you use our Docker Compose config, because MQTT’s port is not actually shared publicly.
    • +
    • Authentication for MQTT Bridge: Right now the bridge expects that anyone subscribing is the SmartThings hub. This could use proper authentication.
    • +
    +
    + + +
    +

    Comments

    +
    +
    + + +
    + + + + +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/blog/archives/index.html b/blog/archives/index.html index cf633bc898..afe5955537 100644 --- a/blog/archives/index.html +++ b/blog/archives/index.html @@ -122,6 +122,40 @@

    2016

    + + + +
    @@ -1513,6 +1547,12 @@ diff --git a/blog/categories/architecture/atom.xml b/blog/categories/architecture/atom.xml index b696de4ab7..b080d7e9b8 100644 --- a/blog/categories/architecture/atom.xml +++ b/blog/categories/architecture/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Architecture | Home Assistant]]> - 2016-02-08T17:11:51+00:00 + 2016-02-09T07:49:53+00:00 https://home-assistant.io/ diff --git a/blog/categories/architecture/index.html b/blog/categories/architecture/index.html index e31bd0ed04..3b36aca02d 100644 --- a/blog/categories/architecture/index.html +++ b/blog/categories/architecture/index.html @@ -254,6 +254,12 @@ diff --git a/blog/categories/branding/atom.xml b/blog/categories/branding/atom.xml index 276f2aec6c..939f7340d8 100644 --- a/blog/categories/branding/atom.xml +++ b/blog/categories/branding/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Branding | Home Assistant]]> - 2016-02-08T17:11:51+00:00 + 2016-02-09T07:49:53+00:00 https://home-assistant.io/ diff --git a/blog/categories/branding/index.html b/blog/categories/branding/index.html index 32d04aa05b..e8cdad2137 100644 --- a/blog/categories/branding/index.html +++ b/blog/categories/branding/index.html @@ -254,6 +254,12 @@ diff --git a/blog/categories/community/atom.xml b/blog/categories/community/atom.xml index d023ea0be2..9c7f77662a 100644 --- a/blog/categories/community/atom.xml +++ b/blog/categories/community/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Community | Home Assistant]]> - 2016-02-08T17:11:51+00:00 + 2016-02-09T07:49:53+00:00 https://home-assistant.io/ diff --git a/blog/categories/community/index.html b/blog/categories/community/index.html index 35be37470a..85c05ddfe3 100644 --- a/blog/categories/community/index.html +++ b/blog/categories/community/index.html @@ -219,6 +219,12 @@ diff --git a/blog/categories/esp8266/atom.xml b/blog/categories/esp8266/atom.xml index 3a5c21807b..5dd17cb78e 100644 --- a/blog/categories/esp8266/atom.xml +++ b/blog/categories/esp8266/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: ESP8266 | Home Assistant]]> - 2016-02-08T17:11:51+00:00 + 2016-02-09T07:49:53+00:00 https://home-assistant.io/ diff --git a/blog/categories/esp8266/index.html b/blog/categories/esp8266/index.html index b5a9bddb94..325f562514 100644 --- a/blog/categories/esp8266/index.html +++ b/blog/categories/esp8266/index.html @@ -223,6 +223,12 @@ diff --git a/blog/categories/how-to/atom.xml b/blog/categories/how-to/atom.xml index 3c23b22e76..fe2930b449 100644 --- a/blog/categories/how-to/atom.xml +++ b/blog/categories/how-to/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: How-To | Home Assistant]]> - 2016-02-08T17:11:51+00:00 + 2016-02-09T07:49:53+00:00 https://home-assistant.io/ @@ -13,6 +13,240 @@ Octopress + + <![CDATA[Smarter SmartThings with MQTT and Home Assistant]]> + + 2016-02-09T07:44:00+00:00 + https://home-assistant.io/blog/2016/02/09/Smarter-Smart-Things-with-MQTT-and-Home-Assistant + This is a guest post by Home Assistant users Jeremiah Wuenschel and St. John Johnson.

    + +

    So you own a SmartThings Hub. You probably bought it when you were looking to get into the whole Home Automation hobby because it worked with pretty much everything and offered you the ability to automate anything. After a week of ownership, you realized that building dashboards and automating required writing way more Groovy then you expected. Then one day you were browsing reddit and discovered the amazingness that is Home Assistant! A solution that offered dashboards, graphs, working support for Nest, and REAL EASY automation!

    + +

    You spent your weekend getting everything set up, showing it off to your significant other, but in the end you got stumped when it came to integrating with all your existing SmartThings toys. What do I do now? Should I buy another hub? Should I just buy a Z-Wave stick?

    + +

    That’s where we came in. We wanted a solution that can bridge the awesomeness of Home Assistant with the SmartThings hub that works with almost everything.

    + +

    + +

    + + + +

    Glossary

    + +

    This is going to be a pretty detailed tutorial on setting up our SmartThings bridge. However, there are a couple key terms that might be new to you:

    + +
      +
    • MQTT: A lightweight message protocol for listening and publishing events that happen. Many home automation platforms have built in support for this (especially Home Assistant).
    • +
    • Docker: A tool for running applications that are self-contained. No need for installing any dependencies or worrying about conflicts. Installs easily on Linux and OSX.
    • +
    + +

    Setting up the Bridge

    + +

    MQTT

    + +

    Assuming that you already have Home Assistant and Smart Things running, you will first want to get an MQTT broker running. There are a handful of MQTT brokers available in Open Source land. We chose Mosca for its simplicity.

    + +

    There is very little you need to do to get Mosca running. The easiest approach is to use Docker, and run a command like the following:

    + +
    +
    $ docker run \
    +    -d \
    +    --name="mqtt" \
    +    -v /opt/mosca:/db \
    +    -p 1883:1883 \
    +    matteocollina/mosca
    +
    +
    +
    + +

    This will start Mosca up inside of a docker container, while keeping persistent storage for Mosca in /opt/mosca. The default configuration is the only thing we need to get things up and running.

    + +

    If you don’t want to mess with Docker and can get node.js installed without trouble, the standalone instructions are all you need.

    + +

    MQTT Bridge

    + +

    This is the small piece of magic that bridges the gap between MQTT and SmartThings. It is a node.js app, and like Mosca it is probably easiest to install with Docker:

    + +
    +
    $ docker run \
    +    -d \
    +    --name="mqtt-bridge" \
    +    -v /opt/mqtt-bridge:/config \
    +    -p 8080:8080 \
    +    stjohnjohnson/smartthings-mqtt-bridge
    +
    +
    +
    + +

    The code for this bridge is on Github if you want to start it up independently.

    + +

    The MQTT Bridge only needs to know where your MQTT broker lives. If you are using these docker commands as-is, edit /opt/mqtt-bridge/config.yml to look like this:

    + +
    +
    ---
    +mqtt:
    +    host: <IP of the host>
    +
    +
    +
    + +

    Restart the bridge, and you are ready to go:

    + +
    +
    $ docker restart mqtt-bridge
    +
    +
    +
    + +

    SmartThings Device

    + +

    The next step (and possibly the most confusing) is the device type. Go to the Smart Things Device IDE and Create New Device Handler. Choose From Code and paste in the MQTT Bridge Device Code. Click Save, Publish, and then For Me.

    + +

    Now to install your new Device Handler. Go back to My Devices in the IDE, and click New Device. Enter a name, and pick any random set of characters for the Device Network Id (this will automatically update later). For Type, scroll to the bottom of the list and find your newly created MQTT Bridge. Fill in the other boxes however you like.

    + +

    Go back to My Devices, and click on your new device in the list. This will bring up a page that allows you to edit your device’s Preferences. Click edit and fill in the 3 pieces of information it asks for.

    + +
      +
    • MQTT Bridge IP Address: <IP address of the MQTT Bridge from the previous step>
    • +
    • MQTT Bridge Port: <8080 if you have changed nothing in the previous commands>
    • +
    • MQTT Bridge MAC Address: <Mac address of machine running the Bridge code>
    • +
    + +

    This will create the link between SmartThings and the MQTT Bridge.

    + +

    SmartThings App

    + +

    The last step is to setup the SmartApp. After this, any registered devices will start sending their events to MQTT.

    + +

    Go to the Smart App IDE. Click New SmartApp, followed by From Code. Paste in the MQTT Bridge SmartApp code and click Save. Click Publish and then For Me. In the SmartThings mobile app, add the new SmartApp and configure it with your devices and MQTT Bridge device. Clicking done will subscribe SmartThings to your MQTT broker and begin 2-way propagation of events.

    + +

    Configure Home Assistant

    + +

    To add SmartThings devices to Home Assistant over MQTT, first enable MQTT in Home Assistant:

    + +
    +
    mqtt:
    +  broker: localhost
    +
    +
    +
    + +

    Replace localhost with the location of the running MQTT Broker. Devices from the MQTT Bridge are published to the path /smartthings/<Device Name>/<Atribute>

    + +

    For example, my Dimmer Z-Wave Lamp is called “Fireplace Lights” in SmartThings. The following topics are published:

    + + + + + + + + + + + + + + + + + + +
    TopicDescription
    /smartthings/Fireplace Lights/levelBrightness (0-99)
    /smartthings/Fireplace Lights/switchSwitch State (on/off)
    + +

    Here is an example Home Assistant config:

    + +
    +
    switch:
    +  platform: mqtt
    +  name: "Fireplace Lights"
    +  state_topic: "/smartthings/Fireplace Lights/switch"
    +  command_topic: "/smartthings/Fireplace Lights/switch"
    +  brightness_state_topic: "/smartthings/Fireplace Lights/level"
    +  brightness_command_topic: "/smartthings/Fireplace Lights/level"
    +  payload_on: "on"
    +  payload_off: "off"
    +  retain: true
    +
    +
    +
    + +

    We recommend retain: true for every MQTT device in order to keep states in sync when things become disconnected.

    + +

    Start digging through the MQTT Components in Home Assistant to find which components map to the new events being published to MQTT.

    + +

    Configuring with Docker-Compose

    + +

    Our personal preference for starting the whole suite of software is to use a single Docker-Compose file. Just create a file called docker-compose.yml like this:

    + +
    +
    mqtt:
    +    image: matteocollina/mosca
    +    ports:
    +        - 1883:1883
    +
    +mqttbridge:
    +    image: stjohnjohnson/smartthings-mqtt-bridge
    +    volumes:
    +        - ./mqtt-bridge:/config
    +    ports:
    +        - 8080:8080
    +    links:
    +        - mqtt
    +
    +homeassistant:
    +    image: balloob/home-assistant
    +    ports:
    +        - 80:80
    +    volumes:
    +        - ./home-assistant:/config
    +        - /etc/localtime:/etc/localtime:ro
    +    links:
    +        - mqtt
    +
    +
    +
    + +

    This will start home-assistant, MQTT, and the Bridge, in dependency order. All config can reference the name of the docker container instead of using IP addresses (e.g. mqtt for the broker host in Home Assistant).

    + +

    How it works

    + +

    HTTP Endpoint: There are really only 2 ways to communicate with the SmartThings hub that we could find. The easiest approach is to create a RESTful SmartApp authenticated with OAuth that provides state changes via HTTP directly. This approach is pretty straightforward to implement, but it requires communication with the SmartThings cloud service, and can’t be done entirely on your LAN. We hoped to keep all communication internal, and came up with a second approach.

    + +

    Custom Device Type: SmartThings custom device types allow developers to define handlers for HTTP events received directly over the local network by the SmartThings hub. Messages received are authenticated by MAC address, and can contain arbitrary strings in their payload. Since a Device Type is only ever tied to a single device, we need to add a SmartApp to the mix in order to translate events between individual devices and our special Home Assistant Bridge device. Here is what we have so far:

    + +
    +
    Z-Wave Switch        |
    +Zigbee motion sensor |<---> Bridge App <---> Bridge Device Type <---> <Local network>
    +Z-Wave light bulb    |
    +
    +
    +
    + +

    On the Home Assistant side, there is a powerful platform available based on the MQTT lightweight message bus protocol. Everything from lights to switches to temperature sensors can be defined in Home Assistant as an MQTT component, so it makes for a convenient integration point. This requires an MQTT broker for handling the message bus, and one last piece to translate between the HTTP that SmartThings supports and MQTT.

    + +

    Here is the final sequence of events:

    + +

    + + SmartThings Bridge Sequence + + SmartThings Bridge Sequence +

    + +

    There are a lot of stops along the way for these events, but each piece is a simple translation layer to shuttle the events between systems.

    + +

    Future Improvements

    +
      +
    • Raspberry pi: There is a lot of interest in getting this running on the Raspberry Pi. It only requires binaries compiled for ARM, so we plan to get ARM-compatible versions of the containers going at some point.
    • +
    • Authentication for MQTT: At the moment, the MQTT bridge doesn’t understand how to authenticate to MQTT, so only unauthenticated MQTT is supported. This is mitigated to some degree if you use our Docker Compose config, because MQTT’s port is not actually shared publicly.
    • +
    • Authentication for MQTT Bridge: Right now the bridge expects that anyone subscribing is the SmartThings hub. This could use proper authentication.
    • +
    + +]]>
    +
    + <![CDATA[Set up encryption using Let's Encrypt]]> @@ -672,90 +906,6 @@ Adafruit_HDC1000 hdc = Adafruit_HDC1000();
    -]]> - - - - <![CDATA[Remote Monitoring with Glances]]> - - 2015-09-18T09:00:00+00:00 - https://home-assistant.io/blog/2015/09/18/monitoring-with-glances-and-home-assistant -
    -Inspried by a feature requests I started looking into the available options to do monitoring of remote hosts. The feature request is about displaying system information in a similar way than the systemmonitor sensor does it for the local system. After a while I started to think that it would be a nice addition for a small home network where no full-blown system monitoring setup is present.

    - - - -

    The basic problem is to get the data from the remote host. Starting with psutil that is used by the systemmonitor sensor, a possible solution is only a click away and named Glances. Glances has a nice curses-based interface and a RESTful API.

    - -

    The Glances sensor sensor uses that API to get all needed data.

    - -

    In this post a default Fedora 22 Workstation installation is used on the host that should be monitored. In fact, it doesn’t matter if the system is the local one or a remote one as long as Glances is available. With some adjustments it should work on your own systems too. The difference will be the package and the firewall management tools.

    - -

    First some extra packages are needed beside Glances, especially the bottle webserver. I guess that Glances is available for your distribution as well. Otherwise follow those instructions.

    - -
    -
    $ sudo dnf -y install glances python-bottle
    -
    -
    -
    - -

    On Fedora the Firewall settings are strict. Let’s open port 61208 to allow other hosts to connect to that port. This is not needed if you just want to observe your local machine.

    - -
    -
    $ sudo firewall-cmd --permanent --add-port=61208/tcp
    -$ sudo firewall-cmd --reload
    -
    -
    -
    - -

    Launch glances and keep an eye on the output.

    - -
    -
    $ glances -w
    -Glances web server started on http://0.0.0.0:61208/
    -
    -
    -
    - -

    Now browse to http://IP_ADRRESS:61208/. You should see the webified view of Glances.

    - -

    - - Glances web interface -

    - -

    Another check is to access the API located at http://IP_ADRRESS:61208/api/2/mem/used and to confirm that a detail about your memory usage is provided as a JSON response. If so, you are good to proceed.

    - -
    -
    $ curl -X GET http://IP_ADDRESS:61208/api/2/mem/used
    -{"used": 203943936}
    -
    -
    -
    - -

    Add the glances sensor entry to your configuration.yaml file and restart Home Assistant then.

    - -
    -
    # Example configuration.yaml entry
    -  - platform: glances
    -    name: NAS
    -    host: IP_ADDRESS
    -    resources:
    -      - 'disk_use_percent'
    -      - 'disk_use'
    -      - 'disk_free'
    -
    -
    -
    - -

    If there are no error in the log file then you should see your new sensors.

    - -

    - - The Glances sensors -

    - -

    Glances has a couple of optional dependencies which are extenting the range of provided information. This means that it would be possible to get details about the RAID system, HDD temperature, IP addresses, sensors, etc., please create a Pull request with your additions or a Feature request if you want see more details in your Home Assistant frontend.

    ]]>
    diff --git a/blog/categories/how-to/index.html b/blog/categories/how-to/index.html index 229511d5a3..bc1e0f9dd8 100644 --- a/blog/categories/how-to/index.html +++ b/blog/categories/how-to/index.html @@ -120,6 +120,43 @@ +

    2016

    + + + + + +

    2015

    @@ -419,6 +456,12 @@ diff --git a/blog/categories/mqtt/atom.xml b/blog/categories/mqtt/atom.xml index 4295b0507e..74957f5c7b 100644 --- a/blog/categories/mqtt/atom.xml +++ b/blog/categories/mqtt/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: MQTT | Home Assistant]]> - 2016-02-08T17:11:51+00:00 + 2016-02-09T07:49:53+00:00 https://home-assistant.io/ @@ -13,6 +13,240 @@ Octopress + + <![CDATA[Smarter SmartThings with MQTT and Home Assistant]]> + + 2016-02-09T07:44:00+00:00 + https://home-assistant.io/blog/2016/02/09/Smarter-Smart-Things-with-MQTT-and-Home-Assistant + This is a guest post by Home Assistant users Jeremiah Wuenschel and St. John Johnson.

    + +

    So you own a SmartThings Hub. You probably bought it when you were looking to get into the whole Home Automation hobby because it worked with pretty much everything and offered you the ability to automate anything. After a week of ownership, you realized that building dashboards and automating required writing way more Groovy then you expected. Then one day you were browsing reddit and discovered the amazingness that is Home Assistant! A solution that offered dashboards, graphs, working support for Nest, and REAL EASY automation!

    + +

    You spent your weekend getting everything set up, showing it off to your significant other, but in the end you got stumped when it came to integrating with all your existing SmartThings toys. What do I do now? Should I buy another hub? Should I just buy a Z-Wave stick?

    + +

    That’s where we came in. We wanted a solution that can bridge the awesomeness of Home Assistant with the SmartThings hub that works with almost everything.

    + +

    + +

    + + + +

    Glossary

    + +

    This is going to be a pretty detailed tutorial on setting up our SmartThings bridge. However, there are a couple key terms that might be new to you:

    + +
      +
    • MQTT: A lightweight message protocol for listening and publishing events that happen. Many home automation platforms have built in support for this (especially Home Assistant).
    • +
    • Docker: A tool for running applications that are self-contained. No need for installing any dependencies or worrying about conflicts. Installs easily on Linux and OSX.
    • +
    + +

    Setting up the Bridge

    + +

    MQTT

    + +

    Assuming that you already have Home Assistant and Smart Things running, you will first want to get an MQTT broker running. There are a handful of MQTT brokers available in Open Source land. We chose Mosca for its simplicity.

    + +

    There is very little you need to do to get Mosca running. The easiest approach is to use Docker, and run a command like the following:

    + +
    +
    $ docker run \
    +    -d \
    +    --name="mqtt" \
    +    -v /opt/mosca:/db \
    +    -p 1883:1883 \
    +    matteocollina/mosca
    +
    +
    +
    + +

    This will start Mosca up inside of a docker container, while keeping persistent storage for Mosca in /opt/mosca. The default configuration is the only thing we need to get things up and running.

    + +

    If you don’t want to mess with Docker and can get node.js installed without trouble, the standalone instructions are all you need.

    + +

    MQTT Bridge

    + +

    This is the small piece of magic that bridges the gap between MQTT and SmartThings. It is a node.js app, and like Mosca it is probably easiest to install with Docker:

    + +
    +
    $ docker run \
    +    -d \
    +    --name="mqtt-bridge" \
    +    -v /opt/mqtt-bridge:/config \
    +    -p 8080:8080 \
    +    stjohnjohnson/smartthings-mqtt-bridge
    +
    +
    +
    + +

    The code for this bridge is on Github if you want to start it up independently.

    + +

    The MQTT Bridge only needs to know where your MQTT broker lives. If you are using these docker commands as-is, edit /opt/mqtt-bridge/config.yml to look like this:

    + +
    +
    ---
    +mqtt:
    +    host: <IP of the host>
    +
    +
    +
    + +

    Restart the bridge, and you are ready to go:

    + +
    +
    $ docker restart mqtt-bridge
    +
    +
    +
    + +

    SmartThings Device

    + +

    The next step (and possibly the most confusing) is the device type. Go to the Smart Things Device IDE and Create New Device Handler. Choose From Code and paste in the MQTT Bridge Device Code. Click Save, Publish, and then For Me.

    + +

    Now to install your new Device Handler. Go back to My Devices in the IDE, and click New Device. Enter a name, and pick any random set of characters for the Device Network Id (this will automatically update later). For Type, scroll to the bottom of the list and find your newly created MQTT Bridge. Fill in the other boxes however you like.

    + +

    Go back to My Devices, and click on your new device in the list. This will bring up a page that allows you to edit your device’s Preferences. Click edit and fill in the 3 pieces of information it asks for.

    + +
      +
    • MQTT Bridge IP Address: <IP address of the MQTT Bridge from the previous step>
    • +
    • MQTT Bridge Port: <8080 if you have changed nothing in the previous commands>
    • +
    • MQTT Bridge MAC Address: <Mac address of machine running the Bridge code>
    • +
    + +

    This will create the link between SmartThings and the MQTT Bridge.

    + +

    SmartThings App

    + +

    The last step is to setup the SmartApp. After this, any registered devices will start sending their events to MQTT.

    + +

    Go to the Smart App IDE. Click New SmartApp, followed by From Code. Paste in the MQTT Bridge SmartApp code and click Save. Click Publish and then For Me. In the SmartThings mobile app, add the new SmartApp and configure it with your devices and MQTT Bridge device. Clicking done will subscribe SmartThings to your MQTT broker and begin 2-way propagation of events.

    + +

    Configure Home Assistant

    + +

    To add SmartThings devices to Home Assistant over MQTT, first enable MQTT in Home Assistant:

    + +
    +
    mqtt:
    +  broker: localhost
    +
    +
    +
    + +

    Replace localhost with the location of the running MQTT Broker. Devices from the MQTT Bridge are published to the path /smartthings/<Device Name>/<Atribute>

    + +

    For example, my Dimmer Z-Wave Lamp is called “Fireplace Lights” in SmartThings. The following topics are published:

    + + + + + + + + + + + + + + + + + + +
    TopicDescription
    /smartthings/Fireplace Lights/levelBrightness (0-99)
    /smartthings/Fireplace Lights/switchSwitch State (on/off)
    + +

    Here is an example Home Assistant config:

    + +
    +
    switch:
    +  platform: mqtt
    +  name: "Fireplace Lights"
    +  state_topic: "/smartthings/Fireplace Lights/switch"
    +  command_topic: "/smartthings/Fireplace Lights/switch"
    +  brightness_state_topic: "/smartthings/Fireplace Lights/level"
    +  brightness_command_topic: "/smartthings/Fireplace Lights/level"
    +  payload_on: "on"
    +  payload_off: "off"
    +  retain: true
    +
    +
    +
    + +

    We recommend retain: true for every MQTT device in order to keep states in sync when things become disconnected.

    + +

    Start digging through the MQTT Components in Home Assistant to find which components map to the new events being published to MQTT.

    + +

    Configuring with Docker-Compose

    + +

    Our personal preference for starting the whole suite of software is to use a single Docker-Compose file. Just create a file called docker-compose.yml like this:

    + +
    +
    mqtt:
    +    image: matteocollina/mosca
    +    ports:
    +        - 1883:1883
    +
    +mqttbridge:
    +    image: stjohnjohnson/smartthings-mqtt-bridge
    +    volumes:
    +        - ./mqtt-bridge:/config
    +    ports:
    +        - 8080:8080
    +    links:
    +        - mqtt
    +
    +homeassistant:
    +    image: balloob/home-assistant
    +    ports:
    +        - 80:80
    +    volumes:
    +        - ./home-assistant:/config
    +        - /etc/localtime:/etc/localtime:ro
    +    links:
    +        - mqtt
    +
    +
    +
    + +

    This will start home-assistant, MQTT, and the Bridge, in dependency order. All config can reference the name of the docker container instead of using IP addresses (e.g. mqtt for the broker host in Home Assistant).

    + +

    How it works

    + +

    HTTP Endpoint: There are really only 2 ways to communicate with the SmartThings hub that we could find. The easiest approach is to create a RESTful SmartApp authenticated with OAuth that provides state changes via HTTP directly. This approach is pretty straightforward to implement, but it requires communication with the SmartThings cloud service, and can’t be done entirely on your LAN. We hoped to keep all communication internal, and came up with a second approach.

    + +

    Custom Device Type: SmartThings custom device types allow developers to define handlers for HTTP events received directly over the local network by the SmartThings hub. Messages received are authenticated by MAC address, and can contain arbitrary strings in their payload. Since a Device Type is only ever tied to a single device, we need to add a SmartApp to the mix in order to translate events between individual devices and our special Home Assistant Bridge device. Here is what we have so far:

    + +
    +
    Z-Wave Switch        |
    +Zigbee motion sensor |<---> Bridge App <---> Bridge Device Type <---> <Local network>
    +Z-Wave light bulb    |
    +
    +
    +
    + +

    On the Home Assistant side, there is a powerful platform available based on the MQTT lightweight message bus protocol. Everything from lights to switches to temperature sensors can be defined in Home Assistant as an MQTT component, so it makes for a convenient integration point. This requires an MQTT broker for handling the message bus, and one last piece to translate between the HTTP that SmartThings supports and MQTT.

    + +

    Here is the final sequence of events:

    + +

    + + SmartThings Bridge Sequence + + SmartThings Bridge Sequence +

    + +

    There are a lot of stops along the way for these events, but each piece is a simple translation layer to shuttle the events between systems.

    + +

    Future Improvements

    +
      +
    • Raspberry pi: There is a lot of interest in getting this running on the Raspberry Pi. It only requires binaries compiled for ARM, so we plan to get ARM-compatible versions of the containers going at some point.
    • +
    • Authentication for MQTT: At the moment, the MQTT bridge doesn’t understand how to authenticate to MQTT, so only unauthenticated MQTT is supported. This is mitigated to some degree if you use our Docker Compose config, because MQTT’s port is not actually shared publicly.
    • +
    • Authentication for MQTT Bridge: Right now the bridge expects that anyone subscribing is the SmartThings hub. This could use proper authentication.
    • +
    + +]]>
    +
    + <![CDATA[Report the temperature with ESP8266 to MQTT]]> diff --git a/blog/categories/mqtt/index.html b/blog/categories/mqtt/index.html index 7d63cab728..18c0cec8f9 100644 --- a/blog/categories/mqtt/index.html +++ b/blog/categories/mqtt/index.html @@ -120,6 +120,43 @@ +

    2016

    + + + + + +

    2015

    @@ -257,6 +294,12 @@ diff --git a/blog/categories/public-service-announcement/atom.xml b/blog/categories/public-service-announcement/atom.xml index 80e7cd486e..9aa51513eb 100644 --- a/blog/categories/public-service-announcement/atom.xml +++ b/blog/categories/public-service-announcement/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Public-Service-Announcement | Home Assistant]]> - 2016-02-08T17:11:51+00:00 + 2016-02-09T07:49:53+00:00 https://home-assistant.io/ diff --git a/blog/categories/public-service-announcement/index.html b/blog/categories/public-service-announcement/index.html index 913485c7d5..0c3c26d743 100644 --- a/blog/categories/public-service-announcement/index.html +++ b/blog/categories/public-service-announcement/index.html @@ -219,6 +219,12 @@ diff --git a/blog/categories/release-notes/atom.xml b/blog/categories/release-notes/atom.xml index 5df194cdd3..64c8bab9e0 100644 --- a/blog/categories/release-notes/atom.xml +++ b/blog/categories/release-notes/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Release-Notes | Home Assistant]]> - 2016-02-08T17:11:51+00:00 + 2016-02-09T07:49:53+00:00 https://home-assistant.io/ diff --git a/blog/categories/release-notes/index.html b/blog/categories/release-notes/index.html index 66754f4ca5..6a54a2c501 100644 --- a/blog/categories/release-notes/index.html +++ b/blog/categories/release-notes/index.html @@ -1056,6 +1056,12 @@ diff --git a/blog/categories/survey/atom.xml b/blog/categories/survey/atom.xml index 7535433f01..bfe49af8dd 100644 --- a/blog/categories/survey/atom.xml +++ b/blog/categories/survey/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Survey | Home Assistant]]> - 2016-02-08T17:11:51+00:00 + 2016-02-09T07:49:53+00:00 https://home-assistant.io/ diff --git a/blog/categories/survey/index.html b/blog/categories/survey/index.html index 372c0e4462..b5f251602c 100644 --- a/blog/categories/survey/index.html +++ b/blog/categories/survey/index.html @@ -219,6 +219,12 @@ diff --git a/blog/categories/user-stories/atom.xml b/blog/categories/user-stories/atom.xml index bd768028c1..8f69d5b9f3 100644 --- a/blog/categories/user-stories/atom.xml +++ b/blog/categories/user-stories/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: User-Stories | Home Assistant]]> - 2016-02-08T17:11:51+00:00 + 2016-02-09T07:49:53+00:00 https://home-assistant.io/ diff --git a/blog/categories/user-stories/index.html b/blog/categories/user-stories/index.html index da184a53c7..1e2914ed42 100644 --- a/blog/categories/user-stories/index.html +++ b/blog/categories/user-stories/index.html @@ -219,6 +219,12 @@ diff --git a/blog/index.html b/blog/index.html index e764f87318..0d1e0fd84d 100644 --- a/blog/index.html +++ b/blog/index.html @@ -102,6 +102,62 @@ +
    +
    + +

    + Smarter SmartThings with MQTT and Home Assistant +

    + + + +
    + + + eight minutes reading time + + + + + + Comments + +
    + +
    + + +
    +

    This is a guest post by Home Assistant users Jeremiah Wuenschel and St. John Johnson.

    + +

    So you own a SmartThings Hub. You probably bought it when you were looking to get into the whole Home Automation hobby because it worked with pretty much everything and offered you the ability to automate anything. After a week of ownership, you realized that building dashboards and automating required writing way more Groovy then you expected. Then one day you were browsing reddit and discovered the amazingness that is Home Assistant! A solution that offered dashboards, graphs, working support for Nest, and REAL EASY automation!

    + +

    You spent your weekend getting everything set up, showing it off to your significant other, but in the end you got stumped when it came to integrating with all your existing SmartThings toys. What do I do now? Should I buy another hub? Should I just buy a Z-Wave stick?

    + +

    That’s where we came in. We wanted a solution that can bridge the awesomeness of Home Assistant with the SmartThings hub that works with almost everything.

    + +

    + +

    + + + + Read on → + +
    +
    +
    +
    @@ -626,57 +682,6 @@ The InfluxDB database is a so-called time se - -
    -
    - -
    -
    - -

    - Community Highlights -

    - - - -
    - - - less than one minute reading time - - - - - - Comments - -
    - -
    - - -
    -

    From time to time we come along things that are worth sharing with fellow Home Assisters. Here a list of some cool stuff from last week:

    - -

    First is the public beta of Let’s Encrypt. Let’s Encrypt is a new certificate authority that is free, automated and open. This means that it will now be very easy to secure your connection to Home Assistant while you are away from home. W1ll1am23 has written up a guide how to get started.

    - -

    The next thing is a show-off of some of the cool stuff people do with Home Assistant. This is miniconfig talking to Home Assistant using the Amazon Echo!

    - -
    - -
    - -

    And last but not least, Midwestern Mac did a microSD card performance comparison for the Raspberry Pi. If you’re using a Pi, make sure to check it out!

    - -

    diff --git a/blog/posts/2/index.html b/blog/posts/2/index.html index 8c945e8f20..023ae5ba90 100644 --- a/blog/posts/2/index.html +++ b/blog/posts/2/index.html @@ -102,6 +102,57 @@ +
    +
    + +

    + Community Highlights +

    + + + +
    + + + less than one minute reading time + + + + + + Comments + +
    + +
    + + +
    +

    From time to time we come along things that are worth sharing with fellow Home Assisters. Here a list of some cool stuff from last week:

    + +

    First is the public beta of Let’s Encrypt. Let’s Encrypt is a new certificate authority that is free, automated and open. This means that it will now be very easy to secure your connection to Home Assistant while you are away from home. W1ll1am23 has written up a guide how to get started.

    + +

    The next thing is a show-off of some of the cool stuff people do with Home Assistant. This is miniconfig talking to Home Assistant using the Amazon Echo!

    + +
    + +
    + +

    And last but not least, Midwestern Mac did a microSD card performance comparison for the Raspberry Pi. If you’re using a Pi, make sure to check it out!

    + + +
    +
    +
    +
    @@ -650,57 +701,6 @@ Inspried by a fea

    -
    -
    - -

    - Using MQTT with Home Assistant -

    - - - -
    - - - nine minutes reading time - - - - - - Comments - -
    - -
    - - -
    - -

    MQTT support was added to Home Assistant recently. The MQTT component will enable you to do all sort of things. Most likely you will use it to communicate with your devices. But Home Assistant doesn’t care where the data is coming from or is limited to real hardware as long as there is MQTT support. This means that it doesn’t matter if the data is coming from a human, a web service, or a device.

    - -

    A great example is shown in a Laundry Automation post in this blog.

    - -

    This post will give you a small overview of some other possibilities on how to use MQTT with Home Assistant.

    - - - - Read on → - -
    -
    -
    -