<![CDATA[Category: Internet-of-Things | Home Assistant]]> 2018-03-06T20:48:12+00:00 https://home-assistant.io/ Octopress <![CDATA[IKEA Trådfri: Internet of Things done right]]> 2017-04-17T08:04:05+00:00 https://home-assistant.io/blog/2017/04/17/ikea-tradfri-internet-of-things-done-right ## Works out of the box IKEA Trådfri focuses on the basics: making a product that works out of the box. They sell various dimming kits. Each contain a light and a remote paired to control the light. You put the light into the socket, slide the battery into the remote and. it. works. No need to purchase a gateway, download an app and use your phone to set it up. Heck, you don’t even need internet to get started! You will only need to buy the gateway if you want to use your phone as a remote or set up home automation. ## Only works locally The gateway only works locally. It only reaches out to the internet to synchronize the time and to check for firmware updates. This is awesome for many different reasons. **Privacy & Security.** No one but yourself will have access to the state of your house. And inside your house your communication with the gateway is encrypted. **Reliability & Speed.** All communication will always happen locally. Even if your internet will go out, you can still control your lights and your automations will still run. Even if IKEA would decide to drop support it will still continue to work. Check out [this blog post by Matthew Garrett][mjg59] for a more in-depth analysis of the security of the gateway. His conclusion:
Overall: as far as design goes, this is one of the most secure IoT-style devices I've looked at. I haven't examined the COAP stack in detail to figure out whether it has any exploitable bugs, but the attack surface is pretty much as minimal as it could be while still retaining any functionality at all. I'm impressed.
## Based on open standards IKEA Trådfri devices use the open standard Zigbee to communicate. The gateway speaks both Zigbee and connects to your network to offer an API based on the open standard CoAP. The API communication is secured via the open standard DTLS. Because it’s based on Zigbee, you don’t have to just buy IKEA devices the rest of your life. For example, Philips Hue lights will pair just fine with the IKEA gateway. Note that there are reports that the other way around, pairing an IKEA light to the Philips Hue hub is currently not possible. IKEA is working on it according to [a post by Philips Hue support][hue-support]:
The non-interoperability between the newly launched IKEA smart lighting products and the Philips Hue bridge has been analyzed. One of the issues found is that the IKEA bulbs report their ProfileID as corresponding to the ZigBee Home Automation (ZHA) profile rather than the ZigBee Light Link (ZLL) profile. As the IKEA bulbs do not behave fully compliant with the ZLL standard, they are rejected by the Hue bridge. IKEA is aware of this and informed us their intent is to have the IKEA smart lighting bulbs to work with the Philips Hue bridge.
## Affordable A white IKEA light bulb that just supports dimming starts at $12. You’ll have to shell out $18 If you want a white bulb that can control the light temperature to allow for different shades of white (relax, cool, focus etc). These prices are slightly lower than the competition. Right now on Amazon the cheapest just-dimming white bulbs come in at $15. However what really differentiates this system is the availability of all the cheap remotes and motion sensors. Ranging between $20 and $27 you get a light and a remote. Standalone Zigbee remotes on Amazon currently start at $21! Remotes are [a very important aspect of home automation][perfect]. The electricity has to be always on for the bulbs to function so you’ll need Zigbee switches and remotes to control your lights. The fact that they are so cheap will really help with adoption.

Prices of the various available dimming kits.

## Useful design The lights and gateway are all made with a simple design and will easily blend into your home. They did sneak in some great and useful things. You can slide the cover off the gateway and open it up. Inside is a mini case for the actual electronics but mainly it’s just empty space so you can roll up any excess network and usb cable from the hub inside!

The cables you don't need can be hidden in the gateway.

