<![CDATA[Home Assistant]]> 2016-03-21T19:41:07+00:00 https://home-assistant.io/ Octopress <![CDATA[0.15: Unforked Open Z-Wave, templated service calls, extended scene support and PEP257 compliance.]]> 2016-03-12T18:55:00+00:00 https://home-assistant.io/blog/2016/03/12/z-wave-pep257-templated-service-calls Two weeks has past so here is 0.15! We have been focussing a lot on quality. Making sure the system is more stable and reliable. I usually try to highlight one cool thing in the release notes but this release has 4 exciting announcements!

  • @fabaff has upgraded the codebase to follow the PEP257 documentation standard.
  • @partofthething has migrated us to use the main Python Open Z-Wave library instead of our forked version.
  • To make our automations more powerful, @persandstrom added the option to use templates to dynamically create service calls. This works for automation, Alexa, universal media player, template switch. Learn more.
  • @MartinHjelmare has upgraded our scene support to now support all built-in services and components.

Besides bug fixes, this release also brings:

# Example using templates for service and data in service call.
# Works for automation, Alexa, universal media player, template switch.
automation:
  - trigger:
      - platform: state
        entity_id: switch.bathroom
    action:
      service_template: >
        {% if is_state('switch.bathroom', 'on') %}
          switch.turn_on
        {% else %}
          switch.turn_off
        {% endif %}
      data_template:
        entity_id: switch.{{ states('input_select.is') }}

Breaking Changes

  • Media Player: Attributes to call service play_media has been renamed to
    media_content_type and media_content_id, to match the corresponding media
    player state attributes. This change affects automations, scripts and scenes.
]]>
<![CDATA[0.14: Steam, D-Link smart plugs and Neurio Energy Sensors]]> 2016-02-27T22:15:00+00:00 https://home-assistant.io/blog/2016/02/27/steam-d-link-smart-plugs-and-neurio-energy-sensors It’s been another two weeks which means it’s time for release: 0.14!

Camera feeds are now directly embedded in the frontend.

Backwards incompatible changes

  • Component: Simple Alarm has been removed. Still available in the cookbook.
  • Script: Turning on a script that is already on is now a no-op instead of skipping current delay.
  • Wemo switches now have to be set up via the main Wemo component
  • Command line platforms for switch, sensor and binary_sensor have been renamed to command_line.
  • The rfxtrx sensors entity ids will incur a one time change to move to a stable format. See the docs for more details.
]]>
<![CDATA[Community Highlights]]> 2016-02-20T09:06:00+00:00 https://home-assistant.io/blog/2016/02/20/community-highlights Home Assistant land has been busy and a lot of people have been creating awesome stuff. We’ve added a cookbook section to the website full of examples how you can automate different things. Make sure you take a look and share your own recipes too!

Home automation demo by Part of the Thing

Haaska - Alexa Skill Adapter for Home Assistant

Haaska allows you to control lights, switches, and scenes exposed by your Home Assistant instance using an Amazon Echo. This is different from our own Alexa component because it will teach the Amazon Echo directly about the devices instead of teaching it to talk to Home Assistant. It will not allow you to use custom sentences but it will allow you to skip the ‘Ask Home Assistant’ part when giving commands:

  • “Alexa, set kitchen to twenty percent”
  • “Alexa, turn on evening scene”
  • “Alexa, turn off bedroom light”

Haaska on GitHub

Integrating Home Assistant with HomeKit

Contributor Maddox has created a plugin for HomeBridge, an open-source HomeKit bridge. This will allow you to control your home using Siri on your Apple devices. HomeBridge has recently restructured so you’ll have to install the plugin separately with the homebridge-homeassistant npm package.

Example config.json entry to load Home Assistant:

"platforms": [
    {
        "platform": "HomeAssistant",
        "name": "HomeAssistant",
        "host": "http://192.168.1.50:8123",
        "password": "xxx",
        "supported_types": ["light", "switch", "media_player", "scene"]
    }
]

HomeBridge on GitHub
HomeBridge Home Assistant Plugin

Custom alarm system with Home Assistant

User thaijames describes in the Home Assistant forums how he has created his own NFC-based alarm system using Home Assistant, DIY components and Garfield dolls.

Hold your NFC tag against the belly of Garfield to unlock the alarm.

]]>
<![CDATA[Multi-room audio with Snapcast, Mopidy, and Home Assistant]]> 2016-02-18T05:10:56+00:00 https://home-assistant.io/blog/2016/02/18/multi-room-audio-with-snapcast Would you like to listen to music in every room in your home, controlled from one source? Then multi-room audio is for you.

