Tag: Raspberry Pi

  • Adding IKEA Trådfri to Home Assistant

    Adding IKEA Trådfri to Home Assistant

    This is not a paid advertisement. Most of the stuff I have ever bought from IKEA has turned out being crap in the long run (some very shortly) and that is why I normally keep avoiding their products as long as there are any reasonable alternatives available. However, now I have been satisfied so far after buying a Trådfri smart lighting kit and a punch of smart light bulbs.

    I was inspired by this article. I recommend you to have a look at it. It explains the technology and gives some idea of the overall setup. It is also a good introduction to what we are going to do next in this post. In case you have no idea what is Home Assistant, have a look their web page and also read this article. The aim here is to integrate Trådfri devices into the Home Assistant system.

    Ok, let’s get the basics away. Setting up the Trådfri kit is straight forward, on a pseudo level it goes like this:

    1. Download and install the mobile app
    2. Plugin the gateway to LAN network and power supply
    3. Configure the gateway using the mobile app
    4. Couple the remote control with the gateway
    5. Couple the light bulbs with the remote control

    Coupling the remote control with the other device is easy, basically just keep the device near to each other and press long the button until a light blinking indicates it is ready. The mobile app will guide you through anyway and if you face any problems, look at the detailed Trådfri manuals.

    After you have everything linked together within the Trådfri platform, you may be happy to control the lights with the Trådfri mobile app. Or not, if you wish to get them utilized for more advanced automation. For that, let’s link them to Home Assistant. This naturally requires a properly working instance of Home Assistant software running on a device like raspberry Pi or any other computer constantly serving the software.

    If you followed my previous Home Assistant blog post and you already have hass.io or any other Home Assistant installation running, bear with me and follow along.

    So, open your Home Assistant GUI in your web browser. If everything went as supposed to, you should automatically see Configurator suggesting to configure your Trådri device. If not, try restarting the Home Assistant.

    Click configure and type the security code from the bottom of the hub device.

    Voilà! You should be able to see all your Trådfri light bulbs in the user interface and be able to fully control them!

    Great, now we have them on the same platform as our possible other home automation systems, which opens infinite possibilities what comes to automating them.

    Next you may want to check out some basic light automation tricks by reading this post.

  • Getting on with Hass.io

    Getting on with Hass.io

    The first time I tested Home Assistant software was couple of years ago and it was on Linux desktop. I liked the idea and the execution, and it made me think I would like to able to build my own custom kit for some random home automation. So I decided I will get back to this as soon as I have a suitable platform to constantly run the software on. Later on, I found myself having a spare piece of Raspberry Pi 2 mini computer. Since then I have happily run Home Assistant on my Raspy and used it mostly for some lighting adjustments etc. Back then I installed my Home Assistant as Hassbian, which is a customized operating system for the Raspberry Pi. It was so far the easiest to install and use but requires the traditional command line access for maintenance actions. And now this may have changed. Follow through this tutorial and become a Home Assistant user in no time! All you need is a Raspberry Pi and minimum 4 GB SD card.

    Hass.io is a dedicated operating system that takes care of installing and managing Home Assistant software on Raspberry Pi. It was introduced in H0me Assistant blog post at the end of July 2017.

    Installation

    Let’s dive in. You may start the installation by looking at these instructions. Choose and download the software package depending on which device you are going to install Hass.io on. I went with Raspberry Pi 2. Extract the resinos-hassio-1.0-raspberrypix.img.bz2 file and flask it to your SD card using Etcher. Flashing may take up to 5-10 minutes. At this point we could setup the WiFi or static IP as the instructions suggest as an optional step. However, we go now without it. Since I will be are using an Ethernet connection with a router there should be no configuration required and it should work out of the box. Also, one could consider setting up a static address being not necessary – or even recommended at all. All right, let’s insert the SD card into Raspberry Pi and switch on the device.

    You can open a new browser tab and navigate to http://hassio.local:8123/ and wait couple of minutes. After the reboot ResinOS downloads Home Assistant and starts the installation. You will be soon able to see the following view at your browser window:

    preparing hass.io

    For me it took around 15 minutes Hass.io being setup and running. You will see the default Home Assistant welcome screen in your browser:

    welcome screen

     

    Getting Started

    Nice. Now we have a fresh Home Assistant installation properly running. Obviously the next actions are setting up configurations and automations. To do so, we still need to do some adjustments. The design philosophy of Hass.io seems to be making the management of Home Assistant via web browser GUI as easy as possible. However, as far I know it does not yet support full control over the configuration files. Hence, we need to build some kind of access to the file base. There are couple of options for this but for sake of simplicity we deside not to prefer any command line tool for this but go with Samba add-on, which gives us a way to handle the files on our local desktop environment.

    To install Samba follow these step on your Home Assistant instant opened in browser windows:

    1. On the left hand side menu click on Hass.io tab
    2. You will be noted there are no add-on installed, click on the link to add-on store
    3. Add-on store opens in the same view
    4. Scroll down to Samba Share and select it
    5. Click install
    6. It shows Info and Options but go with the defaults and click Start
    7. On the left menu again, select the first icon (Services) under Developer Tools
    8. Select the Domain as homeassistant and as Service set restart
    9. Then click on Call Service
    10. You will see a notification Connection lost. Reconnecting…
    11. After a minute or two Home Assistant is rebooted and Samba Sharing should be enabled

    Now you are able to find your Hass.io files from your desktop computer that is using the same WiFi network as the Rasbperry Pi. You can browse in the file system Network folder and find HASSIO directory. On Ubuntu it looks like this:

    windows sharing

    There you can find configuration.yaml and automations.yaml-files, which allow you to freely tweak and customized your Home Assistant installation as normally. Look at the tutorial and example resources at Home Assistant website to get started. Also, come back to check my next Home Assistant post I will make for introducing some of the basic and most useful setups. Good luck!