Another nice feature is that the remote comes with a magnetic mount for the wall. ## Able to subscribe to changes (local push) This is a feature that I am really excited about. By being able to subscribe to changes in the Zigbee network Home Assistant will be able to instantly be notified about changes and trigger automations if necessary. This means that you will be able to turn the power on for a light and see it instantly turn on in Home Assistant. [_(Learn more about the different ways IoT devices broadcast changes)_][classification] ## Full integration in Home Assistant 0.43 (scheduled for release April 22) Home Assistant will automatically discover gateways on your network and guide the user to set them up. Once IKEA Trådfri got released, our community, lead by [Patrik], got quickly organized and started analyzing the different aspects [in our forums][forums]. I am happy to say that the end result is a standalone Python library [pytradfri] to control the gateway. This means that starting from our next release, Home Assistant 0.43, we will auto discover your gateway and integrate all your lights. The initial version of our integration will not yet stream events from the gateway. We’re still working on figuring out that part of the API.

After automatic discovery, Home Assistant will ask the user to finish pairing with the gateway.

## Downside: not many integrations yet The one major downside right now is that there are not many integrations yet because the system is brand new. There are [rumors] that Homekit is planned for October. And given the way the API is set up, I expect Google Home and Amazon Echo (Alexa) to eventually announce integration too. Since Home Assistant does integrate with it, you can use Home Assistant to bridge to these systems. For Homekit use [Homebridge] with the [Home Assistant plugin][hb-hass]. For integration with Google Home and Amazon Echo use [the Emulated Hue component][emulated_hue]. For Google Home you can also use [the API.ai integration][apiai] and Amazon Echo can also work with [Haaska]. ## Semi-downside: you can’t control your lights remotely Because the system is local only, you won’t be able to control your lights remotely. As with the previous downside, you will be able to use Home Assistant to make your system available remotely. Classified this as a semi-downside because besides showing off, the actual use cases are very rare. Although it makes [great marketing material]. ## Conclusion With Trådfri, IKEA has managed to put out an affordable and secure home automation system that does not compromise on functionality or design. There are still some downsides which I expect to get resolved in the future. As it currently stands, this is going to be the perfect companion hardware to work with Home Assistant: local, affordable, secure. And as cherry on the pie, local push will make us aware of changes right away. [tradfri]: http://www.ikea.com/us/en/catalog/categories/departments/lighting/36812/ [mjg59]: http://mjg59.dreamwidth.org/47803.html [hue-support]: https://developers.meethue.com/content/philips-hue-and-ikea-tr%C3%A5dfri#comment-2686 [perfect]: https://home-assistant.io/blog/2016/01/19/perfect-home-automation/#you-should-not-have-to-adapt-to-technology [Patrik]: https://github.com/ggravlingen [forums]: https://community.home-assistant.io/t/ikea-tradfri-gateway-zigbee/14788 [pytradfri]: https://github.com/ggravlingen/pytradfri [rumors]: https://github.com/bwssytems/ha-bridge/issues/570#issuecomment-293505087 [Homebridge]: https://github.com/nfarina/homebridge [hb-hass]: https://github.com/home-assistant/homebridge-homeassistant [emulated_hue]: https://home-assistant.io/components/emulated_hue/ [apiai]: https://home-assistant.io/components/apiai/ [Haaska]: https://github.com/auchter/haaska [great marketing material]: https://i2.wp.com/blog.smartthings.com/wp-content/uploads/2014/06/summer-vacay-683x405-blog.png?fit=683%2C405&ssl=1 [classification]: https://home-assistant.io/blog/2016/02/12/classifying-the-internet-of-things/ ]]>
<![CDATA[Your hub should be local and open]]> 2016-04-05T21:11:00+00:00 https://home-assistant.io/blog/2016/04/05/your-hub-should-be-local-and-open The cloud should be treated as an extension to your smart home instead of running it. Your hub should not be affected when your internet breaks down or the company that sold you your hub goes out of business. It should work locally so that it can continue to work even long after the vendor goes out of business or decides to kill it. Preferably, your hub should also be open so that the community can take over development after the vendor stops caring. Unless you can afford losing a product here and there, be cautious when buying IoT products that depend on the cloud from companies that are not well established. The chances are high that they go bankrupt or get acquired and closed. This however is easier said than done as [Gartner] predicts that by 2017, 50 percent of IoT solutions will originate in startups that are less than three years old. [medium-revolv]: https://medium.com/@arlogilbert/the-time-that-tony-fadell-sold-me-a-container-of-hummus-cb0941c762c1#.rmppks86a [ninjasphere]: https://discuss.ninjablocks.com/t/ninja-blocks-whats-been-happening-whats-happening-next/3608 [perfect-cloud]: /blog/2016/01/19/perfect-home-automation/#your-system-should-run-at-home-not-in-the-cloud [Gartner]: http://www.gartner.com/newsroom/id/2869521 ]]> <![CDATA[Classifying the Internet of Things]]> 2016-02-12T22:31:00+00:00 https://home-assistant.io/blog/2016/02/12/classifying-the-internet-of-things
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 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 successful. 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[Perfect Home Automation]]> 2016-01-19T08:20:00+00:00 https://home-assistant.io/blog/2016/01/19/perfect-home-automation 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][nest-bug] which caused it to stop heating the house, yikes! [nest-bug]: http://www.nytimes.com/2016/01/14/fashion/nest-thermostat-glitch-battery-dies-software-freeze.html ### 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][echo-crash]. [echo-crash]: http://www.zdnet.com/article/the-night-alexa-lost-her-mind/ **Good home automation never annoys but is missed when it is not working.** *Thanks to Chris LaRose for this feedback and comments.* ]]> <![CDATA[Home Control, Automation & the Smart Home]]> 2014-12-26T18:23:13+00:00 https://home-assistant.io/blog/2014/12/26/home-control-home-automation-and-the-smart-home Hub dashboard example Example of a hub's dashboard. Showing the state of 2 persons, 4 lights and the sun.