Multi-room audio can be achieved by having a computer attached to speakers in every room. On each computer, services run to play and/or control the audio. With this DIY approach, the kind of computer and speakers is very much up to you. It could be your desktop computer with attached powered speakers, your HTPC hooked up to your TV and receiver, a Raspberry Pi with Amp or DAC, or even an Android device.

You’ll need two key software packages, besides Home Assistant. The first is Mopidy, a music server that can play local files, or connect to streaming music services like Spotify. The second is Snapcast, which enables synchronized audio streaming across your network. Both can be integrated into Home Assistant. Each room audio device will run an instance of the Snapcast client, and optionally a Mopidy instance. Your server will run a special instance of Mopidy and the Snapcast server.

Finally, you also need a player to control Mopidy. Any MPD-compatible player will work, and there are several Mopidy-only web-based options available. On Android, Remotedy is particularly nice since you can access multiple Mopidy instances in one place.

Home Assistant will provide device status, and volume control for each room. If you want to play music in all your rooms (on all your clients), access the server instance of Mopidy. If you want to play music only in a specific room, access that specific Mopidy instance. If you’re using a web UI for Mopidy, you can add links to each instance in Home Assistant with the weblink component.

Staging

Configure Mopidy

Mopidy can be run with multiple configuration files, each extending the previous file. This is helpful when we’re running multiple instances with varying functionality.

core.conf

The core configuration is shared between all instances:

[mpd]
hostname = ::

[http]
hostname = ::

[audio]
output = alsasink

[spotify]
username = <redacted>
password = <redacted>

local.conf

Add the local configuration on computers that have local media files:

[local]
media_dir = <your/music/here>

snapcast.conf

Finally, the Mopidy instance that connects with Snapcast needs special configuration. Run on a different port to avoid conflicts if you have a second Mopidy instance running on your computer. The audio output is sent to a named pipe - Snapcast will read from there. Note that you may have to adjust the audio output attribute depending on your system and audio sources.

[mpd]
hostname = ::
port = 6601

[http]
hostname = ::
port = 6681

[audio]
output = audioresample ! audio/x-raw,rate=48000,channels=2,format=S16LE ! audioconvert ! wavenc ! filesink location=/tmp/snapfifo

Run Mopidy

To run a room-specific instance:

$ mopidy --config $CONF_DIR/core.conf

To run a room-specific instance with local media:

$ mopidy --config $CONF_DIR/core.conf:$CONF_DIR/local.conf

To run the special Snapcast-connected instance (with local media):

$ mopidy --config $CONF_DIR/core.conf:$CONF_DIR/local.conf:$CONF_DIR/snapcast.conf

Run Snapcast

Start the snapserver on the same server running Mopidy with the snapcast configuration.

$ snapserver   # or use systemd

Start the snapclient on computers that will be playing audio.

$ snapclient   # or use systemd, add -h <server host> if necessary

Configure Snapcast

There are a number of snapcast configuration options, but the one relevant to Home Assistant is the client names. You can set them in the snapserver configuration file, by default located at ~/.config/Snapcast/settings.json. Only edit this file while the snapserver is not running. Modify the name JSON value to your liking - this is how the client will be named in Home Assistant.

Configure Home Assistant

Use the mpd and snapcast components. Optionally, use weblink to provide easy access to a Mopidy web UI.

media_player:
- platform: snapcast
  host: xxxxx
- platform: mpd
  server: xxxx
  location: Multi-Room Controller
- platform: mpd
  server: xxx
  location: Room 1

weblink:
  entities:
  - name: Multi-Room Player
    url: xxxx
]]>
<![CDATA[0.13: Speedtest.net, Bloomsky, Splunk and Garage Doors]]> 2016-02-13T06:15:00+00:00 https://home-assistant.io/blog/2016/02/13/speedtest-bloomsky-splunk-and-garage-doors The focus of 0.13 was on test coverage, big cheers to @rmkraus for his hard work on this. I’m proud to announce that we’ve hit the 90% test coverage of the core + important components. A big milestone for the project.

Examples of the new input_select and weblink components.

Not only did we gain a lot of test coverage, we also attracted a lot of new developers that contributed a variety of components and platforms:

]]>
<![CDATA[Classifying the Internet of Things]]> 2016-02-12T06:31:00+00:00 https://home-assistant.io/blog/2016/02/12/classifying-the-internet-of-things The core of home automation is knowing what’s going on. The faster we know about a state change, the better we can serve the user. If you want to have your lights to turn on when you arrive at home, it doesn’t help if it only knows about it after you’ve already opened the door and manually (!!) turned on the light.

Each smart device consists of the ‘normal’ device and the piece that makes it ‘smart’: the connectivity. The connectivity part of a device can consists of either control, state or both.

State describes what a device is up to right now. For example, a light can be on with a red color and a medium brightness.

Control is about controlling the smart device by sending commands via an API. These commands can vary from configuring how a device works till mimicking how a user would interact with a device. A media player can allow skipping to the next track and a sensor could allow to configure its sensitivity or polling interval.

The Home Assistant APIs are setup to be as convenient as possible. However, a network is always as weak as it’s weakest link. In our case these are the integrations. Take for example controlling a light that does not report state. The only state Home Assistant can report on after sending a command is the assumed state: what do we expect the state of the light to be if the command worked.

We want our users to get the best home automation experience out there and this starts with making sure they have devices that work well with Home Assistant. That’s why we will start applying the following classifiers to our integrations:

Classifier Description
Assumed State We are unable to get the state of the device. Best we can do is to assume the state based on our last command.
Cloud Polling Integration of this device happens via the cloud and requires an active internet connection. Polling the state means that an update might be noticed later.
Cloud Push Integration of this device happens via the cloud and requires an active internet connection. Home Assistant will be notified as soon as a new state is available.
Local Polling Offers direct communication with device. Polling the state means that an update might be noticed later.
Local Push Offers direct communication with device. Home Assistant will be notified as soon as a new state is available.

The background to how we got to these classifiers can be read after the break.

State

How state is communicated can be broken down into 5 categories. They are not mutually exclusive - a device state can be available both via the cloud and local connectivity.

No state available

These are devices that do not have the capabilities to make their state available. They only allow to be controlled. For example, devices with infrared remote controls like TVs and ACs. You can press the turn on button on the remote but can only assume that your command was received and executed successfully. The device might not be powered or something is blocking the infrared receiver.

Home automation will have to approach such devices based on the assumption that it’s commands are received correctly: using optimistic updates. This means that after sending a command it will update the state of the device as if the command was received successfully.

Advantages:

  • None

Disadvantages:

  • Home automation will assume the wrong state if the the command is not received correctly or if the device is controlled in any other way outside of the home automation system.

Polling the cloud

These are devices that will only report their state to their own cloud backend. The cloud backend will allow reading the state but will not notify when a new state has arrived. This requires the home automation to check frequently if the state has been updated.

Advantages:

  • Able to control devices while at home or away.
  • Cloud has access to more computing power to mine the device data to suggest optimizations to the user.

Disadvantages:

  • It doesn’t work if the internet is down or the company stops support.
  • You are no longer in control about who has access to your data.

Cloud pushing new state

All off the previous section applies to this one. On top of that the cloud will now notify the home automation when a new state has arrived. This means that as soon as the cloud knows, the home automation knows.

Advantages:

  • New state known as soon as available in the cloud.

Polling the local device

These devices will offer an API that is locally accessible. The home automation will have to frequently check if the state has been updated.

Advantages:

  • Does not depend on the internet

Disadvantages:

  • To be pollable, a device needs to be always online which requires the device to be connected to a power source.

Local device pushing new state

The best of the best. These devices will send out a notice when they get to a new state. These devices usually use a home automation protocol to pass it’s message to a hub that will do the heavy lifting of managing and notifying subscribers

Advantages:

  • Near instant delivery of new states.
  • Able to get a long battery life by going into deep sleep between state updates.

Disadvantages:

  • If it does not also support polling, home automation will not be made aware of the state after booting up until it changes.
  • If using deep sleep and wifi, will suffer a delay when waking up because connecting to WiFi and receiving an IP takes time.

Control

Controlling a device can, just like state, be done through cloud and/or local connectivity. But the more important part of control is knowing if your command was a success and the new state of the device.

No control available

These devices are not able to be controlled. They will only offer state.

Poll State after sending command

These devices will require the state to be polled after sending a command to see if a command was successfull.

Advantages:

  • The state will be known right after the command was issued.

Disadvantages:

  • It can take time before the state gets updated. How often do we poll and how long do we wait till we consider the command failed? Also, a state may change because of other factors. Difficult to determine if the updated state is because of our command.

Device pushes state update

These devices will not return a new state as a result of the command but instead will push a new state right away. The downside of this approach is that we have to assume that a state update coming in within a certain period of time after a command is related to the command.

Command returns new state

The very best. These devices will answer the command with the new state after executing the command.

Classifying Home Assistant