A step up from home control is to have the user setup triggers to send commands based on information in the home control layer. For example, to turn on the lights when a person arrives home. A hub with these capabilities is capable of **home automation**. Most hubs on the market today offer this in various degrees of functionality and usability. Some IoT-capable devices offer this too, but only control themselves and are usually limited to location and time-based events. The last category, and this is still very much in the future, is the **smart home**. A self-learning and adopting system that will decide which events should impact other devices. An example of a smart home in action is that it observes that when person A comes home, the lights in the living room and the kitchen switch on. While if person B comes home, the lights in the living room and the study room are switched on. The next time person A or B comes home, the smart home will turn on its preferred lights without any configuration being set by the user. A glimpse today at how the future can look is the [Nest thermostat](https://nest.com/). A thermostat smart enough to learn your schedule and adjust its own temperature accordingly. All this results in the following overview of Home Automation.

Home Automation landscape Overview of the home automation landscape.

### Challenges You are probably wondering, this all seems relatively simple, why don't I have my very own smart home yet? There are a couple of challenges today that keep us from stepping into the future. #### More Internet of Things-capable devices The majority of the IoT products out there are either lights, switches or presence detection. That's not enough for your home to be very smart about. We need televisions, fridges, ovens and more to join the party to increase the number of devices that we can control. #### More data Most first generation IoT devices are only exposing information that is needed for controlling it. We need to be able to track all interactions with each device for our smart home to learn how interaction with devices influence other things. For example, we need to be able to track how many cups of coffee were made or how often the fridge was open. This will increase the information flow and open up a whole bunch of new possibilities. For example, the smart home can order new coffee when you're running low. #### Easy to use, open software that we can trust To increase adoption we will need people to trust their smart home system. It will be very tough to convince people to upgrade all their devices and upload all interactions with each of them to the cloud. This data could reveal their whole life including all bad habits. That's why such a system should be simple and open-source so people can validate that their data generated at home stays home. Anoter important booster for adoption is that the software should be easy to set up and use by the average user. A lot of people are not burning their hands yet on Home Automation because they are scared of configurating it. Home Assistant is trying to be this software. It is not there yet but trying hard. Device discovery and a user interface for configuring home automation are problems we hope to tackle in 2015 while not sacrificing any modularity or usability. Happy new year! ]]>