Home Assistant tries to offer the best experience possible via its APIs. There are different ways of interacting with Home Assistant but all are local.

  • State polling is available via the REST API
  • There is a stream API that will push new states as soon as they arrive to subscribers. This is how the frontend is able to always stay in sync.
  • Calling a service on Home Assistant will return all states that changed while the service was executing. This sadly does not always include the new state of devices that push their new state, as they might arrive after the service has finished.
]]>
<![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:

Topic Description
smartthings/Fireplace Lights/level Brightness (0-99)
smartthings/Fireplace Lights/switch Switch 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]]> 2016-01-30T08:22:00+00:00 https://home-assistant.io/blog/2016/01/30/insteon-lifx-twitter-and-zigbee Another sprint has come to an end and it seems that we have not slowed down a single bit 🚀. 0.12 is full of new components, platforms and organizational additions.

I would like to give a shout out to Greg Dowling (@pavoni) as every release includes new work from him. He is constantly adding support for new platforms or improving the reliablity of existing components and platforms. Keep up the good work!

This release includes a very frequent requested feature: the ability to organize entities in different tabs in the frontend. See the demo to see this in action and read more in the group documentation how to get started.

Example of the new views in the frontend. Learn more.

Backwards incompatible changes

  • Nest config has moved from thermostat to the Nest component.
  • Entity IDs for Z-Wave devices are now generated in a deterministic way causing all IDs to change starting this release. This is a one time change.
]]>
<![CDATA[Perfect Home Automation]]> 2016-01-19T08:20:00+00:00 https://home-assistant.io/blog/2016/01/19/perfect-home-automation People often ask me about my vision for Home Assistant. Before I can describe where I want to go with Home Assistant, I should first talk about how home automation would look in my ideal world. This will be the aim of this post. I’m not going to focus on protocols, networks or specific hubs. That’s all implementation details. Instead, this post will focus on what is most important: the interaction between the users and their home.

You should not have to adapt to technology.

When people start using home automation, they always experience home control first: being able to control devices in new ways using a phone or computer. They believe the future is now and their app will be their remote for their lives. They only focus on what they are getting, not on what they are losing. You install some light bulbs and all of a sudden you are no longer able to use the light switches. You’ll arrive at home at night and have to pull out your phone, open the app, let it connect and finally you’ll be able to turn on the light. All while turning the light on could have been a switch away.

Yes, you can solve this with presence detection. What if your phone runs out of battery? You’ll have to resort to the switch again.

If you find that using your new home devices is cumbersome, the promise of home automation technology has failed you. Your lights should work with both a switch (or button) at the entrance of your room and via presence detection. Honestly, there are hardly any valid use cases for being able to control lights from your phone except for showing off.

You are not the only user of your home automation.

People tend to forget that they are not the only ones in their home. As the developer of your house you’re enthusiastic about the possibilities and are willing to overlook flaws. Chances are very high that the other people in your household have different hobbies and just want to mind their own business.

This means that everything you automate has to work flawlessly. If you successfully manage to cause a response to some stimulus 90% of the time, you’re going to have a disproportionately poor experience 10% of the time. A common automation that fits this pattern is to fade the lights when you start watching a movie or series in the living room. It only works if everyone is watching.

Limit the impact of false positives and negatives.

With every automation, you always have to think: what will be the impact if it doesn’t work? Home automation is composed of many different systems by many different vendors that speak many different protocols: things will go wrong. It’s up to you to make sure that they have a limited impact when they fail. Ideally, devices should fall back to a pre-smart home experience. A Philips Hue bulb will act like a standard white light if turned on/off using a normal switch or when not connected to a hub. If things get worse when your system is out of order, your users will revolt. Take for example the Nest thermostat that had a bug in the beginning of January which caused it to stop heating the house, yikes!

The perfect app is no app.

Home automation should blend with your current workflow, not replace it. For most devices, there is no faster way to control most devices than how you are already doing it today. Most of the time, the best app is no app. The only interface that can be more convenient, and is accessible for visitors of your home of all ages is a voice interface. The industry has realized this too and there are some major players focussing on voice interaction. Take Apple for example: the only way to control your HomeKit devices is with Siri. Amazon has taken it one step further with the Amazon Echo, providing an always-listening connected speaker/microphone for the living room. I expect a lot more companies to join this segment in 2016.

Voice interfaces are not perfect either. The speed at which you can issue commands is low because you have to wait for a response. There are also issues with the discoverability of commands, recognition of accents and dependency on the cloud for processing your voice. I believe that all but the first one are problems that are going to be solved eventually.

This however doesn’t mean there isn’t a place for apps, there definitely is. They are perfectly well-suited for checking in while you’re away, browsing the state changes of your house or making the lights go all funky when there are kids visiting.

Your system should run at home, not in the cloud.

The cloud is a magical thing. Somewhere in the world there are computers collecting the data that your house generates, testing them against your automation rules and sending commands back when needed. The cloud will receive updates and improve itself over time so it is able to serve you better. Until it’s not. There are many reasons why your home might lose its connection to the cloud. The internet can stop working, an update might have gone wrong or the servers running the cloud crash.

When this happens, your house should be able to keep functioning. The cloud should be treated as an extension to your smart home instead of running it. That way you’ll avoid awkward situations like when Amazon AWS was down and the Amazon Echo stopped working.

Good home automation never annoys but is missed when it is not working.

Thanks to Chris LaRose for this feedback and comments.

]]>
<![CDATA[0.11: Extended support for DIY solutions]]> 2016-01-17T23:20:00+00:00 https://home-assistant.io/blog/2016/01/17/extended-support-for-diy-solutions First release of 2016 and we are on 🔥! The main repository has passed 2500 ⭐ on GitHub (2596 ⭐ as of now). This release also has a record number of 20 contributors all working on improving and extending Home Assistant. With the continued growth, I am very excited to see what 2016 will bring us 🤘.

Backwards incompatible changes

]]>
<![CDATA[0.10: Amazon Echo, iCloud, Dweet.io, Twitch and templating support!]]> 2015-12-22T09:30:00+00:00 https://home-assistant.io/blog/2015/12/22/amazon-echo-icloud-and-templates Alrighty, it’s time for Home Assistant 0.10. A lot amazing things have changed and sadly we also had to introduce a bunch of backwards incompatible changes. I would like to give a big shoutout to Philip Lundrigan (@philipbl) who put a lot in effort in helping the migration to move towards using templates for a wide variety of platforms.

Templates

This release introduces templates. This will allow you to parse data before it gets processed or create messages for notifications on the fly based on data within Home Assistant. The notification component and the new Alexa/Amazon Echo component are both using the new template functionality to render responses. A template editor has been added to the developer tool section in the app so you can get instant feedback if your templates are working or not.

The temperature at home is {{ states('sensor.temperature') }}.

More information and examples can be found in the template documentation.

Breaking changes

Templates will now be the only way to extract data from ‘raw’ sources like REST, CommandSensor or MQTT. This will replace any specific option that used to do this before. This means that precision, factor, attribute or json_path etc will no longer work.

Affected components and platforms:

]]>
<![CDATA[Set up encryption using Let's Encrypt]]> 2015-12-13T18:05:00+00:00 https://home-assistant.io/blog/2015/12/13/setup-encryption-using-lets-encrypt Exposing your Home Assistant instance outside of your network always has been tricky. You have to set up port forwarding on your router and most likely add a dynamic DNS service to work around your ISP changing your IP. After this you would be able to use Home Assistant from anywhere but there is one big red flag: no encryption.

This tutorial will take you through the steps to setup a dynamic DNS for your IP and allow trusted encrypted connection to it - for free using DuckDNS and Let’s Encrypt.

Requirements

The DuckDNS part of this tutorial has no requirements but there are a few requirements as of now to run the Let’s Encrypt client.

  • Direct connection to the internet or admin access to your router to set up port forwarding
  • A machine running a Unix-ish OS that include Python 2.6 or 2.7 (Docker can be used)

DuckDNS

The first step is to set up DuckDNS. This is a free dynamic DNS service that you can use to get a DuckDNS.org subdomain to point at your house. A dynamic DNS service works by having your home computer tell DuckDNS.org every 5 minutes what its IP is so that DuckDNS can make sure your domain name is set up correctly.

For this example we will assume our domain is hass-example.duckdns.org.

First step is to acquire and set up our domain name. For this, go to DuckDNS, log in with any of the supported login providers and add a domain. After this check out their installation instructions to finish your installation of DuckDNS. If you’re on a Raspberry Pi, see ‘Pi’ in the category ‘Operating Systems’.

Let’s Encrypt

Let’s Encrypt is a free, automated, and open certificate authority (CA). We will use this to acquire a certificate that can be used to encrypted our connection with Home Assistant.

Let’s Encrypt will give you a free 90-day certificate if you pass their domain validation challenge. Domains are validated by having certain data be accessible on your domain for Let’s Encrypt (they describe it better themselves).

Assuming that your home is behind a router, the first thing to do is to set up port forwarding from your router to your computer that will run Let’s Encrypt. For the Let’s Encrypt set up we need to temporary forward ports 80 (http connections) and 443 (https connections). This can be set up by accessing your router admin interface (Site with port forwarding instructions per router).

Now you’re ready to run Let’s Encrypt:

$ git clone https://github.com/letsencrypt/letsencrypt
[…]
$ cd letsencrypt
$ ./letsencrypt-auto certonly --email your@email.address -d hass-example.duckdns.org

Updating letsencrypt and virtual environment dependencies.......
Running with virtualenv: sudo /path/letsencrypt/bin/letsencrypt certonly --email your@e-mail.address -d hass-example.duckdns.org

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at
   /etc/letsencrypt/live/hass-example.duckdns.org/fullchain.pem. Your cert
   will expire on 2016-03-12. To obtain a new version of the
   certificate in the future, simply run Let's Encrypt again.
 - If like Let's Encrypt, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

If you’re using Docker, run the following command to generate the required keys:

sudo mkdir /etc/letsencrypt /var/lib/letsencrypt
sudo docker run -it --rm -p 443:443 -p 80:80 --name letsencrypt \
                -v "/etc/letsencrypt:/etc/letsencrypt" \
                -v "/var/lib/letsencrypt:/var/lib/letsencrypt" \
                quay.io/letsencrypt/letsencrypt:latest certonly \
                --email your@e-mail.address -d hass-example.duckdns.org

With either method your certificate will be generated and put in the directory /etc/letsencrypt/live/hass-example.duckdns.org. As the lifetime is only 90 days, you will have to repeat this every 90 days.

Home Assistant

Before updating the Home Assistant configuration, we have to update the port forwarding at your router config. We can drop the port forwarding for port 80 as we no longer care about unecrypted messages. Update port 443 to forward to port 8123 on the computer that will run Home Assistant.

The final step is to point Home Assistant at the generated certificates. Before you do this, make sure that the user running Home Assistant has read access to the folder that holds the certificates.

http:
  api_password: YOUR_SECRET_PASSWORD
  ssl_certificate: /etc/letsencrypt/live/hass.example.com/fullchain.pem
  ssl_key: /etc/letsencrypt/live/hass.example.com/privkey.pem

You can now navigate to https://hass-example.duckdns.org and enjoy encryption!

Big thanks to Fabian Affolter for his help and feedback on this article.

]]>
<![CDATA[[Update: decision reversed!] Philips Hue blocks 3rd party lights]]> 2015-12-12T18:44:00+00:00 https://home-assistant.io/blog/2015/12/12/philips-hue-blocks-3rd-party-bulbs Update Dec 16: Great news! Philips has decided to reverse their decision and is working on a software update to allow 3rd party light bulbs again.

Philips Hue FAQ entries regarding reversing the decision.

Original post:

Philips Hue was one of the first to get smart lights accepted by the mainstream. Their Zigbee-based hub is rock solid, never crashes, great API and worked with other Zigbee light bulbs too. They are a bit expensive but the platform was worth every penny, till now.

Yesterday a thread on /r/homeautomation published that Philips Hue now blocks all but their own bulbs and those of “friends of Hue”. I have been able to confirm this in the Philips Hue FAQ (Update Dec 14: they have removed the entries - mirror here):

Philips Hue FAQ entries regarding 3rd party light bulbs.

This means that after you update your Hue bridge to the latest version:

  • As of now, you can still use your existing paired 3rd party light bulbs
  • You cannot pair new 3rd party light bulbs
  • You’re out of luck if for some reason you have to pair existing 3rd party light bulbs again
  • Resetting your hub will force pairing of all your bulbs again

If you own a Philips Hue hub and are using 3rd party light bulbs, make sure you do not upgrade your hub if you want to be able to pair new 3rd party lightbulbs. But do realize that you are sitting on a ticking time bomb.

I have read, but have been unable to confirm it, that resetting your hub will force a software upgrade. So beware of that too.

I will no longer suggest people to buy into the Philips Hue ecosystem.

]]>
<![CDATA[Activating Tasker tasks from Home Assistant using command line switches]]> 2015-12-10T10:39:41+00:00 https://home-assistant.io/blog/2015/12/10/activating-tasker-tasks-from-home-assistant-using-command-line-switches
In this tutorial I will explain how you can activate Tasker tasks from Home Assistant command line switches. We are going to set up a switch that when toggled will make your Android device say either “On” or “Off”.

You could also do this with the automation component instead so whenever you put your house to sleep mode for example your Android device will open up Google Play Books or the Kindle app ready for you to read as well as dimming your lights, but this tutorial is all about the switches.

AutoRemote URL

First things first you should install Tasker and AutoRemote onto your Android device and launch AutoRemote. You should see a URL above the QR code, visit it in your browser and it should bring up a page a bit like this.

Now type in SayOn in the Message box and you should see a box appear on the right with a URL in it, this is what we will be using in the Python script later on so save that for later. Do the same thing again but this time replace SayOn with SayOff. Now just click the Send message now! button to test that your commands will get sent to your Android device, if they do you will see a toast message at the bottom of your screen like this one.

Tasker Setup

Open up Tasker and make sure you’re in the PROFILES tab, then select the plus icon to create a new profile. Select Event -> Plugin -> AutoRemote -> AutoRemote and then the pencil icon to configure the AutoRemote event. Select Message Filter and enter in SayOn then go back until it asks you for a task. Select New task then just leave the next field blank and select the tick icon.
This is where we’ll configure our task, so select the plus icon to select an action. Select Alert -> Say to add a Say action. Enter On in the text field and go back to test your task, make sure your media volume is up then select the play icon, you should hear your device say “On”.

Now you can go back to the main Tasker screen and create another profile but this time replace SayOn with SayOff and On with Off. After you’ve done that go to the main screen again and select the menu button at the top then Exit and Save first to make sure everything is saved properly.

Python Script

Now it’s time to set it up the script, so create a new Python script and name it On.py then enter this code:

import requests
requests.get('[URL]')

Enter in your “On” URL then save it. Create another script but this time call it Off.py and enter your “off” URL instead.

Home Assistant Configuration

Add a command line switch to your Home Assistant configuration:

switch:
  platform: command_switch
  switches:
    tasker_say:
      oncmd: python "[LocationOfOnScript]"
      offcmd: python "[LocationOfOffScript]"

Now load up Home Assistant and whenever you toggle the switch you created your Android device will respond with either “On” or “Off”. :-)

]]>
<![CDATA[InfluxDB and Grafana]]> 2015-12-07T14:15:13+00:00 https://home-assistant.io/blog/2015/12/07/influxdb-and-grafana
The InfluxDB database is a so-called time series database primarly designed to store sensor data and real-time analytics.

The influxdb component makes it possible to transfer all state changes from Home Assistant to an external InfluxDB database.

The first step is to install the InfluxDB packages. If you are not running Fedora, check the installation section for further details.

$ sudo dnf -y install http://influxdb.s3.amazonaws.com/influxdb-0.9.5.1-1.x86_64.rpm

Launch the InfluxDB service.

$ sudo systemctl start influxdb

If everything went well, then the web interface of the database should be accessible at http://localhost:8083/. Create a database home_assistant to use with Home Assistant either with the web interface or the commandline tool influx.

InfluxDB web frontend

$ influx
Visit https://enterprise.influxdata.com to register for updates, InfluxDB server management, and monitoring.
Connected to http://localhost:8086 version 0.9.5.1
InfluxDB shell 0.9.5.1
> CREATE DATABASE home_assistant

An optional step is to create a user. Keep in mind to adjust the configuration (add username and password) in the next step if you prefer to go this way.

> CREATE USER "home-assistant" WITH PASSWORD 'password'

To use the influxdb component in your installation, add the following to your configuration.yaml file:

influxdb:
  host: 127.0.0.1

After you restart Home Assistant you should see that the InfluxDB database gets filled. The language to query the database is similar to SQL.

$ influx
[...]
> USE home_assistant
Using database home_assistant
> SELECT * FROM binary_sensor
name: binary_sensor
-------------------
time            domain        entity_id    value
1449496577000000000    binary_sensor    bathroom_door    0
1449496577000000000    binary_sensor    bathroom_window    0
1449496577000000000    binary_sensor    basement_door    0
1449496577000000000    binary_sensor    basement_window    0
1449496684000000000    binary_sensor    bathroom_window    1
[...]

Grafana is a dashboard that can create graphs from different sources including InfluxDB. The installation is simple, and there are detailed steps for many different configurations on the Grafana installation page. For a recent system that is running Fedora:

$ sudo dnf -y install https://grafanarel.s3.amazonaws.com/builds/grafana-2.5.0-1.x86_64.rpm

Start the grafana server.

$ sudo systemctl daemon-reload
$ sudo systemctl start grafana-server
$ sudo systemctl status grafana-server

Login with the username admin and the password admin at http://localhost:3000/login. Now follow the InfluxDB setup instructions.

Now you can start to create dashboards and graphs. You have various options to get the data from the graph. The next image just shows a screenshot of the setting for a temperature sensor.

Grafana settings

If the graph is not showing up in the dashboard you need to adjust the time range in the right upper corner. The graph is created for all state changes recorded by Home Assistant.

Grafana Temperature graph

]]>
<![CDATA[0.9: Rollershutters, locks, binary sensors and InfluxDB]]> 2015-12-06T19:29:00+00:00 https://home-assistant.io/blog/2015/12/06/locks-rollershutters-binary-sensors-and-influxdb-support It’s been a few weeks but we managed to polish a nice new release of Home Assistant for y’all!

To update, run pip3 install --upgrade homeassistant.

]]>
<![CDATA[Community Highlights]]> 2015-12-05T23:39:00+00:00 https://home-assistant.io/blog/2015/12/05/community-highlights 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!

]]>
<![CDATA[Survey November 2015]]> 2015-11-22T14:51:18+00:00 https://home-assistant.io/blog/2015/11/22/survey-november-2015 Around a week ago we started with the first survey. Now 30 people have participated. Thank you very much if you did. We think that’s enough time to have some “only partially representative” data. It’s hard to tell how many Home Assistant users are out there. Currently there are 215 members in our Gitter chat room and last week PyPI counted 5063 downloads.

The idea was to anonymously collect some details about the usage of the different parts of Home Assistant and a little bit about the environment its running in.

Thanks to Python, users are running Home Assistant on the most popular Linux distributions and other operating systems including OS X and Microsoft Windows. One quarter of the operating systems are unknown which leads to the assumption that it is possible to run Home Assistant on most of the available operation systems today. We hope that *BSD users have fun too. The Hardware platform of choice seems to be x86_64 and ARM.

Of course most users are running with the automation component otherwise it would make much sense to use Home Assistant. The sun component is used a lot too. We hope that this is not because this component is enabled by default.

The Alarm control panels and the camera component are both used by around one third of the participants of the survey. It’s safe to say that they cover a niche, but they will gain momentum when people discover how they can build alarm systems with Home Assistant.

Philips Hue is the “winner” in the light category closely followed by MQTT lights. Google Cast and Plex are the top media player platforms. Pushbullet is by far the most-used notification platform. If you followed the recent efforts to improve this platform it’s comprehensible.

It’s interesting to see that most of the sensor, switch, and thermostat platforms are used. A lot of people seem to be interested in the weather data provided by the Forecast sensor. The MQTT sensors and switches are deployed in almost 50% of all Home Assistant setups.

Home Assistant releases

Operating systems

Hardware platforms

Components

Alarm Control Panels and Cameras

Device trackers

Lights

Media players

Notifications

Sensors

Switches

Thermostats

The conclusion is that MQTT is popular in almost every section from Alarm Control Panel, presence detection with owntracks, sensors and switches, and now even for lights.

The interpretation of the data is up to you. Again, thanks for participating in this survey.

]]>
<![CDATA[0.8: Honeywell Thermostats, Orvibo switches and Z-Wave switches and lights ]]> 2015-11-16T21:27:00+00:00 https://home-assistant.io/blog/2015/11/16/zwave-switches-lights-and-honeywell-thermostats-now-supported We have all been hard at work to get this latest release ready. One of the big highlights in this release is the introduction of an extended iconset to be used in the frontend (credits to @happyleavesaoc for idea and prototype). To get started with customizing, pick any icon from MaterialDesignIcons.com, prefix the name with mdi: and stick it into your customize section in configuration.yaml:

homeassistant:
  customize:
    switch.ac:
      icon: 'mdi:air-conditioner'

Breaking changes

  • Any existing zone icon will have to be replaced with one from MaterialDesignIcons.com.
  • LimitlessLED light services require colors to be specified in RGB instead of XY.

Changes

]]>
<![CDATA[0.7.6: Amazon FireTV, Radiotherm thermostats]]> 2015-10-26T18:10:00+00:00 https://home-assistant.io/blog/2015/10/26/firetv-and-radiotherm-now-supported After two weeks of hard work I’m proud to announce the release of Home Assistant v0.7.6. For this release the main focus was bugs, test coverage and documentation. And we exceeded expectations on all three fronts. Bugs have been squashed, test coverage increased to 85% and thanks to the hard work by @fabaff and myself the component section on the website has gotten a complete revamp.

Changes

Breaking changes

As part of this release we did some cleanup which introduced backwards incompatible changes:

Heat Control thermostat no longer includes scheduling features.
This feature has been removed completely. Use the automation component instead to control target temperature.

Config changed for calling a service from a script.
execute_service: has been replaced with service:. See component page for example. The old method will continue working for some time.

Scenes can no longer be turned off.
It is no longer possible to turn a scene off after it has been activated. The way it worked was unpredictable and causes a lot of confusion.

Downloader treats relative paths now relative to the config dir instead of the current working dir.
This makes more sense as most people run Home Assistant as a daemon

]]>